EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
Field·component·@astryxdesign/core

Input Group

Groups an input with prefix/suffix addons in a visually connected container with shared border and focus ring.

Open in Playground @astryxdesign/core/InputGroup

Showcases and examples

2 documented examples

Input Group

InputGroup API entry

Preview loads on approachPreview loads on approach
Exact source · input-group-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {useState} from 'react';
import {InputGroup, InputGroupText} from '@astryxdesign/core/InputGroup';
import {TextInput} from '@astryxdesign/core/TextInput';
import {Stack} from '@astryxdesign/core/Layout';

export default function InputGroupShowcase() {
  const [price, setPrice] = useState('');
  const [url, setUrl] = useState('');

  return (
    <Stack direction="vertical" gap={4} width="100%" style={{maxWidth: 400}}>
      <InputGroup label="Price">
        <InputGroupText>$</InputGroupText>
        <TextInput
          label="Amount"
          isLabelHidden
          value={price}
          onChange={setPrice}
          placeholder="0.00"
        />
      </InputGroup>
      <InputGroup label="Website">
        <InputGroupText>https://</InputGroupText>
        <TextInput
          label="URL"
          isLabelHidden
          value={url}
          onChange={setUrl}
          placeholder="example"
        />
        <InputGroupText>.com</InputGroupText>
      </InputGroup>
    </Stack>
  );
}

Usage

InputGroup connects an input with prefix/suffix addons in a single visual unit. Use it for URL fields, currency inputs, search fields with action buttons, or any input that needs contextual decorations.

Typed props

PropType and behavior
childrenReactNode · required
labelstring · required
Accessible label for the group.
isLabelHiddenboolean · default false
Visually hide the label.
descriptionstring
Helper text between label and input group.
isDisabledboolean · default false
Disable the entire group.
isOptionalboolean · default false
Show "(optional)" indicator.
isRequiredboolean · default false
Mark the field as required.
size'sm' | 'md' | 'lg' · default 'md'
Default size for inputs in the group.
status{type: 'warning' | 'error' | 'success', message?: string}
Status indicator applied to the group border.
labelTooltipstring
Tooltip text at the end of the label.
xstyleStyleXStyles
StyleX styles for layout customization.
data-testidstring
Test selector.

Anatomy

Label · required

Text above the group.

Prefix addon · optional

Content before the input (text, icon, or button).

Input · required

The main input element (TextInput, NumberInput, TimeInput, DateInput, Typeahead, Selector, or MultiSelector).

Suffix addon · optional

Content after the input (text, icon, or button).

Status message · optional

An error, warning, or success message below the group.

Theming

Targets

astryx-input-group

Visual props: size, status

astryx-input-group-text