shadcn-templ 2.0 beta. Switch to templUI v1
1.7k

Kbd

Used to display textual user input from keyboard.

Ctrl +B
package examples import "github.com/axadrn/shadcn-templ/v2/components/kbd"

Installation

shadcn-templ add kbd

Usage

import "github.com/axadrn/shadcn-templ/v2/components/kbd"
@kbd.Kbd() {	Ctrl}

Composition

Use the following composition to build Kbd and KbdGroup:

kbd.Kbdkbd.Group├── kbd.Kbd└── kbd.Kbd

Group

Use the kbd.Group component to group keyboard keys together.

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

package examples import "github.com/axadrn/shadcn-templ/v2/components/kbd"

Button

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

package examples import (

Tooltip

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

package examples import (

Input Group

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

K
package examples import (

API Reference

Kbd

Use the Kbd component to display a keyboard key.

Prop Type Default
Class string -
@kbd.Kbd() {	Ctrl}

KbdGroup

Use the kbd.Group component to group Kbd components together.

Prop Type Default
Class string -
@kbd.Group() {	@kbd.Kbd() {		Ctrl	}	@kbd.Kbd() {		B	}}