复制一段给 AI 编程工具的提示词,包含源码、依赖和用法
属性
IconRailProps
同时支持以下类型的全部属性: Omit<React.ComponentProps<"aside">, "children" | "onChange">
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| items* 必填 | IconRailItem[] | — | Primary destinations, listed from the top |
| bottomItems | IconRailItem[] | [] | Pinned to the bottom, e.g. settings and the account avatar |
| header | React.ReactNode | — | Brand mark shown at the top |
| activeId | string | — | — |
| defaultActiveId | string | — | — |
| onActiveChange | (id: string) => void | — | — |
| expanded | boolean | — | Whether labels are shown (controlled) |
| defaultExpanded | boolean | false | — |
| onExpandedChange | (expanded: boolean) => void | — | — |
| expandedWidth | number | 224 | Width in px when expanded |
安装
$ npx shadcn@latest add https://chromotion.dev/r/icon-rail.json