Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Kbd examples · Sequence

Key Sequence with Arrow Kbd for React

A G then G key sequence with an arrow between the two presses.

Framework
UI library

Some shortcuts are two presses in a row rather than keys held together, like G G, which jumps to the top in Vim and in many keyboard-driven web apps. This React example puts a muted → between two G caps in a flex row, so the order reads at a glance. Because the caps aren't in a KbdGroup, they don't look like a chord.

Preview

Preview width
G→G

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

When should I use an arrow instead of the word then?

An arrow is compact, good for short sequences and tight spaces like menus. The word then is clearer for people who don't know sequence shortcuts, and it translates; the Key Sequence with Then example uses it.

Which arrow works between keys?

→ (U+2192), as here, is the most common. Avoid arrows that look like keys, such as ⇥ for Tab, which would read as part of the shortcut.

Why do shortcuts repeat a key, like G G?

Vim made double keys a pattern: gg jumps to the first line, dd deletes a line, yy copies one. A repeated key is quick to press and hard to hit by accident.

How much space should be around the arrow?

More than inside a chord: here gap-2 around the arrow, against the gap-1 a KbdGroup uses. The extra space shows the keys are pressed one after the other.

Can arrows show game combos?

Yes, fighting-game combos are sequences too: ↓ → P. Use the same row with an arrow between each step.

Do screen readers understand the arrow?

The → may be read as right arrow, which sounds like a key. Hide the arrow with aria-hidden and add then as visually hidden text when the hint matters.