EXEPERTAI LAB

Research alpha

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

Input Group Text

A prefix or suffix text element rendered inside InputGroup. Displays text or icons.

Open in Playground @astryxdesign/core/InputGroup

Showcases and examples

2 documented examples · Context from Input Group

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

A prefix or suffix text element rendered inside InputGroup. Displays text or icons.

Typed props

PropType and behavior
childrenReactNode · required
Text or icon content.
xstyleStyleXStyles
StyleX styles for customization.
classNamestring
CSS class name(s).
styleReact.CSSProperties
Inline styles.