Input

Displays a form input field or a component that looks like an input field.

Usage

Variants

Input supports 4 variants: flat, bordered (default), faded and underlined.

Sizes

Radius

Label Placements

Clear Button

Start & End Content

$

With Description

We'll never share your email with anyone else.

With Error Message

Please enter a valid email

Controlled

Value:

API

Props

PropTypeDefaultDescription
variant"flat" | "bordered" | "faded" | "underlined""bordered"The variant of the input.
color"default" | "primary" | "secondary" | "success" | "warning" | "danger""default"The color of the input.
size"sm" | "md" | "lg""md"The size of the input.
radius"none" | "sm" | "md" | "lg" | "full""md"The radius of the input.
labelReactNode-The content to display as the label.
valuestring-The current value of the input.
defaultValuestring-The default value of the input.
placeholderstring-The placeholder of the input.
descriptionReactNode-The description of the input.
errorMessageReactNode-The error message of the input.
startContentReactNode-Element to be rendered at the start of the input.
endContentReactNode-Element to be rendered at the end of the input.
labelPlacement"inside" | "outside" | "outside-left""outside"The position of the label.
fullWidthbooleantrueWhether the input should take up the full width of its container.
isClearablebooleanfalseWhether the input should have a clear button.
isInvalidbooleanfalseWhether the input is invalid.
isDisabledbooleanfalseWhether the input is disabled.
isReadOnlybooleanfalseWhether the input is read-only.

Events

EventTypeDescription
onValueChange(value: string) => voidHandler that is called when the value changes.
onClear() => voidHandler that is called when the clear button is clicked.