ValyroUI Русская версия

Input Group

A field joined with text, buttons and selects in one frame. Free, MIT · Forms and input › Text

One frame for a field and what belongs to it: text, a button, a select, a key hint. Segments are joined (one border between them, rounded only at the outer ends) and the group shows one focus ring. The first child that is not a InputGroup.Text / InputGroup.Addon is the field: it gets the group's id, aria-describedby (plus the ids of the text parts) and invalid, so <FormField> around the group labels the field. className, style, ref and the other props go to the group (role="group").

Installation

npx valyro-cli@latest add input-group
npx shadcn@latest add https://valyro.xyz/r/input-group.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { InputGroup } from 'valyro-ui';

Props

PropTypeDefault
size'sm' | 'md' | 'lg''md'Height and text size of the group; passed to the kit controls inside that do not set their own.
orientation'horizontal' | 'vertical''horizontal'Segments in a row, or stacked. Block addons stack the group by themselves.
disabledbooleanfalseDisables every control inside.
invalidbooleanError look for the whole group; inside a FormField it follows the field's error.

Compound parts

InputGroup.Text (InputGroupText), InputGroup.Addon (InputGroupAddon)

Related components

Previous: Text Input · Next: Textarea · All Forms and input