shadcn.io is not affiliated with official shadcn/ui
Kbd examples · Function Keys
Function Keys Row Kbd for React
The full F1 to F12 function key row, rendered from a static list.
A reference page that covers every function key reads best with the whole row in view. This React example renders F1 to F12 as twelve Kbd caps in one row, mapped from a static list of key names, with a small gap between them.
Preview
Installation
FAQ
When should I show the whole row?
On a keyboard reference page, or when your app gives most function keys a job. If only one or two do something, show those keys next to their commands instead.
Should the row be interactive?
As a reference, no: Kbd caps are labels. If clicking a key should show what it does, render each one inside a button or a toggle and keep the caps as their content.
Should I group the keys like a keyboard does?
Physical keyboards split them into F1 to F4, F5 to F8 and F9 to F12. Splitting the list into three groups with a wider gap between them makes a long row easier to scan.
How should the row fit on a phone?
Twelve caps in one row overflow narrow screens. Let the row wrap, or switch to a grid of four or six columns at small widths. Most phones have no function keys anyway, so the row matters most on desktop.
Related
- F1 Help Key KbdA single F1 key, the usual shortcut for
- F12 DevTools Key KbdA single F12 key, the shortcut that opens
- Special Keys KbdThe Esc, Tab and Enter keys in a row
- Modifier Keys KbdThe Shift, Ctrl and Alt modifier keys in
- Editing Keys KbdThe Home, End, PgUp and PgDn editing keys
- Arrow Keys Cross Pattern KbdFour arrow keys in the inverted T of a