1.0.2 • Published 2 years ago

react-numeric-keyboard v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

React Numeric Keyboard

A numeric virtual keyboard for React. Especially for Progressive Web Applications and mobile views.

Demo

React-Numeric-Keyboard React-Numeric-Keyboard

Installation

using npm

  npm i react-numeric-keyboard

using yarn

  yarn add react-numeric-keyboard

Getting Started

Basic Usage

import { useState } from 'react';
import { NumericKeyboard } from 'react-numeric-keyboard';

function App() {
  const [isOpen, setIsOpen] = useState(false);
  const onChange = ({ value, name }) => {
    console.log(value, name);
  };
  return <NumericKeyboard isOpen={isOpen} onChange={onChange} />;
}

API Reference

propsTypedefaultDescription
isOpenbooleanRequired. Open or close the keyboard
onChange({value,name})VoidFunctionRequired. Getting the total value and the name of each keyboard characters
modesimple or spacedsimpleKeyboard's mode
hasTransitionbooleantruekeyboard's opening and closing transition
transitionTimenumber300mskeyboard's transition time. Only works if hasTransition prop is true.
classNamestringkeyboard's classname
styleCSSPropertieskeyboard's style
isKeyboardDisabledbooleanfalsePrevents keyboard's items from being clicked or touched
backSpaceIconReactNodeCustom backspace icon
leftIconReactNodeCustom left corner icon
containerClassNamestringClassName of the keyboard's items container
fullWidthbooleankeyboard's container width
headerReactNodeAn optional header above the keyboard. Note that to prevent your header's overflow use box-sizing:border-box in your header component

Authors

License

MIT

Roadmap

  • Add more keyboard's view