Input

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

Installation

npx shadcn add https://hq-ui.vercel.app/r/nova/input

Examples

Basic

input-basic

Field

Use Field, FieldLabel, and FieldDescription to create an input with a label and description.

input-field
Choose a unique username for your account.

Field Group

Use FieldGroup to show multiple Field blocks and to build forms.

input-fieldgroup
We'll send updates to this address.

Disabled

Use the disabled prop to disable the input. To style the disabled state, add the data-disabled attribute to the Field component.

input-disabled
This field is currently disabled.

Invalid

Use the aria-invalid prop to mark the input as invalid. To style the invalid state, add the data-invalid attribute to the Field component.

input-invalid
This field contains validation errors.

File

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

input-file
Select a picture to upload.

Inline

Use Field with orientation="horizontal" to create an inline input. Pair with Button to create a search input with a button.

input-inline

Grid

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

input-grid

Required

Use the required attribute to indicate required inputs.

input-required
This field must be filled out.

Badge

Use Badge in the label to highlight a recommended field.

input-badge

Input Group

To add icons, text, or buttons inside an input, use the InputGroup component. See the Input Group component for more examples.

input-input-group
https://

Button Group

To add buttons to an input, use the ButtonGroup component. See the Button Group component for more examples.

input-button-group

Form

A full form example with multiple inputs, a select, and a button.

input-form
We'll never share your email with anyone.