Input Group
Inputs and textareas with aligned icons, helper content, and actions.
Use Input Group to combine a text input or textarea with icons, text, keyboard hints, and actions inside one surface. Wrap it in Field when the control needs a visible label, description, or validation message.
Import
Section titled “Import”import { InputGroup } from "@zentara-co/zenos-ui";Addon alignment
Section titled “Addon alignment”Set align on an addon to position it independently of DOM order:
inline-start: before the input, or on its right in RTL.inline-end: after the input, or on its left in RTL.block-start: a full-width header above the control.block-end: a full-width footer below the control.
For new compositions, put the input or textarea first in the DOM, followed by addons. CSS alignment changes visual placement while keyboard focus still reaches the input before addon buttons. Clicking non-interactive addon content focuses the control; buttons, links, and other interactive content keep their own behavior.
Omitting align preserves existing DOM-order placement. InputGroup.Control remains the same input component as InputGroup.Input. Place interactive actions inside an aligned InputGroup.Addon using InputGroup.Button.
Textarea and block content
Section titled “Textarea and block content”Use InputGroup.Textarea for a multiline control with a correctly typed textarea ref, native rows, maxLength, and form props. The group grows to fit a textarea or block-aligned addons instead of retaining a fixed single-line height.
Place header and footer content in block-aligned addons. InputGroup.Text works for filenames, units, or character counts, and compact InputGroup.Button actions fit inside the addon. The example keeps value state local and sends the message through an explicit callback.
Share up to 280 characters.
No message sent.
Icons, keyboard hints, menus, and loading
Section titled “Icons, keyboard hints, menus, and loading”Addons accept arbitrary React content, including icons, Kbd, tooltips, menus, and status indicators. Label icon-only actions and hide decorative icons from assistive technology.
InputGroup.Button supports Button’s variants, sm | md | lg sizes, loading state, and native props. It defaults to a compact sm ghost button with type="button"; set type="submit" deliberately in a form. Use a trigger’s render prop to compose a menu or tooltip with the grouped button rather than nesting buttons. Its own render prop also supports button-compatible custom controls.
No file action selected.
Variants
Section titled “Variants”Choose default, filled, or none to match nearby Inputs. Input Group uses the same corner radius, border, fill, hover treatment, typography, and size scale as Input. The root owns the border and background; nested controls stay chromeless, including when disabled or invalid. Inline addons share the control’s outer padding with a compact gap before the text. Variants describe the surface, independently of the field’s state.
Use native control props and Field.Root to express state rather than changing the group’s variant:
- Default: editable and focusable. Focusing the input or textarea activates the group’s focused border. The
defaultvariant uses Input’s pressed background;filledandnonestay transparent while focused. - Disabled:
Field.Root disableddisables its control. Disable independent addon buttons explicitly, and keep a description explaining why the field is unavailable. - Invalid:
Field.Root invalidsuppliesaria-invalid; pair it withField.Errorto associate the validation message. The group uses a 2px danger border and accent red subtlest fill. - Read-only: pass
readOnlyto the input or textarea. The value remains focusable and selectable without allowing edits.
Addons and default grouped buttons do not add a hover background. Use className if an action needs its own hover treatment, while preserving visible focus styling.
Focus the input to see the active group border.
Your organization manages this handle.
Use letters, numbers, and hyphens only.
You can focus and copy this handle, but not edit it.
The root’s sm, md, and lg sizes set single-line heights of 36px, 40px, and 44px. Inputs inherit this scale. Textareas use size-dependent minimum heights and may grow; compact buttons use their own Button size.
Custom styling and controls
Section titled “Custom styling and controls”Every part accepts the usual className prop. You do not need a variant prop to customize the surface, control, text, or actions. Keep focus and invalid states distinguishable and retain an accessible label.
InputGroup.Control render composes another input-compatible control while keeping group styling and props. For multiline content, prefer the dedicated InputGroup.Textarea rather than passing a textarea to an input-typed ref. A consumer-owned control can also participate directly by setting data-slot="input-group-control" on its native input or textarea; provide its own label, field associations, and chromeless styling. The root uses that slot to detect focus, invalid, and disabled state.
Variants
defaultfillednone Sizes
smmdlg InputGroup.Root InputGroup.Input InputGroup.Textarea InputGroup.Addon InputGroup.Text InputGroup.Button InputGroup.Control
API
| Prop | Type | Default | Description |
|---|---|---|---|
variant | InputVariant | default | Surface inherited by the control. |
size | sm | md | lg | md | Height inherited by controls. Buttons have their own size. |
Addon.align | inline-start | inline-end | block-start | block-end | — | Visual addon placement, with logical inline positions for RTL. Omit to retain legacy DOM-order placement. Block addons enable auto-height layout. |
Control.render | ReactElement | function | — | Composes group behavior with another input-like control. |
Textarea props | TextareaProps | — | Native textarea props and an HTMLTextAreaElement ref. Inherits size and variant; Field supplies labels, descriptions, validation, and disabled state. |
Button.variant / size | ButtonVariant / sm | md | lg | ghost / sm | Compact action styling, independent of the group's single-line height. Supports Button loading and native props; type defaults to button. |
Button.render | ReactElement | function | — | Composes a button-compatible control without an extra interactive wrapper. |
Text props | HTMLAttributes<HTMLSpanElement> | — | Non-interactive helper text, units, counts, or icons with native span props and ref. |
className | string | — | Each part accepts custom styling. Root native div props and ref remain available; Input is an alias of Control. |
native props | React.HTMLAttributes<HTMLDivElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”InputGroup exposes a visual group but does not replace a field label. Use Field.Label or provide the control with an accessible name. Keep input-first DOM order for aligned layouts, and label icon-only buttons with aria-label. Addons are not focusable unless they contain an interactive control.
Use native input and textarea props for required fields, read-only content, and form submission. A disabled input does not automatically disable independent addon buttons. Keyboard hints are descriptive only; register any shortcut behavior in the owning application.