ui

Input

A native input element. Built with Base UI and Tailwind CSS. Copy-paste ready.

API Reference

Installation

Usage

Examples

For accessible labelling and validation, prefer using the Field component to wrap inputs, or the FieldControl component. See some related examples.

With Label

Pair the input with a visible FieldLabel using Field for accessible name association.

With Description

Adds a FieldDescription below the input to provide additional guidance or format hints.

With Error Message

Shows a FieldError below the input after native constraint validation fails on form submission.

With Character Counter

Displays a live character count below the input that updates as the user types, indicating the remaining budget.

Password

A type="password" input with a visibility toggle button to reveal or mask the entered value.

Phone

A type="tel" input styled for phone number entry, optionally combined with a country-code prefix.

URL

A type="url" input that validates the format on blur and shows a browser-native or custom error message.

Number

A type="number" input with min, max, and step constraints applied for numeric-only entry.

Date

A type="date" input that renders the browser's native date picker widget.

File

A type="file" input styled to match the design system, with a custom label trigger hiding the default file button.

With Required

Displays a red asterisk on the label to signal that the field must be filled before submitting.

Time

A type="time" input that renders the browser's native time picker for hour and minute selection.

With Multiple Fields

A group of related inputs (e.g. first name and last name) laid out side by side in a single row.

Label With Tooltip

The label carries an info icon button that opens a Tooltip with additional context about the field.

With Badge

An inline badge appended to the label — used for plan-restricted or beta fields to indicate access requirements.

With Optional

An "Optional" badge appended to the label to distinguish non-required fields from required ones at a glance.

A password-style input with a "Forgot password?" link next to the label and a show/hide toggle inside the field.

Multiple Errors

Displays a bulleted list of validation errors below the field — useful for fields with multiple constraints.

Password Strength

A password input with a live strength indicator that evaluates the entered value and shows a color-coded hint message.

Disabled

A disabled input showing a masked value — used for read-only secrets like API tokens with a description pointing to where to manage them.

Readonly With Copy

A readOnly input for shareable links or tokens, paired with a copy-to-clipboard icon button that toggles to a checkmark on success.

With Inline Icon

An absolutely-positioned icon rendered inside the input's leading edge using padding offset — no wrapper component required.

Color Picker

A type="color" input styled to match the design system, used for theme or brand color selection.

With Clear Button

A text input with an × clear button that appears only when the field has a value and empties it on click.