shadcn.io is not affiliated with official shadcn/ui
Kbd examples · Arrow Keys
Vim Navigation Keys Kbd for React
The H, J, K and L keys in one row, the keys Vim moves the cursor with.
People who use Vim move with H, J, K and L, and many web apps support them too, from email clients to code review tools. This React example shows the four keys in one row on a four-column grid, in the order they sit on the keyboard.
Preview
Installation
FAQ
When should I document HJKL instead of arrow keys?
In tools for developers and keyboard-heavy users that support them: editors, terminals, list views in mail and issue trackers. Document the arrow keys as well, since most people don't know HJKL.
Why show HJKL in a row instead of a cross?
They are in a row on the keyboard, on the home row under the right hand. A cross would make them look like arrow keys and hide where the fingers actually go.
Should HJKL show which direction each key moves?
For anyone new to Vim, yes: H left, J down, K up, L right isn't obvious. Add a small label under each cap, or an arrow next to it.
Should I document modifier combinations too?
If your app supports them, list them separately, like Shift J or Ctrl D for half-page down. Keep this row for the four basic moves.
Related
- Arrow Keys Cross Pattern KbdFour arrow keys in the inverted T of a
- Arrow Keys Horizontal KbdLeft and right arrow keys grouped side by
- WASD Gaming Keys KbdThe W, A, S and D movement keys in an
- Vim Command Sequence KbdThe colon, W and Q keys in a row for
- Editing Keys KbdThe Home, End, PgUp and PgDn editing keys
- F1 Help Key KbdA single F1 key, the usual shortcut for