Input: Invalid
aria-invalid turns the edge and the focus ring red. Link the message with aria-describedby so it is announced, not just colored.
Enter a full email address, like [email protected].
This adds the example as components/examples/input/invalid.tsx, together with the Input component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/input-invalid.jsonTo add only the component, follow the Input installation.
Props in this example
The Input props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
defaultValue | string | number | string[] | – |
type | string | "text" |
aria-invalidShows the invalid edge and focus ring. | boolean | – |
Every prop is in the Input API reference.
- Sizes
- With a description
- Native validation
- Disabled
- Read only
- File
- Input types
- Controlled
- With a button
- Grid
- Long content
- Right to left
See them all, with keyboard support and accessibility notes, on the Input page.
- MotionThe easing curves, durations and reduced-motion check every component animates with, plus hooks for size morphs and sliding highlights.
- Number flowAnimated numbers where only the changed digits spin, with any Intl format and locale.
- useAutosizeGrows a textarea with what you write between its minimum and maximum height, animating each change without ever touching the text.
- useComposedRefKeeps a ref to your own element while still forwarding it to whatever ref the parent passed in.
- useInvalidShakeShakes a form control when a submit attempt finds it invalid, and never while someone is still typing.
- useMergedRefCombines any number of callback and object refs into one, with React 19 ref cleanup for each of them.