Loading...
Loading...
Expert guidance for shadcn-svelte, a Svelte 5 port of shadcn/ui. Use this skill when working with shadcn-svelte components, installing UI components via CLI, implementing forms with Superforms/Formsnap, adding dark mode with mode-watcher, creating data tables with TanStack Table, theming with Tailwind CSS v4 and OKLCH colors, or building custom component registries. Triggers on mentions of shadcn-svelte, Bits UI components, or SvelteKit UI component libraries.
npx skill4agent add antstanley/shadcn-svelte-skill shadcn-svelte# SvelteKit
pnpm dlx shadcn-svelte@latest init
# Add components
pnpm dlx shadcn-svelte@latest add button card dialog<script lang="ts">
import * as Card from "$lib/components/ui/card/index.js";
import { Button } from "$lib/components/ui/button/index.js";
</script>
<Card.Root>
<Card.Header>
<Card.Title>Title</Card.Title>
<Card.Description>Description</Card.Description>
</Card.Header>
<Card.Content>Content here</Card.Content>
<Card.Footer>
<Button>Action</Button>
</Card.Footer>
</Card.Root><!-- Compound components (most components) -->
import * as Dialog from "$lib/components/ui/dialog/index.js";
<!-- Single components -->
import { Button } from "$lib/components/ui/button/index.js";
import { Input } from "$lib/components/ui/input/index.js";<script lang="ts">
import * as Form from "$lib/components/ui/form/index.js";
import { superForm } from "sveltekit-superforms";
let { data } = $props();
const form = superForm(data.form);
</script>
<form method="POST" use:form.enhance>
<Form.Field {form} name="email">
<Form.Control>
{#snippet children({ props })}
<Input {...props} type="email" />
{/snippet}
</Form.Control>
<Form.FieldErrors />
</Form.Field>
</form><!-- +layout.svelte -->
<script lang="ts">
import { ModeWatcher } from "mode-watcher";
</script>
<ModeWatcher />
{@render children()}toggleMode()setMode("dark")resetMode()references/about.mdcli.mdcomponents-json.mdtheming.mdinstallation/sveltekit.mdinstallation/astro.mdinstallation/vite.mdcomponents/[name].mddark-mode/svelte.mddark-mode/astro.mdmigration/svelte-5.mdmigration/tailwind-v4.mdregistry/getting-started.mdreferences/components/[component-name].mdreferences/components/button.mdreferences/components/dialog.mdreferences/components/data-table.md| Task | Reference |
|---|---|
| Add a component | |
| Form validation | |
| Data tables | |
| Theming/colors | |
| Dark mode | |
| Custom registry | |