đĨ Svelte Component Demo
This page demonstrates how to use Svelte components in Astro with client-side hydration.
âšī¸ About Svelte in Astro
- Compiled components: Svelte components are compiled to vanilla JavaScript
- Small bundle size: No runtime framework overhead
- Scoped styles: CSS is automatically scoped to components
- Reactive by default: Built-in reactivity without additional libraries
- Server-side rendering: Components render to HTML at build time
âī¸ Svelte vs React
Svelte
- Compile-time optimizations
- No virtual DOM
- Smaller bundle sizes
- Built-in state management
React
- Large ecosystem
- Virtual DOM
- More job opportunities
- Extensive tooling