Integrated ResearchPicasso
Components

Input group

An input with things beside it — an icon, a unit, a spinner, a button.

{/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */}

An input with things beside it — an icon, a unit, a spinner, a button.

Import

import { InputGroup, InputGroupAddon, InputGroupText, InputGroupSpinner, InputGroupCheck, InputGroupTooltip, InputGroupInput } from "@ir/ui";

Variants

AxisOptionsDefault
sizesm · mdmd

Props

PropTypeRequiredWhat it does
align"start" | "end"Which side of the input. Purely order — put the addon before or after the input.

Do and don't

Let the group draw the box and keep the input bare.

Don't — Put a border on the input inside the group.

Only then does the focus ring surround the addons too. Draw it on the input and the ring stops at the icon.

Put it in a trailing text addon, so it stays visible once there is a value.

Don't — Write the unit into the placeholder — 'Threshold in ms'.

A placeholder disappears exactly when the person needs to check what they typed.

Leave icons out of the tab order; give real controls a label.

Don't — Make a decorative icon focusable.

Every stop in the tab order costs a keyboard user a keystroke. A search icon is not worth one.

Set aria-invalid or disabled on the input; the group reads it.

Don't — Pass invalid or disabled to the group as a prop.

One source of truth. The thing that is invalid is the value, and the value lives in the input.

Keep one thing per side, and move the rest out of the field.

Don't — Stack a unit, a spinner and two buttons into one trailing slot.

The field shrinks to fit whatever you put beside it, and a 60px input is not a field any more.

Accessibility

  • The group is role="group" and the control inside it is bare. The group reads the inner control's aria-invalid and :disabled through :has(), so the border, the ring and the disabled tokens all follow the real control rather than a prop someone can forget.
  • This is where invalid lives for Input, Select, Textarea, Number and Password: has-[[aria-invalid=true]]:border-line-input-invalid on the group. The controls themselves add nothing.
  • Clicking the group focuses the control — but only when the click did not land on a button, link or another field, and only when the control is not disabled.
  • The spinner is role="status" with an sr-only label, so a busy field announces itself. The check mark has one too.
  • InputGroupInfo is an icon-only button; its label becomes the aria-label and the Info glyph is aria-hidden.

Where it is drawn

Figma — structure from figma, measurements from figma.

Open in Storybook

On this page