UIIcons

Input Group

A compound input component for attaching icons, text labels, and action buttons to an input field.

Installation

pnpm dlx stera-ui@latest add input-group

Composition

Use the following composition to build an InputGroup:

InputGroup
├── InputGroupInput or InputGroupTextarea
├── InputGroupAddon
├── InputGroupButton
└── InputGroupText

Align

Use the align prop on InputGroupAddon to position the addon relative to the input.

For proper focus management, InputGroupAddon should always be placed after InputGroupInput or InputGroupTextarea in the DOM. Use the align prop to visually position the addon.

inline-start

Use align="inline-start" to position the addon at the start of the input. This is the default.

inline-end

Use align="inline-end" to position the addon at the end of the input.

block-start

Use align="block-start" to position the addon above the input.

block-end

Use align="block-end" to position the addon below the input.

Examples

Text Addons

$
USD
https://
@company.com

With Button

https://

With Kbd

⌘K

Sizes

SizeDescription
smSmall
mdMedium (default)
lgLarge

Textarea

Line 1, Column 1

With Label

https://

Your public-facing URL.

API Reference

InputGroupAddon

PropTypeDescription
align"inline-start" | "inline-end" | "block-start" | "block-end"Position relative to the input

Subcomponents

ComponentDescription
InputGroupInputThe text input — accepts all Input props including size
InputGroupTextareaA textarea variant of the input control
InputGroupTextPlain text label inside an addon
InputGroupButtonButton inside an addon — accepts all Button props