/** * 组件库展示演示 (中文版) * 所有 UI 组件的交互式展示 */ import React, { useState } from 'react' export default function ComponentGalleryZh() { const [selectedCategory, setSelectedCategory] = useState('all') const [buttonVariant, setButtonVariant] = useState('default') const [switchState, setSwitchState] = useState(false) const [checkboxState, setCheckboxState] = useState(false) const [selectedTab, setSelectedTab] = useState('variants') const categories = [ { id: 'all', label: '全部组件' }, { id: 'buttons', label: '按钮' }, { id: 'forms', label: '表单' }, { id: 'feedback', label: '反馈' }, { id: 'navigation', label: '导航' }, { id: 'overlays', label: '叠加层' }, ] const buttonVariants = ['default', 'destructive', 'outline', 'secondary', 'ghost', 'link'] return (
{/* 标题 */}

UI 组件库

所有可用 UI 组件的交互式展示

{/* 分类筛选 */}
{categories.map((cat) => ( ))}
{/* 按钮部分 */} {(selectedCategory === 'all' || selectedCategory === 'buttons') && (

按钮

{/* 变体选择器 */}
{buttonVariants.map((variant) => ( ))}
{/* 按钮尺寸 */}
{/* 所有按钮变体 */}
)} {/* 表单部分 */} {(selectedCategory === 'all' || selectedCategory === 'forms') && (

表单组件

{/* 输入框 */}
{/* 文本域 */}