fumadocs-component-docs

Component Documentation Pattern

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "fumadocs-component-docs" with this command: npx skills add theorcdev/8bitcn-ui/theorcdev-8bitcn-ui-fumadocs-component-docs

Component Documentation Pattern

Create comprehensive documentation for 8-bit components following the standard structure.

Component Preview 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>

Simple Component Example

For basic components like Button:

<ComponentPreview title="8-bit button component" name="button"> <Button>Button</Button> </ComponentPreview>

Complex Component Example

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>

Usage Section Pattern

Single import (simple components):

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 |

Variant Examples

Show multiple variants in preview:

&#x3C;ComponentPreview title="8-bit Health Bar component" name="health-bar">
  &#x3C;div className="md:min-w-[300px] min-w-[200px] flex flex-col gap-8">
    &#x3C;div>
      &#x3C;p className="text-sm text-muted-foreground mb-2">
        Default health bar
      &#x3C;/p>
      &#x3C;HealthBar value={75} />
    &#x3C;/div>
    &#x3C;div>
      &#x3C;p className="text-sm text-muted-foreground mb-2">
        Retro health bar
      &#x3C;/p>
      &#x3C;HealthBar value={45} variant="retro" />
    &#x3C;/div>
  &#x3C;/div>
&#x3C;/ComponentPreview>

Copy Command Button

Place before ComponentPreview:

&#x3C;div className="flex flex-col md:flex-row items-center justify-end gap-2 mb-2">
  &#x3C;CopyCommandButton
    copyCommand="pnpm dlx shadcn@latest add @8bitcn/component-name"
    command="pnpm dlx shadcn@latest add @8bitcn/component-name"
  />
&#x3C;/div>

Key Principles

- Preview first - Show component before explaining

- Multiple variants - Demonstrate different prop combinations

- Realistic data - Use meaningful values in examples

- Import completeness - Include all used imports

- Code block labels - Use ```tsx for TypeScript

- 8-bit components - Import from @/components/ui/8bit/

- Consistent spacing - Use gap-4, p-4, mb-2 patterns

Reference Examples

- content/docs/components/button.mdx
 - Simple component pattern

- content/docs/components/health-bar.mdx
 - Variant demonstration

- content/docs/components/sheet.mdx
 - Complex sub-component pattern

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

fumadocs-mdx-structure

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

rendering-animate-svg

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

8-bit-pixel-art-patterns

No summary provided by upstream source.

Repository SourceNeeds Review