npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-screen-keyboard

v1.4.0

Published

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

Downloads

257

Readme

react-native-screen-keyboard

All Contributors

npm npm licence npm downloads

Install

To get started install via npm:

 npm install react-native-screen-keyboard

Usage

Import:

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

Then add it to your code:

<VirtualKeyboard
    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 string, either "back" or "custom" to the keyDown callback.

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

  • back() this will execute the back action to delete one character.
  • setText(text) this will set the keyboard text to the given value.
  • 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.

VirtualKeyboard

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

| Prop | Type | Optional | Default | Description | |----------------------------|----------|----------|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | onRef | any | Yes | | onRef allows you to call the throwError(message) method. | | onKeyDown | function | Yes | | Callback function triggered when a key is pressed. Returns the key value. | | onChange | function | Yes | | Callback function triggered when a key is pressed. Returns the full string. | | onCustomKey | function | Yes | | Callback function triggered when custom left button is pressed, use with onChange | | onPressFunction | string | Yes | onPressIn | Determines which function to call when the user pressed a key. Could be one of the following three functions: onPress, onPressIn or onPressOut. For an explanation how the functions work take a look at the GitHub page from the react-native-material-ripple project. | | keyboard | array | Yes | See VirtualKeyboard.js | 4 x 3 matrix containing the value for each key. See VirtualKeyboard.js. | | keyboardFunc | array | Yes | See VirtualKeyboard.js | 4 x 3 matrix containing custom functions for each key. Pass null for no function. | | keyboardCustomKeyImage | number | Yes | null | Image for the custom key (bottom left key) | | keyboardCustomBackKey | element | Yes | backAsset | Element for the back key (bottom right key) | | keyDisabled | array | Yes | See VirtualKeyboard.js | 4 x 3 matrix containing the disabled value for each key. See VirtualKeyboard.js. | | keyboardMessageDisplayTime | number | Yes | 3000 | Time in milliseconds for the message dialog to automatically clear. | | vibration | bool | Yes | false | Key / Tactile vibration enabled | | keyboardStyle | object | Yes | See VirtualKeyboard.js | Style applied to the keyboard. | | keyboardDisabledStyle | object | Yes | See VirtualKeyboard.js | Style applied when the keyboard is disabled. | | keyCustomStyle | array | Yes | See VirtualKeyboard.js | 4 x 3 matrix containing a custom style for each key. Pass null for default style or to use keyStyle as an override. | | keyStyle | object | Yes | See VirtualKeyboard.js | Style applied to each key on the keyboard. | | keyTextStyle | object | Yes | See VirtualKeyboard.js | Style applied to the text inside each key. | | keyImageStyle | object | Yes | See VirtualKeyboard.js | Style applied to image in a key. If an image is passed. | | messageStyle | object | Yes | See VirtualKeyboard.js | Style applied to popup error. Can set the background colour here. | | messageTextStyle | object | Yes | See VirtualKeyboard.js | Style applied to the text inside the popup error. | | messageTestID | string | Yes | "MessageContainer" | TestID belonging to the view component of the popup error. | | messageTextTestID | string | Yes | "Message" | TestID belonging to the text component inside the popup error. |

Contributing

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

License

This project is licensed under the MIT License

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!