InputGroup

InputGroup composes an Input with explicit inline addons without changing native form semantics.

Overview and decision boundary

Use InputGroup to place clear supporting inline content around one native Input without changing its responsibility.

Do not turn InputGroup into a search results, password visibility, date-picker, or formatting abstraction.

The prefix is visual context; the label names the control.

import { Field, Input, InputGroup, InputGroupAddon } from "@nerio-ui/ui";<Field label="Website">  <InputGroup>    <InputGroupAddon placement="start" aria-hidden="true">https://</InputGroupAddon>    <Input autoComplete="url" />    <InputGroupAddon placement="end" aria-hidden="true">.com</InputGroupAddon>  </InputGroup></Field>

Installation and imports

Install the editable registry source, or use the matching package entrypoint when the product keeps Nerio as a workspace dependency.

pnpm dlx nerio add input-groupimport { Input, InputGroup, InputGroupAddon } from '@nerio-ui/ui';

Usage

import { Input, InputGroup, InputGroupAddon } from '@nerio-ui/ui';<InputGroup><InputGroupAddon placement="start" aria-hidden="true">https://</InputGroupAddon><Input aria-label="Website" /><InputGroupAddon placement="end">.com</InputGroupAddon></InputGroup>

Variants

ModePurpose
startPlaces context before the native Input.
endPlaces context or one compact action after the native Input.
sm / md / lgAligns addons to the nested Input size.

Anatomy

SlotPurpose
input-groupShared tokenized surface that responds to the nested Input state.
inputThe direct native Input that retains form and accessibility semantics.
input-group-addonExplicit start or end content such as a decorative icon, prefix, suffix, or action.

States

StateBehavior
DefaultKeeps the Input and addons visually grouped.
Focus withinApplies the shared focus treatment when the nested Input is focused.
InvalidMirrors the nested Input invalid state without owning validation.
Disabled / read-onlyPreserves the nested Input native availability semantics.

Motion

  • Hover and focus-within use the shared tokenized Input motion contract.
  • Reduced motion preserves the state change without nonessential timing.

Accessibility

  • Preserves nested Input native semantics and forwards Field label, description, and invalid wiring to a direct Input child.
  • Use Field, Label, or aria-describedby to name and describe the control; text addons do not silently become its accessible name.
  • Decorative addon icons must be aria-hidden; interactive addon content remains independently keyboard accessible.

API

APIValuesPurpose
InputGroupdiv attributes and Field wiringOwns only grouped layout and state styling.
placementstart | endPositions an InputGroupAddon around the Input.
childrenReactNodeComposes one Input with explicit addons.

Implementation contract

ContractValue
Registry iteminput-group installs 6 source files into the configured components directory.
Base UINo interactive primitive required.
Registry dependenciesinput
Package dependenciesclsx, react, tailwind-merge, tailwindcss

Styling contract

ContractValue
AuthoringComplete, statically detectable Tailwind CSS v4 recipes own component visuals.
ValuesSemantic and component --n-* variables remain the canonical customization layer.
OverridesCustomizable slots merge consumer className values with tailwindCn so conflicting utilities resolve deterministically.
Residual CSSOnly shared keyframes and scoped no-Preflight compatibility rules remain; there is no parallel visual selector layer.

Design notes

  • InputGroup owns shared presentation, never value, parsing, validation, results, or asynchronous behavior.

Do / do not

Do

Use explicit Field, Label, or aria-describedby context and keep decorative addons hidden from assistive technology.

Do not

Move validation, search results, password visibility, parsing, or asynchronous behavior into InputGroup.

Tokens

These are the primary customization points. Override semantic or component tokens instead of changing component source.

TokenPurpose
--n-input-height-mdPublic customization point for this component contract.
--n-input-radiusPublic customization point for this component contract.
--n-input-backgroundPublic customization point for this component contract.
--n-input-background-hoverPublic customization point for this component contract.
--n-input-borderPublic customization point for this component contract.
--n-input-border-hoverPublic customization point for this component contract.
--n-input-border-focusPublic customization point for this component contract.
--n-input-border-dangerPublic customization point for this component contract.
--n-input-addon-foregroundPublic customization point for this component contract.
--n-input-addon-gapPublic customization point for this component contract.
--n-input-addon-padding-inlinePublic customization point for this component contract.
--n-focus-ringPublic customization point for this component contract.