with one click
fumadocs-component-docs
// Create component documentation with installation, usage examples, and preview sections. Apply when documenting 8-bit components with proper structure and examples.
// Create component documentation with installation, usage examples, and preview sections. Apply when documenting 8-bit components with proper structure and examples.
Create pixelated borders, shadows, and effects for 8-bit retro components. Apply when building 8-bit styled UI components that need authentic pixel art aesthetics.
Create documentation with gaming-specific examples, retro styling, and 8-bit terminology. Apply when documenting gaming blocks, RPG components, or retro-styled UI elements.
Optimize 8-bit animations for smooth performance. Apply when creating animated pixel art, game UI effects, or any retro-styled animations.
Import directly from source files instead of barrel files. Apply when using libraries like lucide-react, @mui/material, or @radix-ui/react-* to reduce bundle size and improve dev boot time.
Use next/dynamic for lazy-loading heavy components. Apply when importing large components like editors, charts, or rich text editors that aren't needed on initial render.
Best practices for wrapping shadcn/ui components. Apply when creating 8-bit styled variants of existing shadcn/ui components.
| name | fumadocs-component-docs |
| description | Create component documentation with installation, usage examples, and preview sections. Apply when documenting 8-bit components with proper structure and examples. |
Create comprehensive documentation for 8-bit components following the standard structure.
Wrap component examples in ComponentPreview with realistic data:
<ComponentPreview title="8-bit ComponentName component" name="component-name">
<div className="md:min-w-[300px] min-w-[200px] flex flex-col gap-8">
<div>
<p className="text-sm text-muted-foreground mb-2">
Description of first variant
</p>
<ComponentName prop={value} />
</div>
<div>
<p className="text-sm text-muted-foreground mb-2">
Description of second variant
</p>
<ComponentName prop={value} variant="retro" />
</div>
</div>
</ComponentPreview>
For basic components like Button:
<ComponentPreview title="8-bit button component" name="button">
<Button>Button</Button>
</ComponentPreview>
For components with multiple sub-components like Sheet:
<ComponentPreview title="8-bit Sheet component" name="sheet">
<Sheet>
<SheetTrigger asChild>
<Button variant="outline">Open</Button>
</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>Edit profile</SheetTitle>
<SheetDescription className="text-xs">
Make changes to your profile here.
</SheetDescription>
</SheetHeader>
<div className="p-4 flex flex-col gap-4">
<Label>Name</Label>
<Input placeholder="Project name" />
</div>
<SheetFooter className="flex-row-reverse">
<SheetClose asChild>
<Button size="sm">Save changes</Button>
</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet>
</ComponentPreview>
Single import (simple components):
```tsx
import { Button } from "@/components/ui/8bit/button"
**Multiple imports** (complex components):
```mdx
```tsx
import {
Sheet,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/8bit/sheet"
### Props Documentation
For components with props tables, use tables:
```mdx
### Props
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| variant | `string` | `"default"` | Visual style variant |
| size | `string` | `"default"` | Size of the button |
| asChild | `boolean` | `false` | Whether to merge props onto child |
Show multiple variants in preview:
<ComponentPreview title="8-bit Health Bar component" name="health-bar">
<div className="md:min-w-[300px] min-w-[200px] flex flex-col gap-8">
<div>
<p className="text-sm text-muted-foreground mb-2">
Default health bar
</p>
<HealthBar value={75} />
</div>
<div>
<p className="text-sm text-muted-foreground mb-2">
Retro health bar
</p>
<HealthBar value={45} variant="retro" />
</div>
</div>
</ComponentPreview>
Place before ComponentPreview:
<div className="flex flex-col md:flex-row items-center justify-end gap-2 mb-2">
<CopyCommandButton
copyCommand="pnpm dlx shadcn@latest add @8bitcn/component-name"
command="pnpm dlx shadcn@latest add @8bitcn/component-name"
/>
</div>
@/components/ui/8bit/content/docs/components/button.mdx - Simple component patterncontent/docs/components/health-bar.mdx - Variant demonstrationcontent/docs/components/sheet.mdx - Complex sub-component pattern