1.0.1 • Published 3 years ago

react-key-icons v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-key-icons

Small React component used to present keyboard keys or key combinations.

Installation

NPM:

npm install react-key-icons

Yarn

yarn add react-key-icons

Usage

The React component has one required prop, value, and the remaining are optional styling-related props.

import Key from "react-key-icons";

const Component = () => {
  return (
    <Key value={"B"} />
  );
};

Props

NamePurposeRequired?
valueString displayed on the button.Yes
heightSet the height of the button.No
disabledIf present, the button will appear shaded out.No
showCursorBy default, the cursor is not shown when hovering over the button. If this prop is present, the cursor is shown instead.No

Examples

Standard

const Component = () => {
  return (
    <Key value={"B"} />
  );
};

Height

const Component = () => {
  return (
    <Key value={"A"} height={96} />
  );
};

Disabled

const Component = () => {
  return (
    <Key value={"A"} disabled />
  );
};