docs menuone key a combination
Kbd
A keycap for keyboard shortcuts in text.
import { Kbd } from "@meowerse/ui"; · source packages/ui/src/components/Kbd.tsx
variants and states
Enter
Shift + Enter
props
| prop | type | default | required |
|---|---|---|---|
children | ReactNode the key name, written as it appears on a keyboard. | — | yes |
css custom properties
| variable | dark | light |
|---|---|---|
--c-fg | #ededeb | #1a1a1c |
--c-line-strong | #404044 | #a9a8a2 |
--c-surface | #151517 | #dfded9 |
--font-mono | "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, "SFMono-Regular", Menlo, monospace | same |
--fs-1 | 0.75rem | same |
--r-s | 2px | same |
Classes: .mw-kbd. Set any of these variables on an ancestor (or wrap a subtree in .mw-theme--dark / .mw-theme--light) to restyle just that part of a page.
usage
one key
import { Kbd } from "@meowerse/ui";
<Kbd>Enter</Kbd><kbd class="mw-kbd">Enter</kbd>a combination
import { Kbd } from "@meowerse/ui";
<>
<Kbd>Shift</Kbd>
{" + "}
<Kbd>Enter</Kbd>
</><kbd class="mw-kbd">Shift</kbd> + <kbd class="mw-kbd">Enter</kbd>accessibility
- A native <kbd> element; screen readers read the key name.
do and don't
do
- Write key names as they appear on keyboards.
don't
- Don't use it for buttons on screen.