fumadocs-mdx-structure by theorcdev/8bitcn-ui
npx skills add https://github.com/theorcdev/8bitcn-ui --skill fumadocs-mdx-structure为 8-bit 组件创建结构良好的 MDX 文档文件,遵循既定模式。
---
title: 组件名称
description: 8-bit 组件的简要描述。
---
所有文档文件都需要以下导入:
import { ComponentName } from "@/components/ui/8bit/component-name";
import CopyCommandButton from "@/components/copy-command-button";
import InstallationCommands from "@/components/installation-commands";
import ComponentPreview from "@/components/component-preview";
紧接在 frontmatter 之后放置:
<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>
包裹组件示例:
<ComponentPreview title="8-bit ComponentName 组件" name="component-name">
<ComponentName>示例</ComponentName>
</ComponentPreview>
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
## 安装
---
<InstallationCommands packageName="component-name" />
## 使用
---
```tsx
import { ComponentName } from "@/components/ui/8bit/component-name"
<ComponentName variant="outline">示例</ComponentName>
### 完整示例
```mdx
---
title: 按钮
description: 显示一个 8-bit 按钮组件。
---
import { Button } from "@/components/ui/8bit/button";
import CopyCommandButton from "@/components/copy-command-button";
import InstallationCommands from "@/components/installation-commands";
import ComponentPreview from "@/components/component-preview";
<div className="flex flex-col md:flex-row items-center justify-end gap-2 mb-2">
<CopyCommandButton
copyCommand="pnpm dlx shadcn@latest add @8bitcn/button"
command="pnpm dlx shadcn@latest add @8bitcn/button"
/>
</div>
<ComponentPreview title="8-bit 按钮组件" name="button">
<Button>按钮</Button>
</ComponentPreview>
## 安装
---
<InstallationCommands packageName="button" />
## 使用
---
```tsx
import { Button } from "@/components/ui/8bit/button"
<Button variant="outline">按钮</Button>
### 关键原则
1. **必需 Frontmatter** - title 和 description 是必需的
2. **导入顺序** - 组件 → 工具 → UI 组件
3. **复制按钮** - 在 ComponentPreview 之前放置
4. **ComponentPreview** - 用于所有组件示例
5. **代码块** - 使用 ```tsx 用于 TypeScript 示例
6. **部分分隔符** - 在标题后使用 `---`
7. **8-bit 导入** - 使用 `@/components/ui/8bit/` 路径
### 文件位置
将文档文件放置在:
- `content/docs/components/component-name.mdx` 用于组件
- `content/docs/blocks/category/block-name.mdx` 用于区块
每周安装量
120
代码仓库
GitHub 星标数
1.8K
首次出现
2026年1月23日
安全审计
安装于
opencode108
codex108
github-copilot101
gemini-cli100
cursor94
amp83
Create well-structured MDX documentation files for 8-bit components following the established patterns.
---
title: Component Name
description: Brief description of the 8-bit component.
---
All documentation files require these imports:
import { ComponentName } from "@/components/ui/8bit/component-name";
import CopyCommandButton from "@/components/copy-command-button";
import InstallationCommands from "@/components/installation-commands";
import ComponentPreview from "@/components/component-preview";
Place immediately after frontmatter:
<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>
Wrap component examples:
<ComponentPreview title="8-bit ComponentName component" name="component-name">
<ComponentName>Example</ComponentName>
</ComponentPreview>
## Installation
---
<InstallationCommands packageName="component-name" />
## Usage
---
```tsx
import { ComponentName } from "@/components/ui/8bit/component-name"
<ComponentName variant="outline">Example</ComponentName>
### Complete Example
```mdx
---
title: Button
description: Displays an 8-bit button component.
---
import { Button } from "@/components/ui/8bit/button";
import CopyCommandButton from "@/components/copy-command-button";
import InstallationCommands from "@/components/installation-commands";
import ComponentPreview from "@/components/component-preview";
<div className="flex flex-col md:flex-row items-center justify-end gap-2 mb-2">
<CopyCommandButton
copyCommand="pnpm dlx shadcn@latest add @8bitcn/button"
command="pnpm dlx shadcn@latest add @8bitcn/button"
/>
</div>
<ComponentPreview title="8-bit button component" name="button">
<Button>Button</Button>
</ComponentPreview>
## Installation
---
<InstallationCommands packageName="button" />
## Usage
---
```tsx
import { Button } from "@/components/ui/8bit/button"
<Button variant="outline">Button</Button>
### Key Principles
1. **Frontmatter required** - title and description are mandatory
2. **Import order** - Component → utilities → UI components
3. **Copy button** - Place before ComponentPreview
4. **ComponentPreview** - Use for all component examples
5. **Code blocks** - Use ```tsx for TypeScript examples
6. **Section separators** - Use `---` after headings
7. **8-bit imports** - Use `@/components/ui/8bit/` path
### File Location
Place documentation files in:
- `content/docs/components/component-name.mdx` for components
- `content/docs/blocks/category/block-name.mdx` for blocks
Weekly Installs
120
Repository
GitHub Stars
1.8K
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode108
codex108
github-copilot101
gemini-cli100
cursor94
amp83
Claude技能创建器指南:构建模块化AI技能包,优化工作流与工具集成
5,700 周安装
API设计模式最佳实践指南:RESTful原则、错误处理、分页与安全性
102 周安装
Groove Work Plan:AI辅助代码库分析与项目计划生成工具 | 自动化开发流程
119 周安装
Groove Git日志自动化工具 - 自动生成每日Git提交摘要和变更记录
119 周安装
自媒体自动发布工具 - 支持百家号、知乎、公众号等平台一键发布,提升内容分发效率
105 周安装
Outlook自动化指南:通过Rube MCP与Composio工具包实现邮件、日历、联系人管理
83 周安装
WhoDB数据库助手:简化数据库操作,支持SQL查询、模式探索与数据导出
93 周安装