This repository serves as a technical reference and implementation guide for the Svelte 5 UI language. It covers the fundamental shift from legacy Svelte syntax to the modern Runes-based reactivity system, providing modular examples of reactive patterns, component composition, and DOM interaction.
The heart of Svelte 5's fine-grained reactivity:
$state: Deeply reactive state declarations.$derived: Efficient, cached computations based on state dependencies.$props: Modern component communication using type-safe destructuring.$effect: Managing side effects and synchronizing with the browser DOM.Native-feeling syntax for handling dynamic UI states:
{#await} blocks.{#if}, {:else if}, and {:else}.{#each} and keyed reconciliation.Direct interaction with the browser environment:
bind:value, bind:checked, and reactive style: directives.<svelte:window> to handle window-level events like scroll and resize.Moving beyond the limitations of slots:
{#snippet}.{@render}..svelte.ts modules to share reactive state across the component tree without traditional stores.src/routes/
├── Components/
│ ├── Runes/ # Reactivity ($state, $derived, $props)
│ ├── AsyncBlock/ # Asynchronous UI patterns ({#await})
│ ├── Conditional/ # Logic blocks ({#if}, {#each})
│ ├── DomEvents/ # Interaction and Event systems
│ ├── Bindings/ # Data synchronization (bind:)
│ └── SnippetsDemo/ # Advanced composition
├── Snippets/
│ └── Card.svelte # Reusable layout component using @render
└── +page.svelte # Entry point demonstrating all core concepts
Clone the repository
git clone https://github.com/Hariharan1893/Svelte-UI-Language.git
Install dependencies
npm install
Run the development server
npm run dev
View in browser
Navigate to http://localhost:5173