Logo: Svelte Shadcn

Svelte Shadcn

Communautéit
jpoehnelt
svelte-shadcn

Add, write, customize, or review shadcn-svelte components built on Svelte 5, Bits UI, tailwind-variants, and Tailwind v4 tokens. Use when adding a primitive with the shadcn-svelte CLI, changing a variant, adding a theme token, wrapping a Bits UI part, publishing primitives from a component package, or re-syncing a generated component.

Iwwersiicht

Editeurjpoehnelt
Repositoryskills
Skill-Nummsvelte-shadcn
Stären
23
Forks
1
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    jpoehnelt huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Svelte Shadcn an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/jpoehnelt/skills/tree/main/svelte-shadcn
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jpoehnelt/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/svelte-shadcn .claude/skills/svelte-shadcn
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Svelte Shadcn an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Svelte Shadcn automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Svelte Shadcn net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

shadcn-svelte components

shadcn-svelte copies component source into the repo: Svelte 5 runes, Bits UI for behavior and accessibility, tailwind-variants for variants, and cn() (clsx plus tailwind-merge) for classes. The copied files are the repo's code, not a dependency. This skill covers how to write them; svelte-ui-delivery covers the change workflow, stories, and rendered evidence.

Repo facts (from AGENTS.md or the app's AGENTS.md): where generated and shared primitives live and the components.json aliases, the token file and how tokens are stored and mapped to utilities, the dark-mode selector, radius rules, which tokens are public API, the token or theme lint command, how a shared package exports primitives, and the check, test, and Storybook commands. Where these differ from the shadcn-svelte defaults below, the repo facts win.

Add a primitive

  1. Check whether it exists, in the app's generated folder and in any shared package. Extend the existing one rather than adding a second.
  2. Run pnpm dlx shadcn-svelte@latest add <name> from the directory that holds components.json. Read every generated file before using it.
  3. Adapt it to the repo: replace raw colors with tokens and apply the repo's radius and focus-ring rules. Place it by ownership: a generic primitive goes in the shared package if the repo has one; one that only makes sense in this app stays in the app's generated folder.
  4. Record local edits in the file or the PR so a later re-sync can reapply them.

Write and customize

  • Svelte 5 only: $props(), $bindable, $derived, snippets with {@render children?.()}. No export let, <slot>, or on: directives.
  • Accept class and merge it last with cn(variants(...), className), so callers can override and tailwind-merge drops the conflicting class.
  • Type props as the native element's attributes (HTMLButtonAttributes) wrapped in WithElementRef, expose ref = $bindable(null), and spread ...restProps onto the root so callers can pass aria-*, data-*, and handlers.
  • Variants live in one tv({ base, variants, compoundVariants, defaultVariants }) exported beside the component, with VariantProps<typeof x> for the prop types. Add a variant there; never restyle a variant with a class string at each call site.
  • Mark parts with data-slot="<part>" so parents and tests can target them without class names.

Tokens and Tailwind v4

  • Components read semantic token utilities only (bg-primary, text-muted-foreground, border-border, ring-ring) and the repo's radius scale. No palette classes (bg-blue-500) and no hex, rgb(), or oklch() literals in components.
  • The shadcn-svelte default defines tokens as CSS variables for light on :root and dark on .dark, maps them in @theme inline (--color-primary: var(--primary)), sets dark mode with @custom-variant dark (&:is(.dark *)), and derives radii from --radius. Repos vary: tokens may be raw channels mapped with rgb(var(--x)) in a plain @theme, live in a separate theme package, use another dark selector, or fix the radius. Follow the repo's wiring and convert generated code to it.
  • A new token gets a light value, a dark value, and a utility mapping in the repo's format, in the same change. A component that needs dark: with a raw color needs a token instead.
  • Keep the repo's token names (shadcn names unless the repo says otherwise). In a published package the token names are public API: adding one is a minor change, renaming or removing one is breaking.

Bits UI

  • Wrap Bits UI parts (Dialog.Content, Select.Trigger) rather than rebuilding focus traps, roving focus, or typeahead. Keep their roles, labels, and keyboard handling.
  • Type a wrapper as WithoutChildrenOrChild<Primitive.ContentProps> plus the props it adds, pass bind:ref, and spread the rest onto the primitive.
  • Use the primitive's child snippet only when the rendered element must change; it replaces the element, so the snippet must spread the props it receives.
  • A family exports its parts from one index.ts (Root, Trigger, Content, plus prefixed aliases such as DialogContent), so callers write <Dialog.Root>.
  • Every form control has a visible label or aria-label. Errors set aria-invalid and aria-describedby on the control.

Publishing primitives from a package

  • One subpath export per family (<pkg>/button) pointing at its index.ts or the built dist file, with svelte and types conditions. No root barrel, so consumers load only what they import.
  • The package, or a theme package beside it, ships the token CSS. Consumers import it once and theme by overriding token values in :root and .dark. They keep the token names and never restyle a component's classes.

Re-sync a generated component

  1. Note the local edits: git log -p -- <component dir>.
  2. Run pnpm dlx shadcn-svelte@latest add <name> --overwrite, then reapply the edits from the diff, starting with tokens, radius, and variants.
  3. Review the full diff before committing. An upstream change to a variant or token name is a breaking change for consumers.

Review checklist

  • No palette classes or color literals; every new token has light, dark, and utility-mapping entries in the repo's format.
  • Props accept class, ref, and the rest, and class merges last through cn.
  • Variants changed in tv(), not at call sites.
  • Bits UI behavior and accessibility left intact; controls are labeled.
  • A generic primitive lives in the shared package with its own subpath export; an app-specific one stays in the app.
  • The repo's check, token lint, and stories pass; svelte-ui-delivery covers the rendered evidence.

Heefeg gestallte Froen

Wat mécht de KI-Skill Svelte Shadcn?

Add, write, customize, or review shadcn-svelte components built on Svelte 5, Bits UI, tailwind-variants, and Tailwind v4 tokens. Use when adding a primitive with the shadcn-svelte CLI, changing a variant, adding a theme token, wrapping a Bits UI part, publishing primitives from a component package, or re-syncing a generated component.

Firwat Svelte Shadcn op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Svelte Shadcn besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Svelte Shadcn an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/jpoehnelt/skills/tree/main/svelte-shadcn an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Svelte Shadcn benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Svelte Shadcn benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Svelte Shadcn domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Svelte Shadcn gratis?

Jo. jpoehnelt huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇