Create

Form

Input Group

Copy page View as Markdown Open in ChatGPT Open in Claude

Display additional information or actions to an input or textarea.

Usage#

app.component.ts
import { WDS_INPUT_GROUP } from '@wds/angular/input-group';

Examples#

Inline start#

An addon before the field. A click on the addon (outside its buttons) moves focus to the field.

Inline end#

A button after the field. A show/hide toggle keeps one label and reports its state with aria-pressed.

Block start#

align="block-start" puts the addon above the field, e.g. a label or a file name; divider adds a line.

Full name The label sits inside the frame, above the field. script.js

Block end#

align="block-end" puts the addon below the field, e.g. a counter and a submit button.

240 characters leftPost

Text#

wds-input-group-text shows a prefix or a suffix.

https:// .com $ USD

Kbd#

⌘K
Search in Everywhere Documents Photos

Spinner#

Saving...

Invalid#

The frame takes over the error state of the field (invalid from wds-field or on the field).

Email Enter a valid email address.

API References#

wds-input-group#

A field with addons (icon, text, button, shortcut, menu) in one frame. The frame takes over the focus ring, invalid and disabled of the field; the field loses its own border.

Slots

SlotDescription
(default)wds-input or wds-textarea, and wds-input-group-addon elements.

CSS parts (::part)

PartDescription
baseThe frame (border, background, focus ring).

wds-input-group-addon#

An addon of the field in wds-input-group: icon, text, button, <kbd>, menu. A click on the addon (outside interactive elements) moves focus to the field.

Attributes

AttributeTypeDefaultDescription
alignWdsInputGroupAddonAlign'inline-start'Position: before or after the field in the row (inline-*), or above or below it (block-*).
dividerbooleanfalseA dividing line (for block-start / block-end).

Slots

SlotDescription
(default)Addon content.

CSS parts (::part)

PartDescription
baseThe row with the padding (and the dividing line with divider).

wds-input-group-text#

Text in a field addon (e.g. https://, .com, a character counter).

Slots

SlotDescription
(default)Text, <svg> icon.

Accessibility#

Screen reader#

wds-input-group has role="group"; the field inside keeps its own role and name. Give the field a label (wds-field-label or aria-label): addon text such as https:// is not part of its name.

Buttons in addons are separate controls with their own names: an icon-only wds-button needs a label. Give icons aria-hidden="true".

The frame shows the focus ring and the invalid and disabled states of the field; the ARIA states stay on the field itself.

Keyboard support#

The group has no keyboard interaction of its own. The field and the controls in addons follow the page tab sequence.

Footer