Skip to main content

Input

Input is a text input field component with size variants, visual styles, and validation states.

Open in Storybook

Import

import { Input } from "@tosui/react";

Basic Usage

Sizes

Variants

States

Input Types

Input supports all native HTML input types.

With FormField

Use with FormField for labels and validation messages.

<FormField
label="Email"
helperText="We'll never share your email"
isRequired
>
<Input type="email" placeholder="you@example.com" />
</FormField>

<FormField
label="Username"
errorMessage="Username is already taken"
isInvalid
isRequired
>
<Input placeholder="Enter username" />
</FormField>

Props Reference

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"Input size
variant"outline" | "filled""outline"Visual variant
disabledbooleanfalseDisable the input
isInvalidbooleanfalseShow invalid state
typestring"text"HTML input type
placeholderstring-Placeholder text

Input also accepts all native <input> attributes and Box styling props.

TypeScript

import { Input, type InputSize, type InputVariant, type InputProps, type InputOwnProps } from "@tosui/react";