Skip to content
GitHub11 stars

Used to display textual user input from keyboard.

⌘ ⇧ ⌥ ⌃ Ctrl + B
<div class="flex flex-col items-center gap-4">
    <KbdGroup>
        <Kbd>⌘</Kbd>

Installation

dnx Blazix.Cli add kbd

Usage

<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.

Use Ctrl + B Ctrl + K to open the command palette

<div class="flex flex-col items-center gap-4">
    <p class="text-sm text-muted-foreground">
        Use

Button

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

<Button Variant="ButtonVariant.Outline">
    Accept
    @(" ")
    <Kbd data-icon="inline-end" Class="translate-x-0.5">⏎</Kbd>
</Button>

Tooltip

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

<div class="flex flex-wrap gap-4">
    <ButtonGroup>
        <Tooltip>

Input Group

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

⌘ K
<div class="flex w-full max-w-xs flex-col gap-6">
    <InputGroup>
        <InputGroupInput placeholder="Search..." />

RTL

To enable RTL support in Blazix, see the RTL configuration guide.

Translated with AI for the demo, so it may have mistakes.

⌘ ⇧ ⌥ ⌃ Ctrl + B
<div class="flex flex-col items-center gap-4">
    <KbdGroup>
        <Kbd>⌘</Kbd>

API Reference

Kbd

ParameterTypeDefault
Class string? -
ChildContent RenderFragment? -

Other attributes are passed to the element it renders.

KbdGroup

ParameterTypeDefault
Class string? -
ChildContent RenderFragment? -

Other attributes are passed to the element it renders.