Input: With a button
Side by side with a gap, or joined into one control inside a <ButtonGroup />, where the input takes the remaining width.
This adds the example as components/examples/input/with-button.tsx, together with the Input component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/input-with-button.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 |
|---|---|---|
type | string | "text" |
Every prop is in the Input API reference.
- Sizes
- With a description
- Invalid
- Native validation
- Disabled
- Read only
- File
- Input types
- Controlled
- 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.