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

rn-screen-keyboard

v1.0.1

Published

React-Native Screen keyboard implementation

Downloads

60

Readme

rn-screen-keyboard

A Customizable On-Screen Keyboard Component for React Native

This React Native component provides a user-friendly on-screen keyboard for various input scenarios. It offers customization options for styling, layout, and behavior, allowing you to tailor it to your specific needs.

Features:

  • Displays a standard numeric keyboard layout (rows 1-3, with 0 and a custom Backspace button in the footer).
  • Supports custom input of characters for flexibility.
  • Provides built-in Backspace functionality for single character deletion.
  • Allows for optional Left, Center, and Right components in the footer for additional features.
  • Includes customizable styling properties for cells, rows, and the overall keyboard.
  • Integrates with React Native's Pressable component for touch handling and optional ripple effects on Android (requires react-native-gesture-handler).

Installation:

npm install rn-screen-keyboard

Usage:

import RNScreenKeyboard from 'rn-screen-keyboard';
import {Text, View} from "react-native"

const MyComponent = () => {
  const [value, setValue] = useState('');

  const handleKeyPress = (data) => {
    setValue(data);
  };

  return (
    <View style={{ flex: 1 }}>
      <Text>{value}</Text>
      <RNScreenKeyboard
        value={value}
        onKeyPress={handleKeyPress}
        // Optional props for customization
        textStyle={{ fontSize: 20 }}
        cellStyle={{ backgroundColor: '#f0f0f0' }}
        BackSpaceComponent={<Text>DEL</Text>} // Custom Backspace component
        footerStyle={{ backgroundColor: '#e0e0e0' }}
        Left={<Text>.</Text>} // Custom left footer button
        Right={<Text>Done</Text>} // Custom right footer button
      />
    </View>
  );
};

Props:

| Prop Name | Type | Description | Default Value | |--------------------|----------------------|-------------------------------------------------------|----------------| | value | string | The current value of the input field | '' | | onKeyPress | (key: string) => void | Function to handle key press events | - | | textStyle | object | Styles applied to the text within each cell | {} | | cellStyle | object | Styles applied to each individual cell (button) | {} | | rowStyle | object | Styles applied to each row of cells | {} | | BackSpaceComponent | React.ReactNode | Custom component to display for the Backspace button | - | | footerStyle | object | Styles applied to the footer container | {} | | Left | React.ReactNode | Custom content to display in the left footer cell | - | | Right | React.ReactNode | Custom content to display in the right footer cell | - | | Center | React.ReactNode | Custom content to display in the center footer cell | - | | backspaceTint | string | Tint color for the Backspace icon (if not using a custom BackSpaceComponent) | 'black' | | textLength | number | (Optional) Maximum allowed length of the input string | 0 (unlimited) | | Footer | React.ReactNode | (Optional) Custom component to replace the default footer | - | | ripple | boolean | (Optional) Enables a ripple effect on touch (Android) | true | | ripple_color | string | (Optional) Color for the ripple effect | default_ripple_color (defined in styles) |

Customization:

  • You can further customize the appearance and behavior of the keyboard by overriding styles in your own stylesheet. Refer to the styles.js file for available style properties.
  • The ripple prop allows you to enable an optional ripple effect on Android platforms for a more tactile user experience. This requires linking react-native-gesture-handler.