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

@kitsuyui/react-textfield

v0.1.4

Published

A component that wrapped HTMLInputElement

Downloads

174

Readme

@kitsuyui/react-textfield

npm version

This package provides a text field component for React.

It is very pure and similar with the default <input type="text"> element and <textarea> element.

So you can pass the same props as those elements. (i.e. disabled, placeholder, maxLength, minLength, required, pattern, readOnly, autoComplete, autoFocus, name, id, className, style, ..., etc.) This means, you can use this component as a drop-in replacement for those elements.

The big difference is that this component how to handle the events. In default browser elements (<input type="text"> and <textarea>), the onChange event is fired in every key press. But when you are using IME or something special input method, the onChange event is fired in every key press even if the input is not completed or text conversion is not completed. (e.g. Japanese IME, Chinese IME, espanso, etc.) This component calls the onInput handler (text: string) => void only when the input is completed or text conversion is completed. (Internally, it uses CompositionEvent to detect the completion of input or text conversion)

Warning: This component has no effect to prevent the re-rendering of parent component. This means, if this component is re-created by parent component, the input may lost text conversion state.

Demo

Storybook: https://react-playground.docs.kitsuyui.com/storybook/

Installation

npm

npm install @kitsuyui/react-textfield

yarn

yarn add @kitsuyui/react-textfield

pnpm

pnpm add @kitsuyui/react-textfield

Reference

  • https://maku.blog/p/cv6fpx7/
  • https://gist.github.com/KurtGokhan/9aafd8e83c9bc6a2946fe2dc7f2c1d19
  • https://qiita.com/pochman/items/5b69ebedf4465f93c2f1

License

MIT