Documentation Page
A three-column documentation layout with nav, article and ToC.
Installation
$ npx veil-ui@latest add documentation-pageUsage
import { DocumentationPage } from "@/components/ui/documentation-page";
<DocumentationPage />;Examples
Basic
Installation
Veil UI is a copy-paste registry. Components are added to your project as source files, so you can change anything without waiting for an upstream release.
Add components
Run the CLI from your project root. It detects your components directory and writes files with the correct imports.
pnpm dlx veil-ui add button card dialog
# or with npm
npx veil-ui add button card dialogUse a component
Import from your local UI folder. There is no runtime package to install.
import { Button } from "@/components/ui/button";
export function Example() {
return (
<Button variant="outline" size="sm">
Save changes
</Button>
);
}Configuration
The generated components.json file tells the CLI where to place components, utilities and hooks.
API reference
The package exports documentation-page along with its composable parts. It forwards standard attributes to its root element; see the examples above for the component-specific props.
Accessibility
- Page templates use semantic landmarks and a single page-level heading.
- Navigation links and actions have discernible names and visible focus styles.
- Decorative imagery uses empty alt text; content images carry descriptions.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add documentation-page --framework vue or switch the framework in components.json.
<template>
<div data-slot="documentation-page" class="w-full overflow-hidden rounded-xl border bg-background min-h-[600px]"><header data-slot="navbar" class="mx-auto flex h-14 w-full max-w-7xl items-center gap-4 bg-background/95 px-4 backdrop-blur sm:px-6 border-b"><div data-slot="logo" class="inline-flex items-center gap-1.5"><span data-slot="logo-mark" class="flex shrink-0 items-center justify-center overflow-hidden rounded-md size-6"><span class="grid size-full place-items-center bg-primary text-[10px] font-bold text-primary-foreground">V</span></span><span data-slot="logo-name" class="font-semibold tracking-tight text-sm">Veil UI</span></div><span data-slot="badge" data-variant="muted" class="inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [&>svg]:pointer-events-none [&>svg]:size-3 border-transparent bg-muted text-muted-foreground ml-2">v2.0</span><div class="ml-auto flex items-center gap-2"><div class="hidden items-center gap-2 sm:flex"><input type="search" data-slot="input" class="min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none transition-[color,box-shadow,border-color] placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30 h-8 w-56" placeholder="Search documentation…" aria-label="Search documentation"/><kbd data-slot="kbd" class="pointer-events-none inline-flex h-5 min-w-5 select-none items-center justify-center gap-0.5 rounded border bg-muted px-1 font-mono text-[10px] font-medium text-muted-foreground">⌘K</kbd></div><button data-slot="button" data-variant="ghost" data-size="sm" class="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap font-medium outline-none transition-[color,background-color,border-color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 hover:bg-accent hover:text-accent-foreground h-8 rounded-md px-3 text-xs">GitHub</button></div></header><div class="mx-auto grid w-full max-w-7xl gap-8 px-6 py-8 lg:grid-cols-[220px_1fr_200px]"><nav aria-label="Documentation" class="hidden lg:block"><div data-slot="sidebar-group" class="grid gap-1 py-2"><div data-slot="sidebar-group-label" class="px-2 py-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground">Getting started</div><a data-slot="sidebar-item" class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" href="#introduction"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-open" aria-hidden="true"><path d="M12 5v16"></path><path d="M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z"></path></svg> Introduction</a><a data-slot="sidebar-item" aria-current="page" class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring bg-accent font-medium text-accent-foreground" href="#installation"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-terminal" aria-hidden="true"><path d="M12 19h8"></path><path d="m4 17 6-6-6-6"></path></svg> Installation</a><a data-slot="sidebar-item" class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" href="#configuration"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings" aria-hidden="true"><path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"></path><circle cx="12" cy="12" r="3"></circle></svg> Configuration</a></div><div data-slot="sidebar-group" class="grid gap-1 py-2"><div data-slot="sidebar-group-label" class="px-2 py-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground">Components</div><a data-slot="sidebar-item" class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" href="#button">Button <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right ml-auto size-3.5" aria-hidden="true"><path d="m9 18 6-6-6-6"></path></svg></a><a data-slot="sidebar-item" class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" href="#card">Card</a><a data-slot="sidebar-item" class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" href="#dialog">Dialog</a><a data-slot="sidebar-item" class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" href="#data-table">Data table</a></div><div data-slot="sidebar-group" class="grid gap-1 py-2"><div data-slot="sidebar-group-label" class="px-2 py-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground">Guides</div><a data-slot="sidebar-item" class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" href="#theming"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-text" aria-hidden="true"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"></path><path d="M14 2v5a1 1 0 0 0 1 1h5"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg> Theming</a><a data-slot="sidebar-item" class="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" href="#accessibility">Accessibility</a></div></nav><article class="min-w-0"><nav data-slot="breadcrumb" aria-label="breadcrumb" class="w-full"><ol data-slot="breadcrumb-list" class="flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2"><li data-slot="breadcrumb-item" class="inline-flex items-center gap-1.5"><a data-slot="breadcrumb-link" class="rounded-sm outline-none transition-colors hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50" href="#">Docs</a></li><li data-slot="breadcrumb-separator" role="presentation" aria-hidden="true" class="[&>svg]:size-3.5"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right" aria-hidden="true"><path d="m9 18 6-6-6-6"></path></svg></li><li data-slot="breadcrumb-item" class="inline-flex items-center gap-1.5"><a data-slot="breadcrumb-link" class="rounded-sm outline-none transition-colors hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50" href="#">Getting started</a></li><li data-slot="breadcrumb-separator" role="presentation" aria-hidden="true" class="[&>svg]:size-3.5"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right" aria-hidden="true"><path d="m9 18 6-6-6-6"></path></svg></li><li data-slot="breadcrumb-item" class="inline-flex items-center gap-1.5"><span data-slot="breadcrumb-page" role="link" aria-disabled="true" aria-current="page" class="font-normal text-foreground">Installation</span></li></ol></nav><h1 id="introduction" class="mt-4 text-3xl font-semibold tracking-tight">Installation</h1><p class="mt-3 text-muted-foreground">Veil UI is a copy-paste registry. Components are added to your project as source files, so you can change anything without waiting for an upstream release.</p><div data-slot="alert" data-variant="default" role="alert" class="relative flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-sm [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:translate-y-0.5 bg-card text-card-foreground [&>svg]:text-muted-foreground mt-5"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-info" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg><div data-slot="alert-title" class="font-medium tracking-tight">Requirements</div><div data-slot="alert-description" class="text-sm text-muted-foreground [&_p]:leading-relaxed">React 19, Tailwind CSS v4 and a package manager. The CLI works with pnpm, npm, yarn and bun.</div></div><h2 id="installation" class="mt-8 text-xl font-semibold tracking-tight">Add components</h2><p class="mt-2 text-sm text-muted-foreground">Run the CLI from your project root. It detects your components directory and writes files with the correct imports.</p><figure data-slot="code-block" class="overflow-hidden rounded-lg border bg-muted/40 mt-4"><figcaption class="flex items-center justify-between gap-3 border-b px-3 py-1.5"><span class="truncate font-mono text-xs text-muted-foreground">Terminal</span><button type="button" aria-label="Copy code" class="rounded-sm p-1 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy size-3.5" aria-hidden="true"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg></button></figcaption><pre class="overflow-x-auto p-4 text-sm leading-relaxed"><code class="font-mono">pnpm dlx veil-ui add button card dialog
# or with npm
npx veil-ui add button card dialog</code></pre></figure><h2 id="usage" class="mt-8 text-xl font-semibold tracking-tight">Use a component</h2><p class="mt-2 text-sm text-muted-foreground">Import from your local UI folder. There is no runtime package to install.</p><figure data-slot="code-block" class="overflow-hidden rounded-lg border bg-muted/40 mt-4"><figcaption class="flex items-center justify-between gap-3 border-b px-3 py-1.5"><span class="truncate font-mono text-xs text-muted-foreground">app/page.tsx</span><button type="button" aria-label="Copy code" class="rounded-sm p-1 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy size-3.5" aria-hidden="true"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg></button></figcaption><pre class="overflow-x-auto p-4 text-sm leading-relaxed"><code class="font-mono">import { Button } from "@/components/ui/button";
export function Example() {
return (
<Button variant="outline" size="sm">
Save changes
</Button>
);
}</code></pre></figure><h2 id="configuration" class="mt-8 text-xl font-semibold tracking-tight">Configuration</h2><p class="mt-2 text-sm text-muted-foreground">The generated <code class="rounded bg-muted px-1 py-0.5 text-xs">components.json</code> file tells the CLI where to place components, utilities and hooks.</p><div data-slot="alert" data-variant="destructive" role="alert" class="relative flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-sm [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:translate-y-0.5 border-destructive/35 bg-destructive/5 text-destructive [&>svg]:text-destructive mt-4"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-triangle-alert lucide-alert-triangle" aria-hidden="true"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"></path><path d="M12 9v4"></path><path d="M12 17h.01"></path></svg><div data-slot="alert-title" class="font-medium tracking-tight">Do not edit generated files by hand</div><div data-slot="alert-description" class="text-sm text-muted-foreground [&_p]:leading-relaxed">Changes will be overwritten the next time you add a component. Extend components in your own wrapper instead.</div></div><div class="mt-8 flex items-center justify-between border-t pt-5 text-sm"><button data-slot="button" data-variant="ghost" data-size="sm" class="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap font-medium outline-none transition-[color,background-color,border-color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 hover:bg-accent hover:text-accent-foreground h-8 rounded-md px-3 text-xs">← Introduction</button><button data-slot="button" data-variant="ghost" data-size="sm" class="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap font-medium outline-none transition-[color,background-color,border-color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 hover:bg-accent hover:text-accent-foreground h-8 rounded-md px-3 text-xs">Configuration <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-right" aria-hidden="true"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg></button></div></article><aside class="hidden lg:block"><nav data-slot="table-of-contents" aria-label="On this page" class="text-sm"><p class="mb-2 text-xs font-medium uppercase tracking-wider text-muted-foreground">On this page</p><ul class="grid gap-0.5 border-l"><li><a href="#introduction" class="-ml-px block border-l-2 border-transparent py-0.5 pl-3 text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground">Installation</a></li><li><a href="#installation" class="-ml-px block border-l-2 border-transparent py-0.5 pl-3 text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground">Add components</a></li><li><a href="#usage" class="-ml-px block border-l-2 border-transparent py-0.5 pl-3 text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground">Use a component</a></li><li><a href="#configuration" class="-ml-px block border-l-2 border-transparent py-0.5 pl-3 text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground">Configuration</a></li></ul></nav></aside></div></div>
</template>