InputGroup
One bordered control that holds an input and its action.
- Use it for
- An input with an attached action or affix, such as a search with a button or an amount with a currency.
- Not for
- Separate controls that only happen to sit together. Try Field.
InputGroup preview
Loading example…
Installation
npm install @stackunseen/uiimport { InputGroup } from '@stackunseen/ui';@stackunseen/ui/styles.cssParts
One border around an input and what goes with it. Wrap it in Field for the label.
How the parts fit together
<Field label="Website">
<InputGroup>
<InputGroupAddon>https://</InputGroupAddon>
<Input />
<InputGroupButton type="submit">Check</InputGroupButton>
</InputGroup>
</Field>InputGroupThe shared border around the parts.
InputGroupAddonA prefix or suffix such as an icon, a currency sign or a domain.
InputThe field itself, a normal Input.
InputGroupButtonThe action at the end, such as Subscribe.
Usage and props
The group draws the one border, radius and focus ring through :focus-within; the input gives up its own, and the button keeps an inner keyboard ring. Field supplies the label, description, error and disabled state; it works in a native form.
Supported inputs
This is the public signature used by this example. Open Code to see how the values and callbacks fit together.
attach?: flush | inset · size?: default | touch · shape?: control | pill · invalid? · disabled? · InputGroupAddon · InputGroupButtonAll props
Loading…
For your coding agent
Give the agent this page instead of a screenshot. The prompt wraps the page with the install and import lines and the rule that your server, not a click, completes an action.
- Contract
- attach?: flush | inset · size?: default | touch · shape?: control | pill · invalid? · disabled? · InputGroupAddon · InputGroupButton
- Keeps honest
- The group draws the one border, radius and focus ring through :focus-within; the input gives up its own, and the button keeps an inner keyboard ring. Field supplies the label, description, error and disabled state; it works in a native form.
- MCP
read_component "InputGroup"on the docs endpoint
Keyboard and customization
Keyboard
Tab moves from the input to the button; Enter in the input submits the form.
Customization
Change shared colors, spacing, corners and icons with the theme. Use the component's supported props to adapt its content and layout. Customization guide and Theme Studio