About
Groups an input with prefix and suffix addons in one connected row. A focused member stays above its neighbours, so its focus ring shows in full. Astryx by Meta. Source: https://astryx.atmeta.com/components/InputGroup
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Input Group to your project and fits it to your theme.
Code
How Astryx Input Group is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
'use client';
/* Copyright (c) 2026 Meta Platforms, Inc. See the MIT notice in astryx-input-group.tsx. */
import '@/components/ui/astryx-input-group-utils/astryx-preview.css';
import '@astryxdesign/theme-neutral/fonts.css';
import {useSyncExternalStore} from 'react';
import {Theme} from '@astryxdesign/core/theme';
import {neutralTheme} from '@astryxdesign/theme-neutral/built';
import {useState} from 'react';
import {InputGroup, InputGroupText} from '@/components/ui/astryx-input-group';
import {TextInput} from '@astryxdesign/core/TextInput';
import {Stack} from '@astryxdesign/core/Layout';
function OfficialSample() {
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>
);
}
function readPreviewMode() {
const {classList} = document.documentElement;
return classList.contains('dark') ? 'dark' : 'light';
}
function subscribeToPreviewMode(callback: () => void) {
const observer = new MutationObserver(callback);
observer.observe(document.documentElement, {attributes: true, attributeFilter: ['class']});
return () => observer.disconnect();
}
export default function Demo() {
const mode = useSyncExternalStore(subscribeToPreviewMode, readPreviewMode, () => 'light' as const);
return (
<Theme theme={neutralTheme} mode={mode}>
<div className="astryx-demo">
<div className="astryx-demo-content" data-centered style={{maxWidth: 400}}>
<OfficialSample />
</div>
</div>
</Theme>
);
}















