图标按钮

方形辅助图标按钮 - 中 36 像素(20 像素图标)和小 32 像素(16 像素图标),半径均为 10。用于行操作、标题铃声和工具栏控件。

安装

您可以使用我们的 CLI 或手动添加此图标按钮组件:

已支持深色模式,此 组件 会自动使用 BoardUI 的语义设计变量。 设置主题切换.

CLI 将组件源(及其内部依赖项)复制到您的项目中并安装任何所需的 npm 包。

npx boardui@latest add icon-button

使用共享 UI 包或自定义导入别名? 配置您的安装路径 在运行 CLI 之前。复制粘贴示例使用默认导入。

尺寸和状态

通过以下方式传递任何 Remix Icon 组件引用 图标,选择一个 尺寸,并始终提供 aria-label - 没有可见的文字。

<IconButton icon={RiEditLine} size="medium" aria-label="Edit" /> {/* 36px, 20px icon */}<IconButton icon={RiEditLine} size="small" aria-label="Edit" /> {/* 32px, 16px icon */} {/* Disabled */}<IconButton icon={RiEditLine} aria-label="Edit" disabled />