ui

Input Group

A flexible component for grouping inputs with addons, buttons, and other elements. Built with Base UI and Tailwind CSS. Copy-paste ready.

Installation

Usage

Examples

With End Icon

Places a decorative icon in the trailing InputGroupAddon — useful for search, email, or URL inputs.

With Start Text

A static text prefix (e.g. https://) prepended to the input using InputGroupText for formatted entry fields.

With End Text

A static text suffix (e.g. @domain.com or .00) appended after the input value.

With Start/End Text

Wraps the input with both a leading and trailing text label — common for currency inputs like $ / .00.

With Tooltip

The trailing addon is an info icon button that triggers a Tooltip with additional context about the field.

With Icon Button

The addon contains a clickable icon button for a contextual action, such as copy, clear, or insert.

With Button

A full button in the trailing addon, commonly used for submit actions inline with the input (e.g. "Subscribe").

With Badge

A badge in the addon area shows supplementary metadata — such as a file type indicator or character count label.

With Keyboard Shortcut

A KbdGroup in the trailing addon displays the keyboard shortcut that focuses or activates the input.

With Inner Label

A small floating label rendered inside the addon area to clarify the input's purpose without an external label.

Sizes

Renders sm, default, and lg size variants of the input group to show scaling across different layout contexts.

Disabled

Sets the entire input group to a disabled state, preventing interaction with both the input and any addons.

Loading

A spinner in the addon area signals that the input value is being validated or processed asynchronously.

With Number Field

Replaces the standard input with a NumberField inside the group, gaining increment/decrement buttons with the addon styling.

With Textarea

Swaps the single-line input for a Textarea with a block-end addon for submit or action buttons below the text area.

With Currency Select

A leading Select dropdown for currency combined with a numeric input and a trailing unit label — ideal for pricing or payment fields.

Newsletter Subscribe

An email input with a ghost arrow-right button in the trailing addon for a compact inline newsletter subscription form.

With Clear Button

A text input with an × ghost button addon that appears only when the field has content and clears it on click.

Chat Input With Send

A message input with a send icon button that shows a loading spinner while the async send operation completes, then clears the field.

Textarea With Character Count

An InputGroupTextarea with a character countdown in the block-end addon — the count turns amber at 20 remaining and red when over the limit.