Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Kbd examples · Function Keys

F1 Help Key Kbd for React

A single F1 key, the usual shortcut for help.

Framework
UI library

On Windows, F1 has opened help for decades. This React example shows it as a single Kbd cap, the hint to put next to a Help menu item or a help button, in apps that bring help up from the keyboard.

Preview

Preview width
F1

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 an app document F1 for help?

When it actually opens your help, typically in desktop-style web apps with a lot of features. In a browser, F1 may open the browser's own help instead unless your page catches it.

Where should the F1 hint appear?

Next to the Help item in a menu, in a help button's tooltip and on the keyboard shortcuts page. It doesn't need to be on screen all the time.

What should F1 open?

Help for what the person is doing: the page or the focused field, not a generic start page. A side panel keeps their work visible while they read.

Does F1 work the same on Mac?

Not by default: on Mac keyboards, F1 lowers the screen brightness unless Fn is held or the function keys are set to standard mode. On Mac, ⌘? is the usual help shortcut.

Is F1 help accessible to everyone?

Many laptops need Fn to reach F1, and some people never use function keys. Keep a visible Help button or menu item; the key is a shortcut to it.

How do I catch F1?

Add a keydown listener to the document, check for event.key equal to F1, call preventDefault so the browser's help doesn't open, and open yours. Remove the listener when the component is removed.