New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-screen-keyboard

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-screen-keyboard

On-screen keyboard with customisable keys and tactile / UI feedback 📱

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
89
Maintainers
1
Weekly downloads
 
Created
Source

react-native-screen-keyboard

npm npm licence npm downloads


Install

To get started install via npm:

 npm install react-native-screen-keyboard
Usage

Import:

 import { PinKeyboard } from 'react-native-screen-keyboard';

Then add it to your code:

<PinKeyboard
    onRef={ref => (this.keyboard = ref)}
    keyDown={this.keyDown.bind(this)}
/>

// Callback function which receives the key pressed
keyDown(key){
   // Key pressed
}

The back and custom key will pass a sting, either "back" or "custom" to the keyDown callback.

The <PinKeyboard /> also has a number of functions which can be triggered through refs.

  • displayMessage(message) this will create a popup above the keyboard displaying the given a message. The style of the popup can be customized through props.
  • clearMessage() this will clear the keyboard message dialog.
  • enable() this will enable the keyboard for input.
  • disable() this will disable the keyboard.
PinKeyboard

The <PinKeyboard /> uses two arrays to allow you to set keys and define custom functions for each key.

PropTypeOptionalDefaultDescription
onRefanyNoonRef allows you to call the throwError(message) method.
keyDownfunctionNoCallback function triggered when a key is pressed. Returns the key value.
keyboardarrayYesSee PinKeyboard.js4 x 3 matrix containing the value for each key. See PinKeyboard.js.
keyboardFuncarrayYesSee PinKeyboard.js4 x 3 matrix containing custom functions for each key. Pass null for no function.
keyboardCustomKeyImagenumberYesnullImage for the custom key (bottom left key)
keyboardMessageDisplayTimenumberYes3000Time in milliseconds for the message dialog to automatically clear.
vibrationboolYesfalseKey / Tactile vibration enabled
keyboardStyleobjectYesSee PinKeyboard.jsStyle applied to the keyboard.
keyboardDisabledStyleobjectYesSee PinKeyboard.jsStyle applied when the keyboard is disabled.
keyStyleobjectYesSee PinKeyboard.jsStyle applied to each key on the keyboard.
keyTextStyleobjectYesSee PinKeyboard.jsStyle applied to the text inside each key.
keyImageStyleobjectYesSee PinKeyboard.jsStyle applied to image in a key. If an image is passed.
messageStyleobjectYesSee PinKeyboard.jsStyle applied to popup error. Can set the background colour here.
messageTextStyleobjectYesSee PinKeyboard.jsStyle applied to the text inside the popup error.

Contributing

If you want to issue a PR, go ahead ;)

Authors

License

This project is licensed under the MIT License

Keywords

FAQs

Package last updated on 02 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc