Skip to content
R

react-keyboard

A declarative library for handling hotkeys and focus within a React application

by ruanyu1Free

#623in UI Libraries
0In stores

Description

react-keyboard is a React wrapper around mousetrap.js that handles keyboard shortcuts in a React application. The README describes it as a d…

Highlights

  • Keyboard shortcuts for React, built on mousetrap.js
  • Declarative keyMap
  • HotKeys component
  • Single keys, combinations and arrays of commands
  • Event type set per shortcut

Ratings & Reviews

No ratings yet

Be the first to rate react-keyboard.

People also visit

R

react-hotkeys

A declarative library for handling hotkeys and focus within a React application

UI Libraries
Launch
R

react-keydown

Lightweight keydown wrapper for React components

UI Libraries
Launch
T

@TanStack/hotkeys

Type-Safe keyboard shortcuts library with awesome devtools

UI Libraries
Launch
F

focus-trap-react

A React component that traps focus

UI Libraries
Launch
R

react-contexify

Add contextmenu to your react component with ease

UI Libraries
Launch
K

kbar

fast, portable, and extensible cmd+k interface for your site

UI Libraries
Launch

react-keyboard FAQ

What is react-keyboard?

A React library for keyboard shortcuts and hotkeys. It wraps mousetrap.js.

How do I define shortcuts?

With a keyMap, where each value is a key sequence: a single key such as left, a combination such as command+k, or an array of commands.

Can I choose the event type?

Yes. Use an object with combo and eventType, such as keyup, for a particular shortcut.

What component does it provide?

A HotKeys component, which the README's usage example shows with a keyMap.

Is it open source?

Yes. The source is public on GitHub at ruanyl/react-keyboard.

What are the best react-keyboard alternatives?

Popular alternatives to react-keyboard include react-hotkeys, react-keydown and @TanStack/hotkeys. See all react-keyboard alternatives

Developer Stuff

Badges