A starter template for SvelteKit projects using Svelte 5, SCSS, and D3.
$state, $derived, $effect, $props)# Install dependencies
npm install
# Start dev server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build |
npm run lint |
Check code with ESLint and Prettier |
npm run format |
Auto-fix formatting issues |
src/
├── lib/
│ ├── actions/ # Svelte actions (tooltip, inView, etc.)
│ ├── assets/ # Images and static assets
│ ├── components/ # Reusable components
│ ├── stores/ # Svelte stores
│ ├── styles/ # Global CSS/SCSS
│ └── utils/ # Utility functions
└── routes/ # SvelteKit routes
<script>
// Props
let { name = 'World', children } = $props();
// State
let count = $state(0);
// Derived
let doubled = $derived(count * 2);
// Effects
$effect(() => {
console.log('count is now', count);
});
</script>
<button onclick={() => count++}>
Clicked {count} times
</button>
{@render children?.()}
This template uses @sveltejs/adapter-auto. For specific platforms, install the appropriate adapter:
@sveltejs/adapter-vercel@sveltejs/adapter-netlify@sveltejs/adapter-node@sveltejs/adapter-staticSee SvelteKit adapters documentation for more options.