复制一段给 AI 编程工具的提示词,包含源码、依赖和用法
属性
FloatingToolbarProps
同时支持以下类型的全部属性: Omit<React.ComponentProps<"div">, "children" | "onSelect">
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| anchor* 必填 | ToolbarAnchor | null | — | Rectangle to hover over, relative to the positioned parent. null hides the toolbar. |
| containerWidth* 必填 | number | — | Width of the positioned parent, used to keep the toolbar inside it |
| groups* 必填 | ToolbarAction[][] | — | Groups of actions; a separator is drawn between groups |
| overflow | ToolbarOverflowItem[] | [] | — |
| onAction* 必填 | (id: string) => void | — | — |
| onDismiss | () => void | — | Called when Escape is pressed inside the toolbar |
| label | string | "Text formatting" | — |
安装
$ npx shadcn@latest add https://chromotion.dev/r/floating-toolbar.json