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-input-with-keyboard

v1.1.8

Published

A simple input component with on-screen keyboard for react application.

Downloads

6

Readme

React Input with Keyboard ⌨️

Preview

Watch Demo Here

Installation

You can install this package with the following command:

yarn add react-input-with-keyboard

or

npm install react-input-with-keyboard

How to use

you can also see this example

Usage

import React, { Component } from "react";
import { TextInput, Textarea } from "react-input-with-keyboard";
import "./App.css";

// don't forget to import css file.
import "react-input-with-keyboard/dist/index.css";

class App extends Component {
  constructor(props) {
    super(props);

    this.state = {
      input1Val: "",
      input2Val: "",
      input3Val: ""
    };
  }
  onChangeTextField = (key, value) => {
    this.setState({
      [key]: value
    });
  };

  render() {
    const { input1Val, input2Val, input3Val } = this.state;
    return (
      <div className="App">
        <TextInput
          text={"Input with full keyboard"}
          placeholder="Please Scan Your Badge..."
          value={input1Val}
          containerClassName="inpContainer"
          keyboardKeyClassName="keyboardKeyStyles"
          onChange={text => this.onChangeTextField("input1Val", text)}
        />
        <TextInput
          text={"Input with numaric keyboard"}
          placeholder="Please Scan Your Badge..."
          value={input2Val}
          fullKeyboard={false}
          type="number"
          keyboardKeyContainerClassName="keyContainerClass"
          containerClassName="inpContainer"
          onChange={text => this.onChangeTextField("input2Val", text)}
        />
        <Textarea
          text={"Textarea with keyboard"}
          value={input3Val}
          fullKeyboard={true}
          onChange={value => this.onChangeTextField("input3Val", value)}
          containerClassName="inpContainer"
        />
      </div>
    );
  }
}

export default App;

Props

| Props | Type | Notes | | ----------------------------- | ------------ | ------------------------------------------------------------------------- | | containerClassName | string | className of the main Input wrapper. | | text | string | Heading of Input. | | textStyles | string | Heading className | | error | bool | for showing error | | inputClassName | string | input className | | placeholder | string | placeholder of the input | | value | string | value of the input | | size | string | size of the input, i.e. large default and small | | onFocus | function | callback function for onFocus event | | onBlur | function | callback function for onBlur event | | onChange | function | callback function for onChange event | | type | string | type of input, i.e text number etc. | | disabled | bool | flag for disable the input or not. | | id | string | id for the input. | | fullKeyboard | bool | flag for allow full keyboard on input or just numaric keyboard | | hideOnSmallDevice | bool | if you want to hide keyboard icon on small devices like moble and tablets | | keyboardIcon | React.node | icon for the keyboard, which is show on right side of the input | | keyboardIconColor | string | color of the keyboard icon | | iconClassName | string | className for keyboard icon | | keyboardKeyClassName | string | className for the text inside the keyboard's key | | keyboardKeyContainerClassName | string | className for the keyboard's key |