Skip to content

Input

Form

Text input field with consistent border and focus ring styling.

Email inputValidation errorDisabled
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Pair every input with a label. Use native type, required, autoComplete, and inputMode attributes. Connect validation text with aria-describedby.

Import
import { Input } from "@dashboardpack/core/components/ui/input";

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

Input props
PropType / DefaultDescription
typeHTML input type

Default: text (browser)

Native input behavior.
value / defaultValuestring | number

Default: —

Use value with onChange for controlled input.
onChangeChangeEventHandler<HTMLInputElement>

Default: —

Handle edits to the value.
disabledboolean

Default: false

Make the field unavailable.
aria-invalidboolean

Default: —

Expose validation failure.

Build with these too