with one click
create-example
// Scaffold an example file (Astro or framework-specific) for a Skeleton documentation page, including the MDX import wiring and Preview/Framework blocks.
// Scaffold an example file (Astro or framework-specific) for a Skeleton documentation page, including the MDX import wiring and Preview/Framework blocks.
Create framework components across all supported packages using the repository's anatomy/modules conventions.
Create or update Skeleton React and Svelte playground component pages for a given component, including route generation steps.
Scaffold a new Tailwind utility (CSS-only utility class) in the Skeleton core package, following @utility conventions used by buttons, badges, cards, etc.
Scaffold a new documentation page for the Skeleton documentation site (sites/skeleton.dev), including frontmatter, optional boilerplate, examples, and API reference.
| name | create-example |
| description | Scaffold an example file (Astro or framework-specific) for a Skeleton documentation page, including the MDX import wiring and Preview/Framework blocks. |
Scaffold a new example for a Skeleton doc page under sites/skeleton.dev/src/components/examples/, and add the import + render wiring to the parent .mdx.
Folder layout mirrors the docs tree: examples/<category>/<slug>/.
| Type | Path | When to use |
|---|---|---|
| Astro (neutral) | <slug>/<name>.astro | HTML/CSS-only demo; no state, events, or framework imports needed |
| React | <slug>/react/<name>.tsx | Demo needs React state/events or imports from @skeletonlabs/skeleton-react |
| Svelte | <slug>/svelte/<name>.svelte | Demo needs Svelte runes/snippets or imports from @skeletonlabs/skeleton-svelte |
A single doc page can mix types per example. Defaults:
.astro, fall back to framework-specific only when the demo requires state/events (see buttons/ — default.astro + react/group.tsx + svelte/group.svelte).react/ and svelte/, always paired (see accordion/).default (lowercase). Subsequent examples use descriptive kebab-case (e.g. sizes, controlled, indicator).---\n...imports...\n---) even when empty.default-exports a function component; import icons from lucide-react.<script lang="ts">; import icons from @lucide/svelte/icons/<name>.Reference files:
In the parent .mdx, import both the component and its raw source:
import Default from '@/components/examples/<category>/<slug>/default.astro';
import DefaultRaw from '@/components/examples/<category>/<slug>/default.astro?raw';
For framework-specific examples, append framework suffix to the import name:
import DefaultReact from '@/components/examples/<category>/<slug>/react/default';
import DefaultReactRaw from '@/components/examples/<category>/<slug>/react/default?raw';
import DefaultSvelte from '@/components/examples/<category>/<slug>/svelte/default.svelte';
import DefaultSvelteRaw from '@/components/examples/<category>/<slug>/svelte/default.svelte?raw';
<Preview> blockWraps the rendered example in a card with a code-toggle and (when framework is set) a Stackblitz button.
<Preview files={{ 'app.astro': DefaultRaw }} client:visible>
<Default />
</Preview>
files — { '<filename>': RawSource }. Multiple keys render tabs; first key shows by default. Filename extension drives syntax highlighting.framework="react" | "svelte" — required for framework examples; enables Stackblitz.client:visible — always set on <Preview> and (for React/Svelte) on the rendered child.<Framework> blockOnly renders its children when the active framework switcher matches id. Use it to show parallel React/Svelte versions of the same example.
<Framework id="react">
<Preview framework="react" files={{ 'app.tsx': DefaultReactRaw }} client:visible>
<DefaultReact client:visible />
</Preview>
</Framework>
<Framework id="svelte">
<Preview framework="svelte" files={{ 'app.svelte': DefaultSvelteRaw }} client:visible>
<DefaultSvelte client:visible />
</Preview>
</Framework>
Astro examples do not need a <Framework> wrapper — they render universally.
default example is rendered at the top of the page with no heading.## SectionName heading (PascalCase or Title Case), with the <Preview> (or <Framework> pair) directly underneath.Ask only what can't be inferred:
.mdx file the example will be added to.When invoked from /create-doc with a list of examples and an inferred type per example, skip prompting and scaffold directly.
For each example, produce:
.mdx.<Preview> (and <Framework> if applicable) block in the appropriate location — top of page for default, under a new ## SectionName heading otherwise.Summarize: files created, import lines added, section headings inserted.