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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@idui/react-inputs

v1.1.13

Published

React Input Component

Readme

Input React Component

NPM Size JavaScript Style Guide Coverage Status LICENSE

Install

npm install --save @idui/react-inputs
yarn add @idui/react-inputs

TextInput

import React from 'react'
import { TextInput } from '@idui/react-inputs'

function Example() {
    const [value, setValue] = useState('');

    return (
        <TextInput
            value={value}
            onChange={setValue}
            type="text"
            
            onlyValue // call onChange with value, true by default
            isClearable // whether show clear icon or not, true by default
            onClear={undefined} // clear icon click handler, if not specified onChange with empty value called instead
            rightAddon={<SomeIcon />}
            leftAddon={<AnotherIcon />}
            disabled={false}
            hasError={false}

            mask="+7 (999)-999-99-99"// See @idui/react-mask-input mask, undefined by default
            maskPlaceholder="+7 (___)-___-__-__" // See @idui/react-mask-input maskPlaceholder
        />
    );
}

NumberInput

import React from 'react'
import { NumberInput } from '@idui/react-inputs'

function Example() {
    const [value, setValue] = useState('');

    return (
        <NumberInput
            value={value}
            onChange={setValue}
            type="text"
            onlyValue // call onChange with value, true by default
            thousandsSeparator=" " // separator inserted between thousands, space by default
            countOfDigitsAfterPoint={2} // count of digits in integral part of float value, undefined by default
            // ... TextInput props
        />
    );
}

useNumberInput hook

import React from 'react'
import { useNumberInput } from '@idui/react-inputs'

function Example({ value: providedValue, onChange  }) {
    const {value, ...handlers} = useNumberInput({
        onChange,
        countOfDigitsAfterPoint: undefined,
        thousandsSeparator: ", ",
        onlyValue: true,
        value: providedValue,
    });

    return (
        <input
            value={value}
            {...handlers}
        />
    );
}

SearchInput

import React from 'react'
import { SearchInput } from '@idui/react-inputs'

function Example() {
    const [value, setValue] = useState('');

    return (
        <SearchInput
            value={value}
            onChange={setValue}
            type="text"
            onlyValue // call onChange with value, true by default
            searchTimeout={300} // time interval during which onChange called only once, 300 by default
            showSearchIcon // whether show search icon or not, true by default
            searchIconPlacement="left" // show search icon 
            // ... TextInput props
        />
    );
}

useSearchInput hook

import React from 'react'
import { useNumberInput } from '@idui/react-inputs'

function Example({ value: providedValue, onSearch  }) {
    const {value, ...handlers} = useSearchInput({
        onChange: onSearch,
        searchTimeout: 300,
        onlyValue: true,
        value: providedValue,
    });

    return (
        <input
            value={value}
            {...handlers}
        />
    );
}

TagInput

import React from 'react'
import { TagInput } from '@idui/react-inputs'

function Example() {
    const [value, setValue] = useState(["tag1"]);

    return (
        <TagInput
            value={value}
            onChange={setValue}
            type="text"
            onlyValue // call onChange with value, true by default
            searchTimeout={300} // time interval during which onChange called only once, 300 by default
            showSearchIcon // whether show search icon or not, true by default
            searchIconPlacement="left" // show search icon 
            // ... TextInput props
        />
    );
}

Input

import React from 'react'
import Input from '@idui/react-inputs'

function Example(props) {
    const [value, setValue] = useState('');

    return (
        <Input
            value={value}
            onChange={setValue}
            // type="number" => NumberInput
            // type="search" => SearchInput
            // type="tag" // TagInput
            // any other type => TextInput
            
            // ... props for typed input
        />
    );
}

Styling

import React from 'react';
import styled from 'styled-components';
import { TextInput } from '@idui/react-inputs'; // or any other type of Input

const customColors = {
  default: {
    border: '#B3B3B3',
    color: '#313131',
    placeholder: '#B3B3B3',
    tag: '#14B9E4',
  },
  disabled: {
    border: '#f1eded',
    color: '#f1eded',
    tag: '#B3B3B3',
  },
  error: {
    border: '#C02908',
    color: '#C02908',
    background: '#FDDCDC',
    tag: '#C02908',
  },
  focused: {
    border: '#14B9E4',
    tag: '#11AFD9',
  },
};

const StyledTextInput = styled(TextInput)`
  min-height: 50px;
  padding: 12px 10px;
  border-radius: 15px;
  width: 500px;
  font-size: 16px;
`;

export function StylingExample({
  onChange,
  value: providedValue,
  onlyValue,
  ...props
}) {
  const [value, setValue] = useState(providedValue);

  useEffect(() => {
    setValue(providedValue);
  }, [providedValue]);

  const handleChange = useCallback(
    (e) => {
      setValue(onlyValue ? e : e.target.value);
      onChange(e);
    },
    [onChange, onlyValue]
  );

  return (
    <StyledTextInput
      {...props}
      value={value}
      onChange={handleChange}
      onClear={undefined}
      colors={customColors}
    />
  );
}

License

MIT © [email protected]