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

react-input-material

v0.0.827

Published

Reusable material design based input field with support for (richt-)text, code, selections, numbers, dates and so on.

Readme

Project status

npm npm downloads

build build push package

check types lint test

code coverage

deploy web documentation web documentation

Use case

Reusable material design based input field with support for (richt-)text, code, selections, numbers, dates and so on.

Installation

You can install via package manager or simply download the compiled version as zip file here and inject:

npm install react-input-material
import {
    TextInput, FileInput, Checkbox, Inputs, Interval
} from 'react-input-material'

// ...

Examples

Simple uncontrolled input

const Application = () =>
    <TextInput<string>
        name="simpleInput"
        onChange={({value, invalid}) => {
            console.log('Set value', value)
            if (invalid)
                console.log('Value is invalid!')
        }}
    />

Simple controlled one

const Application = () => {
    const [value, setValue] = useState<null | string>(null)

    return <TextInput<null | string>
        name = "simpleInputControlled"
        onChangeValue = {setValue}
        value = {value}
    />
}

Number example

const Application = () =>
    <TextInput<number>
        declaration="Number"
        description="Place a number please."
        name="number"
        placeholder="100000"

        maximum={200000}
        minimum={10}
        required
        type="number"
    />

Code editor example

const Application = () =>
    <TextInput<string>
        className="text-input--code-editor"

        editor="code(js)"
        rows={6}
        
        initialValue="const value = 2"
    />

Complex rich text input

const Application = () =>
    <TextInput<string>
        className="text-input--richtext-editor"

        declaration="richtext"
        description="Please your styled text here."
        name="RichText"
        placeholder="Hello Mr. Smith,<br><br>this is a Placeholder."
        
        editor="richtext"
        rows={6}
        selectableEditor
        
        initialValue="Hello Mr. Smith,<br><br>how are you?"
        minimumLength={10}
        maximumLength={100}
        required

        onChangeValue={(value) => {
            console.log('Current value is', value)
        }}
    />

Universal Date input

const Application = () =>
    <TextInput<number>
        default={
            new Date('2025-01-01T00:00:00.000Z')
                .getTime() / 1000
        }
        name="timeInput"
        type="date"
    />

Local date input

const Application = () =>
    <TextInput<number>
        default="2025-01-01T23:00:00.000Z"
        name="timeInput"
        type="date-local"
    />

Select an input

const Application = () =>
    <TextInput<string>
        declaration="Selection Example"
        name="Example selection"
        selection={['A', 'B', 'C']}
    />

Select an input with mapped labels

const Application = () =>
    <TextInput<string>
        name="Another selection example"
        required
        selection={[
            {value: 'A', label: 'a'},
            {value: 'B', label: 'b'},
            {value: 'C', label: 'c'}
        ]}
    />

You can select and upload files

const Application = () =>
    <FileInput name="fileInput" />

Checkbox

const Application = () => <Checkbox />

List of any inputs are possible

const Application = () =>
    <Inputs<boolean | null, CheckboxProps>
        name="checkboxInputs"
        default={[{
            type: 'boolean',
            value: false,
            required: true,
            showInitialValidationState: true
        }]}

        createItem={useMemorizedValue(({
            index, item, properties: {name}
        }: CreateItemOptions<
            boolean | null,
            CheckboxProps,
            InputsProperties<boolean | null, CheckboxProps>
        >): CheckboxProps => ({
            ...item,
            name: `${name}-${String(index + 1)}`
        }))}

        maximumNumber={2}
        minimumNumber={2}
 
        showInitialValidationState
    >
        {({properties}) => <Checkbox {...properties} />}
    </Inputs>

Interval

const Application = () =>
    <Interval
        name="Interval example"
        required
        step={60}
        value={{
            start: {default: 120, maximum: 3600},
            end: {default: 240, minimum: 120}
        }}
    />