Jump to a page or a component.
Text field with an optional leading icon and an auto-clear button.
No install — ask an AI agent to copy this component from registry.json.
import { Input } from "@/components/ui/input";onClear or onChange is supplied.onClear, clearing writes an empty value to the DOM node and re-fires onChange with that node as event.target, then returns focus.aria-label or aria-labelledby.data-testid lands on the input; the clear button derives ${testId}-clear-button.The props worth knowing. Everything else passes straight through to the underlying element, including className, which is merged last so it always wins.
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | LucideIcon | — | Leading decorative icon. aria-hidden. |
| iconColor | string | — | Fixed color for the icon. Unset falls back to the themed dim tone. |
| onClear | () => void | — | Replaces the default clear behaviour, for when clearing must reset state onChange cannot reach. |
| clearLabel | string | "Clear" | Accessible name for the clear button. Pass a translated string from the call site. |