Skip to content

About

Controlled React inputs with validation, icons and Tailwind styling hooks.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

RentnerInputs

CI CodeQL OpenSSF Scorecard npm version npm downloads MIT license

Controlled React inputs with validation, character counters, formatted values and customizable Tailwind styling.

Installation

Requires React 19, React DOM 19 and Tailwind CSS 4.

npm install @rentnerkev/inputs
# or with Bun
bun add @rentnerkev/inputs

Import the package styles in your Tailwind stylesheet:

@import 'tailwindcss';
@import '@rentnerkev/inputs/tailwind.css';

Quick start

'use client'

import { useState } from 'react'
import { TextInput } from '@rentnerkev/inputs'

export function NameField() {
    const [value, setValue] = useState('')

    return (
        <TextInput
            label="Name"
            value={value}
            onValueChange={setValue}
            showLength
            maxLength={40}
        />
    )
}

Screenshots

Text, email and character counters Password strength and currency formatting
Text, email and character counters Password strength and currency formatting
Inline validation and number limits Time selection and OTP confirmation
Inline validation and number limits Time selection and OTP confirmation

Full API and usage guide · Local Playground · MIT license

Run the Playground from the repository root:

bun install --cwd playground
bun run playground:dev

AI and read-only MCP access

The separate @rentnerkev/inputs/ai entry is for Node.js and Bun tooling. It reads only this installed package's manifest, README, usage guide, and built TypeScript declarations. It does not import React, mount UI, run examples, perform network requests, or require an MCP runtime. Keep it in server/tooling code.

import {
    getPackageInfo,
    getPackageApi,
    getPackageDocumentation,
    searchPackageDocumentation,
    getPackageExamples,
} from '@rentnerkev/inputs/ai'

const info = getPackageInfo()
const api = getPackageApi() // All public typed subpaths and dependent declarations
const usage = getPackageDocumentation('usage') // Full guide, including CSS and providers
const readme = getPackageDocumentation('readme')
const matches = searchPackageDocumentation('messages') // Literal, case-insensitive lines
const examples = getPackageExamples() // Fenced examples from the usage guide

getPackageApi({ subpath: '.', symbol: 'CustomInput' }) validates the symbol against the selected public entry and returns its complete declaration context. Unknown subpaths or symbols throw an error. File paths are not accepted. The ./ai entry itself is excluded from this UI API context. The manifest's exports map remains available through getPackageInfo().

Public website discovery is planned at llms.txt and the MCP endpoint. These addresses become available after the website deployment; this documentation does not claim the endpoint is already online. The website's read-only tools expose public package information, API declarations, usage guides, examples, and search, without accounts, write operations, or access to private project files. The installed /ai entry works locally without that service. Always use the documentation and declarations for the version installed in your project.

Nullable NumericInput, shared field sizes/slots, portal defaults, theme.css and pure ./form adapters are documented in the usage guide.

Community

See Contributing, the Code of Conduct, Support, and the Security Policy.

About

Controlled React inputs with validation, icons and Tailwind styling hooks.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages