DesktopSidebar
为宽屏幕布局设计的桌面端侧边栏导航组件。
导入
tsx
import { DesktopSidebar } from '@xcloud/ui-mobile'基础用法
tsx
import { DesktopSidebar } from '@xcloud/ui-mobile'
import { Home, Settings } from 'lucide-react'
function App() {
const navItems = [
{ label: 'Home', icon: Home, path: '/' },
{ label: 'Settings', icon: Settings, path: '/settings' }
]
return (
<DesktopSidebar items={navItems} />
)
}属性
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
items | NavItem[] | 必需 | 导航项 |
collapsed | boolean | false | 折叠状态 |
onToggle | () => void | - | 切换处理器 |