"use client" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { Badge } from "@/components/ui/badge" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" import { Separator } from "@/components/ui/separator" /** * 组件文档页面 * 提供详细的组件使用文档和API说明 */ export default function ComponentsDocs() { return (
详细的组件使用指南、API文档和最佳实践
{`// 导入基础UI组件
import { Button, Card, Input } from "@/components/ui"
// 导入自定义组件
import { PageHeader, StatCard } from "@/app/components/common"
// 使用组件
function MyComponent() {
return (
)
}`}
{`app/
├── components/
│ ├── ui/ # 基础UI组件
│ │ ├── button.tsx
│ │ ├── card.tsx
│ │ └── ...
│ └── common/ # 自定义业务组件
│ ├── PageHeader.tsx
│ ├── StatCard.tsx
│ └── ...
├── lib/
│ └── utils.ts # 工具函数
└── types/ # 类型定义`}
组件库使用 Tailwind CSS 进行样式管理,支持自定义主题配置。
{`// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
primary: {
50: '#eff6ff',
500: '#3b82f6',
900: '#1e3a8a',
}
}
}
}
}`}
{example}