InputGroup

Data input

A text field with addons inside its box: an icon, a unit or prefix, a button. <InputGroup.Root> holds one control, an InputGroup.Input or InputGroup.Textarea (in a Field, labelled and described by it), and InputGroup.Addons (align: inline-start, inline-end, block-start, block-end) holding icons, InputGroup.Text or InputGroup.Buttons. The group draws the box, its focus ring and its invalid state; clicking an addon's text focuses the control.

import { InputGroup } from '@limerdev/zest';
InputGroup for AI tools (llms.txt)
Use for
A search field with an icon, an amount with its currency, a URL with its scheme, a secret with a copy or show button, a message box with a send button under it.
Don't
A plain input: use Input. A choice from a list: use Select or Combobox. An addon that is the only label: give the field a Field.Label or aria-label.

Examples

Addons

An icon, a unit, a prefix: addons sit inside the field's box, before or after the input.

kr
https://

Buttons

Buttons in addons: show a secret, or send a message from under its text area.

Sent by email

Props

Every part also takes class (merged over its defaults), ref (bindable: the element), children, and child (a snippet that renders your own element, with props to spread on it).

InputGroup.Root

No props of its own beyond the common ones.

InputGroup.Addon

Prop Type Default Description
align "inline-start" | "inline-end" | "block-start" | "block-end" 'inline-start' Where it sits: before or after the control on its line (inline-start, inline-end), or above or below it (block-start, block-end).

InputGroup.Text

No props of its own beyond the common ones.

InputGroup.Input

Prop Type Default Description
files bindable FileList | null – The chosen files, for type="file". Bindable.
value bindable string | number | null – The text, or a number for type="number". Bindable.

InputGroup.Textarea

Prop Type Default Description
value bindable string | null – The text. Bindable.

InputGroup.Button

Prop Type Default Description
disabled null | false | true –
href string | null –
loading boolean false Waiting for the action it started: a spinner shows (in place of the icon of an icon-size button), it is marked busy and unavailable, and clicks do nothing. Unlike disabled, it keeps keyboard focus.
size "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" 'sm' The height and padding, from the theme's field size; the icon sizes are square.
type null | "button" | "submit" | "reset" –
variant "link" | "primary" | "secondary" | "neutral" | "error" | "outline" | "ghost" 'ghost' The look, by the theme's colour roles: primary for the main action, error for deleting, secondary, neutral and outline for the rest, ghost in toolbars, link for a navigation that looks like text.