Input

Single-line text field. Supports every native HTML input type (text, email, number, date, file). Pair it with Field to add a label, description, or error message.

Default

Standard single-line input bound with v-model.

Dark previewReplay previewOpen in new tab

Usage

Import the parts you need from the component's folder.

ts
import { Input } from "@/components/ui/input";

Type variants

Every native HTML type is supported through the type attribute.

Dark previewReplay previewOpen in new tab

Field

Wrap Input in Field, use FieldLabel for the label, and FieldDescription for hint text.

Dark previewReplay previewOpen in new tab

We will send a confirmation to this address.

Field Group

Use FieldGroup to stack multiple Field blocks and build forms.

Dark previewReplay previewOpen in new tab

We will send updates to this address.

Disabled

Add the disabled attribute to Input; add data-disabled to Field to style the wrapper.

Dark previewReplay previewOpen in new tab

This field is currently disabled.

Invalid

Set data-invalid on Field, aria-invalid on Input, and use FieldError for the message.

Dark previewReplay previewOpen in new tab

File

Use type="file" to create a file input.

Dark previewReplay previewOpen in new tab

Select a picture to upload.

Inline

Use Field with orientation="horizontal" and pair with a Button for an inline search field.

Dark previewReplay previewOpen in new tab

Grid

Use a grid layout to place multiple inputs side by side.

Dark previewReplay previewOpen in new tab

Required

Use the required attribute to indicate required inputs.

Dark previewReplay previewOpen in new tab

This field must be filled out.

Badge

Use a Badge in the label to highlight or tag a field.

Dark previewReplay previewOpen in new tab

Input Group

Use InputGroup to place icons, text, or buttons inside the input.

Dark previewReplay previewOpen in new tab
https://

Button Group

Use ButtonGroup to attach a button to the input.

Dark previewReplay previewOpen in new tab

Form

A full form example composed from multiple inputs.

Dark previewReplay previewOpen in new tab

We will never share your email with anyone.

API Reference

Input

PropTypeDefaultDescription
modelValuestring | number—Value. Supports v-model.
defaultValuestring | number—Starting value when v-model is not used.
typestring"text"Native HTML input type.
classstring—Extra classes, merged with cn().
EventDescription
update:modelValueFires on input. Enables v-model. Native input events also bubble through.