Skip to content
GitHub

Input

A text input component for forms and user data entry with built-in styling and accessibility features.

Your API key is encrypted and stored securely.

import { Field, FieldDescription, FieldLabel } from "@/components/ui/pxl/field";
import { Input } from "@/components/ui/pxl/input";
export default function InputDemo() {
return (
<Field>
<FieldLabel htmlFor="input-demo-api-key">API Key</FieldLabel>
<Input id="input-demo-api-key" type="password" placeholder="sk-..." />
<FieldDescription>
Your API key is encrypted and stored securely.
</FieldDescription>
</Field>
);
}
pnpm dlx shadcn@latest add pxl-ui/registry/input
import { Input } from "@/components/ui/pxl/input"
<Input />

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

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

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

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.

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

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

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

Use the required attribute to indicate required inputs.

Use Badge in the label to highlight a recommended field.

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

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