Kbd
A keyboard key or shortcut.
Example
Press
<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>import { Kbd } from '@focsd-dev/react';
export function Example() { return <Kbd>Ctrl</Kbd>;}<script setup>import '@focsd-dev/components/focsd-kbd.js';</script>
<template> <focsd-kbd>Ctrl</focsd-kbd></template>// Add CUSTOM_ELEMENTS_SCHEMA to the component's schemas, then:import '@focsd-dev/components/focsd-kbd.js';
// template<focsd-kbd>Ctrl</focsd-kbd><script> import '@focsd-dev/components/focsd-kbd.js';</script>
<focsd-kbd>Ctrl</focsd-kbd>API
Slots
| Slot | Description |
|---|---|
(default) | Default content. |
CSS parts
Style the inside of the component with ::part(), for example focsd-kbd::part(kbd).
| Part | Description |
|---|---|
kbd | The kbd element. |
Accessibility
- Renders a native
<kbd>.
Ask the docs
Hi, what are you building?
Ask about any component, theming, forms or frameworks. I answer with the right component, a snippet and a link to its docs.