JGuang / JGuang UI
Components组件Radix UIRadix UI 组件

键盘按键

以键帽样式展示快捷键和组合键。

中文模式已适配导航、标题、简介、目录与常用章节名称。翻译状态:部分完成;技术正文目前仍为英文。
Loading JGuang UI example…

安装

Command

Manual

Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.

将以下代码复制到你的项目中。

View complete source: components/ui/kbd.tsx

根据项目配置更新导入路径。

用法

import { Kbd } from "@/components/ui/kbd"
<Kbd>Ctrl</Kbd>

Composition

Use the following composition to build Kbd and KbdGroup:

Kbd
KbdGroup
├── Kbd
└── Kbd

Group

Use the KbdGroup component to group keyboard keys together.

Loading JGuang UI example…

Button

Use the Kbd component inside a Button component to display a keyboard key inside a button.

Loading JGuang UI example…

Tooltip

You can use the Kbd component inside a Tooltip component to display a tooltip with a keyboard key.

Loading JGuang UI example…

Input Group

You can use the Kbd component inside a InputGroupAddon component to display a keyboard key inside an input group.

Loading JGuang UI example…

从右到左布局

To enable RTL support in JGuang UI, see the RTL configuration guide.

Loading JGuang UI example…

API 参考

Kbd

Use the Kbd component to display a keyboard key.

PropTypeDefault
classNamestring``
<Kbd>Ctrl</Kbd>

KbdGroup

Use the KbdGroup component to group Kbd components together.

PropTypeDefault
classNamestring``
<KbdGroup>
  <Kbd>Ctrl</Kbd>
  <Kbd>B</Kbd>
</KbdGroup>

来源: components/radix/kbd.mdx

JGuang UI 技术文档。

On this page