Input
Capture user data. Built-in validation states. Error prevention.
Installation
pnpm dlx nachui add inputAnatomy
Variants
Default
With Label
Input with a built-in label using the
label prop.Invoices and deploy alerts are sent here.
With Error
Validation error state with accessible error messaging.
Invite a teammate
They get access to the Northwind Labs workspace.
Enter a full address, like marco@northwindlabs.com
With Icons
Input with left and/or right icon slots.
Sizes
Three size variants:
sm, default, and lg.Disabled
A disabled state prevents all interactions.
Only the workspace owner can change this address.
Compound Components
The Input also exposes sub-components for custom layouts:
API Reference
Input
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Label text rendered above the input. |
error | string | — | Error message displayed below the input. |
description | string | — | Helper text displayed between the label and input. |
size | "sm" | "default" | "lg" | "default" | The size of the input field. |
leftIcon | React.ReactNode | — | Icon displayed on the left side of the input. |
rightIcon | React.ReactNode | — | Icon displayed on the right side of the input. |
disabled | boolean | — | Disables the input. |
className | string | — | Additional CSS class names. |
type | string | "text" | The type of the input element. |
Input.Wrapper
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS classes. |
children | React.ReactNode | — | The wrapper content. |
Input.Label
| Prop | Type | Default | Description |
|---|---|---|---|
htmlFor | string | — | Associates with an input. |
className | string | — | Additional CSS classes. |
Input.Description
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS classes. |
children | React.ReactNode | — | The description text. |
Input.Error
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS classes. |
children | React.ReactNode | — | The error message. |
Found something to improve?
Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.