sveltekit-starter Svelte Themes

Sveltekit Starter

An opinionated SvelteKit starter template with Svelte 5 runes, Tailwind CSS 4, shadcn-svelte, HugeIcons, dark mode, and Biome.

sveltekit-starter

A minimal, opinionated SvelteKit starter template — batteries included, ready to delete and replace with your own app.

Tech Stack

Layer Choice
Framework SvelteKit 2 + Svelte 5 (runes mode)
Language TypeScript (strict)
Styling Tailwind CSS 4
UI Components shadcn-svelte (style: maia, icons: HugeIcons)
Toasts svelte-sonner
Dark mode mode-watcher
Linter/Formatter Biome
Package manager pnpm

Prerequisites

Setup

  1. Install dependencies

    pnpm install
    
  2. Start the development server

    pnpm dev
    

    Open http://localhost:5173 in your browser.

  3. Replace the demo page

    Edit src/routes/+page.svelte — the demo content is just a placeholder to verify the stack works.

Project Structure

src/
├── lib/
│   ├── components/
│   │   ├── ui/         # shadcn-svelte auto-generated components (do not edit manually)
│   │   └── demo/       # starter demo components (safe to delete)
│   ├── hooks/          # custom Svelte hooks
│   └── utils.ts        # cn() and shared utility types
└── routes/
    ├── +layout.svelte  # app shell (Toaster, ModeWatcher, favicon)
    ├── +page.svelte    # demo home page — replace with your own
    └── layout.css      # Tailwind + shadcn CSS variables

Adding shadcn-svelte Components

Components are installed directly into the project via CLI — never written by hand:

pnpm dlx shadcn-svelte@latest add <component>

After adding, format the generated files:

pnpm biome format --write src/lib/components/ui/

Full component reference: shadcn-svelte.com

Available Scripts

Command Description
pnpm dev Start local dev server
pnpm build Build for production
pnpm preview Preview the production build
pnpm check Run svelte-check type checking
pnpm check:watch Run svelte-check in watch mode

Coding Conventions

  • Svelte 5 runes only ($state, $derived, $props) — no legacy Svelte 4 syntax
  • Single quotes, no semicolons, 2-space indent, 100-char line width (Biome)
  • Use cn() from $lib/utils for conditional classes — never the class: directive
  • Import directly from source files — no barrel index.ts re-exports (except $lib/components/ui/, which is auto-generated)
  • App-specific components go in $lib/components/<feature>/, not in $lib/components/ui/

Top categories

Loading Svelte Themes