链接按钮

按钮大小比例上的内联文本操作,但没有容器 - 没有填充或边框,只有悬停时带有下划线的标签。主要(蓝色)和次要(静音)变体;当传递 href 时呈现一个锚点,否则呈现一个按钮,因此相同的操作可以在复制或作为处理程序中使用。

了解更多

安装

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

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

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

npx boardui@latest add link-button

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

图标和尺寸

leadingIcon / trailingIcon 采用 Remix Icon 参考并按尺寸的图标比例渲染 - 中号为 20 像素,小号为 18 像素,xs 为 14 像素。

查看变更日志
{/* Icons render at the size's scale - pass the Remix Icon reference */}<LinkButton href="/changelog" trailingIcon={RiExternalLinkLine}> View changelog</LinkButton><LinkButton size="small" leadingIcon={RiDownloadLine} onClick={download}> Download report</LinkButton><LinkButton size="xs" variant="secondary" trailingIcon={RiArrowRightLine}> See all</LinkButton>