shadcn-svelte — Component-Aware Svelte UI Assistant
Use the right shadcn-svelte components when building UI in SvelteKit projects. This skill detects your project setup, shows what's available, and gives you access to full component documentation.
Prerequisites
The project must be a SvelteKit app with shadcn-svelte initialized:
# Initialize shadcn-svelte in an existing SvelteKit project
npx shadcn-svelte@latest init
How to use
Step 1: Detect project setup
Run the detection script to verify this is a SvelteKit project with shadcn-svelte and see which components are already installed:
bash "${CLAUDE_SKILL_DIR}/scripts/detect.sh" .
This will:
- Confirm it's a SvelteKit project (checks for
svelte.config.js/ts and @sveltejs/kit in package.json)
- Confirm shadcn-svelte is installed (checks for
components.json, bits-ui, or shadcn-svelte in package.json)
- List all currently installed components in the project's UI directory
- Provide the documentation URL
If the script exits with code 1, the project either isn't SvelteKit or doesn't have shadcn-svelte — do not proceed with shadcn-svelte components in that case.
Step 2: Read the component documentation
The full component documentation for LLMs is available at:
https://www.shadcn-svelte.com/llms.txt
Fetch this URL to get a structured index of all available components organized by category, with links to individual component documentation pages (in .md format).
When you need to use a specific component, read its individual documentation page from the links provided in llms.txt. Each component doc includes:
- Import statements and usage examples
- Available props, events, and slots
- Variants and configuration options
- Accessibility information
Step 3: Use the right component for the job
When building UI, follow this decision process:
- Run detection to confirm shadcn-svelte is available and see installed components
- Fetch llms.txt to see all available components
- Read the specific component docs for the components you plan to use
- Check if the component is installed — if not, add it:
npx shadcn-svelte@latest add <component-name>
- Import and use the component following the documentation patterns
Component categories
shadcn-svelte components are organized into these categories:
| Category |
Components |
| Layout |
Aspect Ratio, Collapsible, Resizable, Scroll Area, Separator, Sidebar |
| Form & Input |
Button, Calendar, Checkbox, Combobox, Date Picker, Input, Input OTP, Label, Radio Group, Range Calendar, Select, Slider, Switch, Textarea, Toggle, Toggle Group |
| Data Display |
Accordion, Avatar, Badge, Card, Carousel, Chart, Table, Data Table |
| Feedback |
Alert, Alert Dialog, Progress, Skeleton, Sonner (Toast) |
| Overlay |
Context Menu, Dialog, Drawer, Dropdown Menu, Hover Card, Menubar, Popover, Sheet, Tooltip |
| Navigation |
Breadcrumb, Command, Pagination, Tabs |
| Typography |
Typography |
Adding new components
# Add a single component
npx shadcn-svelte@latest add button
# Add multiple components
npx shadcn-svelte@latest add button card dialog
# List all available components
npx shadcn-svelte@latest add
Import patterns
Components are typically imported from the project's $lib/components/ui directory:
<script lang="ts">
import { Button } from "$lib/components/ui/button";
import * as Card from "$lib/components/ui/card";
import * as Dialog from "$lib/components/ui/dialog";
</script>
Some components use namespace imports (with * as) when they have multiple sub-components (Card, Dialog, Sheet, Table, etc.), while simpler components use named imports (Button, Input, Badge, etc.).
Important guidelines
- Always run detection first before suggesting shadcn-svelte components
- Always read component docs before using a component — don't guess at props or patterns
- Check installed components and add missing ones before importing
- Use the project's configured path — the components directory may vary based on
components.json configuration
- Follow Svelte 5 patterns — shadcn-svelte uses runes (
$state, $derived, $effect) and snippet-based composition
- Prefer composition — shadcn-svelte components are designed to be composed together, not used as monolithic blocks
1---2name: shadcn-svelte3description: Use shadcn-svelte components in SvelteKit projects. Detects whether the current project is a SvelteKit app with shadcn-svelte installed, lists available components, and provides access to full component documentation via the official llms.txt. Helps choose the right UI components for the job — buttons, forms, dialogs, tables, charts, and more — following shadcn-svelte best practices. Use this skill whenever the user is working in a SvelteKit project and wants to: add UI components, build forms, create dialogs or modals, add a data table, use a date picker, build a sidebar or navigation, add charts, use a combobox or select, create an alert or toast notification, or generally build UI with pre-built accessible components. Also trigger when the user mentions "shadcn", "shadcn-svelte", "bits-ui", or asks about available components in their Svelte project.4---56# shadcn-svelte — Component-Aware Svelte UI Assistant78Use the right shadcn-svelte components when building UI in SvelteKit projects. This skill detects your project setup, shows what's available, and gives you access to full component documentation.910## Prerequisites1112The project must be a SvelteKit app with shadcn-svelte initialized:1314```bash15# Initialize shadcn-svelte in an existing SvelteKit project16npx shadcn-svelte@latest init17```1819## How to use2021### Step 1: Detect project setup2223Run the detection script to verify this is a SvelteKit project with shadcn-svelte and see which components are already installed:2425```bash26bash "${CLAUDE_SKILL_DIR}/scripts/detect.sh" .27```2829This will:30- Confirm it's a SvelteKit project (checks for `svelte.config.js/ts` and `@sveltejs/kit` in package.json)31- Confirm shadcn-svelte is installed (checks for `components.json`, `bits-ui`, or `shadcn-svelte` in package.json)32- List all currently installed components in the project's UI directory33- Provide the documentation URL3435If the script exits with code 1, the project either isn't SvelteKit or doesn't have shadcn-svelte — do not proceed with shadcn-svelte components in that case.3637### Step 2: Read the component documentation3839The full component documentation for LLMs is available at:4041```42https://www.shadcn-svelte.com/llms.txt43```4445Fetch this URL to get a structured index of all available components organized by category, with links to individual component documentation pages (in `.md` format).4647When you need to use a specific component, read its individual documentation page from the links provided in `llms.txt`. Each component doc includes:48- Import statements and usage examples49- Available props, events, and slots50- Variants and configuration options51- Accessibility information5253### Step 3: Use the right component for the job5455When building UI, follow this decision process:56571. **Run detection** to confirm shadcn-svelte is available and see installed components582. **Fetch llms.txt** to see all available components593. **Read the specific component docs** for the components you plan to use604. **Check if the component is installed** — if not, add it:61 ```bash62 npx shadcn-svelte@latest add <component-name>63 ```645. **Import and use the component** following the documentation patterns6566### Component categories6768shadcn-svelte components are organized into these categories:6970| Category | Components |71|----------|-----------|72| **Layout** | Aspect Ratio, Collapsible, Resizable, Scroll Area, Separator, Sidebar |73| **Form & Input** | Button, Calendar, Checkbox, Combobox, Date Picker, Input, Input OTP, Label, Radio Group, Range Calendar, Select, Slider, Switch, Textarea, Toggle, Toggle Group |74| **Data Display** | Accordion, Avatar, Badge, Card, Carousel, Chart, Table, Data Table |75| **Feedback** | Alert, Alert Dialog, Progress, Skeleton, Sonner (Toast) |76| **Overlay** | Context Menu, Dialog, Drawer, Dropdown Menu, Hover Card, Menubar, Popover, Sheet, Tooltip |77| **Navigation** | Breadcrumb, Command, Pagination, Tabs |78| **Typography** | Typography |7980### Adding new components8182```bash83# Add a single component84npx shadcn-svelte@latest add button8586# Add multiple components87npx shadcn-svelte@latest add button card dialog8889# List all available components90npx shadcn-svelte@latest add91```9293### Import patterns9495Components are typically imported from the project's `$lib/components/ui` directory:9697```svelte98<script lang="ts">99 import { Button } from "$lib/components/ui/button";100 import * as Card from "$lib/components/ui/card";101 import * as Dialog from "$lib/components/ui/dialog";102</script>103```104105Some components use namespace imports (with `* as`) when they have multiple sub-components (Card, Dialog, Sheet, Table, etc.), while simpler components use named imports (Button, Input, Badge, etc.).106107## Important guidelines108109- **Always run detection first** before suggesting shadcn-svelte components110- **Always read component docs** before using a component — don't guess at props or patterns111- **Check installed components** and add missing ones before importing112- **Use the project's configured path** — the components directory may vary based on `components.json` configuration113- **Follow Svelte 5 patterns** — shadcn-svelte uses runes (`$state`, `$derived`, `$effect`) and snippet-based composition114- **Prefer composition** — shadcn-svelte components are designed to be composed together, not used as monolithic blocks