Kbd
Show a keyboard key or shortcut.
SourceStyles source@monoline/react 0.4.0Markdown for AI toolsstable
- Built on native elements
- Native kbd element, announced as text.
- Styles in one file:
05-marks.css
Import
import '@monoline/css';
import {Kbd} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add kbd
Usage
import {Kbd} from '@monoline/react';
<p>Press <Kbd>⌘</Kbd> <Kbd>K</Kbd> to search.</p>
Examples
Shortcut
Data Attributes
State is exposed through attributes. Style it with these selectors, not with class toggles.
This component sets no state attributes.
CSS classes
| Class | Stylesheet |
|---|---|
.badge | 05-marks.css |
.badge-accent | 05-marks.css |
.badge-solid | 05-marks.css |
.check | 05-marks.css |
.check-fail | 05-marks.css |
.check-pass | 05-marks.css |
.dot | 05-marks.css |
.heat-0 | 05-marks.css |
.heat-1 | 05-marks.css |
.heat-2 | 05-marks.css |
.heat-3 | 05-marks.css |
.heat-4 | 05-marks.css |
.kbd | 05-marks.css |
.key-hints | 05-marks.css |
.swatch | 05-marks.css |
Customization
Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.
app.css
.badge {
border-color: var(--accent);
}
Accessibility
- Native kbd element, announced as text.