Atelier UI

搜索组件…

搜索组件…

Floating Toolbar

出现在文本选区上方的浮动格式工具栏,支持方向键漫游。

在沙盒中编辑

复制一段给 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
overflowToolbarOverflowItem[][]—
onAction* 必填(id: string) => void——
onDismiss() => void—Called when Escape is pressed inside the toolbar
labelstring"Text formatting"—

安装

$ npx shadcn@latest add https://chromotion.dev/r/floating-toolbar.json

同类组件