Loading...
Loading...
Manages shadcn-svelte components and projects — adding, updating, fixing, debugging, styling, and composing UI. Provides project context, component docs, and usage examples. Applies when working with shadcn-svelte, the CLI, design-system presets, or any project with a components.json file. Also triggers for "shadcn-svelte init", "add component", or registry URLs.
npx skill4agent add huntabyte/shadcn-svelte shadcn-svelteIMPORTANT: Run all CLI commands using the project's package runner:,npx shadcn-svelte@latest, orpnpm dlx shadcn-svelte@latest— based on the project's package manager. Examples below usebunx --bun shadcn-svelte@latestbut substitute the correct runner for the project.npx shadcn-svelte@latest
components.jsonaliases.uiindex.tsimport * as Dialog from "$lib/components/ui/dialog"Dialog.ContentDialog.TitleCard.RootCard.HeaderRoot as …import { Button } from "$lib/components/ui/button"<Button>import * as ButtonButton.Root{ Input }{ Badge }{ Spinner }{ Checkbox }{ Separator }{ Skeleton }import * as Dialog from "$lib/components/ui/dialog";
import { Button } from "$lib/components/ui/button";
import { Separator } from "$lib/components/ui/separator";components.json$lib/components/ui/...npx shadcn-svelte@latest addvariant="outline"size="sm"bg-primarytext-muted-foregroundbg-blue-500classspace-x-*space-y-*flexgap-*flex flex-col gap-*size-*size-10w-10 h-10truncateoverflow-hidden text-ellipsis whitespace-nowrapdark:bg-backgroundtext-muted-foregroundcn()z-indexField.FieldGroupField.Fielddivspace-y-*grid gap-*InputGroupInputGroup.InputInputGroup.TextareaInputTextareaInputGroup.RootInputGroup.RootInputGroup.AddonToggleGroupButtonField.FieldSetField.FieldLegenddivdata-invalidaria-invaliddata-invalidFieldaria-invaliddata-disabledFielddisabledSelect.ItemSelect.GroupDropdownMenu.ItemDropdownMenu.GroupCommand.ItemCommand.GroupDialog.TriggerAlertDialog.Triggerbind:openDialog.TitleSheet.TitleDrawer.Titleclass="sr-only"Card.HeaderCard.TitleCard.DescriptionCard.ContentCard.FooterCard.ContentisPendingisLoadingSpinnerButtondisableddata-icon="inline-start"inline-endSpinnerimport { Button }import { Spinner }Tabs.TriggerTabs.ListTabsAvatarAvatar.FallbackdivAlertEmptysvelte-sonnertoast()svelte-sonnerSeparator<hr>divSkeletonanimate-pulseBadge<Button>data-icondata-icon="inline-start"data-icon="inline-end"size-4w-4 h-4iconLibrary@lucide/sveltenpx shadcn-svelte@latest init --preset <code><script lang="ts">
import * as Field from "$lib/components/ui/field";
import { Input } from "$lib/components/ui/input";
import { Button } from "$lib/components/ui/button";
import SearchIcon from "@lucide/svelte/icons/search";
import { Badge } from "$lib/components/ui/badge";
import * as Avatar from "$lib/components/ui/avatar";
</script>
<!-- Form layout: Field.FieldGroup + Field.Field, not div + Label. -->
<Field.FieldGroup>
<Field.Field>
<Field.FieldLabel for="email">Email</Field.FieldLabel>
<Input id="email" />
</Field.Field>
</Field.FieldGroup>
<!-- Validation: data-invalid on Field, aria-invalid on the control. -->
<Field.Field data-invalid>
<Field.FieldLabel for="email">Email</Field.FieldLabel>
<Input id="email" aria-invalid />
<Field.FieldDescription>Invalid email.</Field.FieldDescription>
</Field.Field>
<!-- Icons in buttons: data-icon, no sizing classes. -->
<Button>
<SearchIcon data-icon="inline-start" />
Search
</Button>
<!-- Spacing: gap-*, not space-y-*. -->
<div class="flex flex-col gap-4"></div>
<!-- Equal dimensions: size-*, not w-* h-*. -->
<Avatar.Root class="size-10">
<Avatar.Image src="/u.png" alt="User" />
<Avatar.Fallback>U</Avatar.Fallback>
</Avatar.Root>
<!-- Status colors: Badge variants or semantic tokens, not raw colors. -->
<Badge variant="secondary">+20.1%</Badge>| Need | Use |
|---|---|
| Button/action | |
| Form inputs | |
| Toggle between 2–5 options | |
| Data display | |
| Navigation | |
| Overlays | |
| Feedback | |
| Command palette | |
| Charts | |
| Layout | |
| Empty states | |
| Menus | |
| Tooltips/info | |
components.jsoninfoaliases$lib/tailwind.cssstylenovavegaiconLibrary@lucide/svelte@tabler/icons-svelte@lucide/svelteregistryshadcn-svelte.comresolvedPathsaliasesaliases.uihttps://shadcn-svelte.com/docs/components/<name>.mdcomponents.jsonadduinpx shadcn-svelte@latest addnpx shadcn-svelte@latest add <name>npx shadcn-svelte@latest updatealiasesuilibcomponents.jsoniconLibraryaddupdategit diffupdatenpx shadcn-svelte@latest update [component]--all--overwriteadd# Initialize shadcn-svelte in your project.
npx shadcn-svelte@latest init
# Initialize with a preset string from the docs site builder.
npx shadcn-svelte@latest init --preset <code>
# Add components (interactive when run with no names).
npx shadcn-svelte@latest add
npx shadcn-svelte@latest add button card dialog
npx shadcn-svelte@latest add --all
# Update components already installed.
npx shadcn-svelte@latest update button
npx shadcn-svelte@latest update --all --yes
# Build a custom registry (registry authors).
npx shadcn-svelte@latest registry buildhttps://shadcn-svelte.com/registrycomponents.json