Skip to content
svelte-zukan
Esc
↑↓navigate↵open⌘Jpreview
On this page

Quickstart

svelte-zukan works with plain Vite + Svelte and with SvelteKit 3 or later. It needs Vite 8 or later, Svelte 5.57.1 or later, and Node 22.17 or later. It uses Vite-specific hooks (configureServer, hotUpdate, buildApp), so it does not work with other bundlers.

Working with an AI coding agent? Install the agent skills with npx skills add oekazuma/svelte-zukan and ask it to set up svelte-zukan. It follows the steps on this page, picks the options your project needs, and writes the catalog files and docs for you.

Install

npm install -D svelte-zukan
pnpm add -D svelte-zukan
yarn add -D svelte-zukan

Add the plugin

Place zukan() before sveltekit() or svelte().

// vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { zukan } from 'svelte-zukan/vite';

export default defineConfig({ plugins: [zukan(), sveltekit()] });
// vite.config.ts
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { defineConfig } from 'vite';
import { zukan } from 'svelte-zukan/vite';

export default defineConfig({ plugins: [zukan(), svelte()] });

Write a catalog file

Put <Name>.zukan.svelte next to the component, and wrap each example in <Section>.

<!-- src/lib/Button/Button.zukan.svelte -->
<script lang="ts">
  import { Section } from 'svelte-zukan';
  import Button from './Button.svelte';
</script>

<Section title="Basic">
  <Button>Click me</Button>
</Section>

<Section title="Disabled">
  <Button disabled>Disabled</Button>
</Section>

Open the catalog

Start the dev server and open /__zukan/. The catalog URL is also listed in the URLs printed to the terminal at startup.

If you set Vite’s base or SvelteKit’s paths.base, the catalog moves under it: /app/__zukan/ for base: '/app/' or paths.base: '/app'.

The top page lists every component with a small preview. Each detail page shows the sections with a toolbar for widths, backgrounds, measuring and accessibility checks, the code of each section, and the component’s props. Using the catalog walks through all of it, with the keyboard shortcuts.

Next steps