InputGroup
Composition container for inputs with addons, icons, and buttons. Distributes
size/radius/disabled to its children via context, and inherits invalid state
from an ancestor Field unless hasError is set explicitly.
Import from "@instruments/materia-ui/components/input-group".
Usage
Best practices
Compose with the
InputGroup*parts (InputGroupInput,InputGroupIcon,InputGroupAddon,InputGroupButton) - a raw<input>won't receive the shared size/radius/disabled context.Set
size/radius/disabledonce onInputGroup; children inherit them via context, so don't re-set them per child.Inside a
Fieldthe group inherits invalid state and itsInputGroupInput/InputGroupTextareabecomes the field's control (labelled, described,aria-invalid) - passhasErroronly to force error styling andaria-invalidindependently.
Props
InputGroup
InputGroupAddon
InputGroupButton
InputGroupIcon
InputGroupInput
InputGroupTextarea
Also exports
- type
InputGroupAddonAlign - const
inputGroupAddonMutedVariants - type
InputGroupAddonVariant - const
inputGroupAnatomy - component
InputGroupContext - const
inputGroupControlVariants - type
InputGroupSize - const
inputGroupSizeToButtonSize - const
inputGroupSizeToIconSize - const
inputGroupVariants - const
useInputGroup - const
useOptionalInputGroup
Anatomy
Composition
Used by