Skip to content
Focsd homeFocsd homeFocsd
Forms

Kbd

A keyboard key or shortcut.

  • Tag: focsd-kbd
  • Pattern: Static
  • Category: Display

Example

Press Ctrl + K to search.

HTML
<p>Press <focsd-kbd>Ctrl</focsd-kbd> + <focsd-kbd>K</focsd-kbd> to search.</p>

Usage

Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.

<script type="module">
import '@focsd-dev/components/focsd-kbd.js';
</script>
<focsd-kbd>Ctrl</focsd-kbd>

API

Slots

SlotDescription
(default)Default content.

CSS parts

Style the inside of the component with ::part(), for example focsd-kbd::part(kbd).

PartDescription
kbdThe kbd element.

Accessibility

  • Renders a native <kbd>.