Skip to content

InputGroup

Groups multiple inputs into a single visually connected row.

Website
https://
.com
<InputGroup {...args}>
<InputGroupText>https://</InputGroupText>
<TextInput
isLabelHidden
label="URL"
onChange={setValue}
placeholder="example"
value={value}
/>
<InputGroupText>.com</InputGroupText>
</InputGroup>
Price
$
USD
<InputGroup {...args}>
<InputGroupText>$</InputGroupText>
<NumberInput
hasClear
isLabelHidden
label="Amount"
min={0}
onChange={setValue}
value={value}
/>
<InputGroupText>USD</InputGroupText>
</InputGroup>
WebsiteEnter a complete website host name.
https://
<InputGroup {...args}>
<InputGroupText>https://</InputGroupText>
<TextInput
isLabelHidden
label="URL"
onChange={setValue}
value={value}
/>
</InputGroup>
Website
https://
.com
<InputGroup {...args}>
<InputGroupText>https://</InputGroupText>
<TextInput
isLabelHidden
label="URL"
onChange={() => {}}
value="example"
/>
<InputGroupText>.com</InputGroupText>
</InputGroup>
Size sm
https://
.com
Size md
https://
.com
Size lg
https://
.com
<div style={{display: 'flex', flexDirection: 'column', gap: 16}}>
{(['sm', 'md', 'lg'] as const).map(size => (
<InputGroup key={size} label={`Size ${size}`} size={size}>
<InputGroupText>https://</InputGroupText>
<TextInput
isLabelHidden
label="URL"
onChange={() => {}}
placeholder="example"
value=""
/>
<InputGroupText>.com</InputGroupText>
</InputGroup>
))}
</div>
WebsiteRequired
https://
<InputGroup {...args}>
<InputGroupText>https://</InputGroupText>
<TextInput
isLabelHidden
label="URL"
onChange={setValue}
placeholder="example"
value={value}
/>
</InputGroup>
WebsiteOptional
https://
<InputGroup {...args}>
<InputGroupText>https://</InputGroupText>
<TextInput
isLabelHidden
label="URL"
onChange={setValue}
placeholder="example"
value={value}
/>
</InputGroup>
Website
https://
.com
<InputGroup {...args}>
<InputGroupText>https://</InputGroupText>
<TextInput
isLabelHidden
label="URL"
onChange={setValue}
placeholder="example"
value={value}
/>
<InputGroupText>.com</InputGroupText>
</InputGroup>
Website
https://
<InputGroup {...args}>
<InputGroupText>https://</InputGroupText>
<TextInput
isLabelHidden
label="URL"
onChange={setValue}
placeholder="example"
value={value}
/>
</InputGroup>
Date range
to
<InputGroup {...args}>
<TextInput
isLabelHidden
label="Start date"
onChange={setStart}
placeholder="Start"
value={start}
/>
<InputGroupText>to</InputGroupText>
<TextInput
isLabelHidden
label="End date"
onChange={setEnd}
placeholder="End"
value={end}
/>
</InputGroup>

Groups multiple inputs into a single visually connected row.

When isOptional: false, isRequired: false

PropTypeDefaultDescription
children*ReactNodeGrouped input children to render side-by-side.
classNamestringAdditional CSS class names applied to the group wrapper.
data-testidstringTest ID applied to the group wrapper.
descriptionReactNodeSupporting text displayed below the label.
isDisabledbooleanfalseWhether all grouped inputs are disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*stringLabel text for the input group.
labelTooltipReactNodeTooltip content shown next to the label.
refRef<HTMLDivElement>Ref forwarded to the group wrapper.
size"sm" | "md" | "lg"'md'Visual size applied to the group.
statusInputStatusValidation status displayed below the group.
styleCSSPropertiesInline styles applied to the group wrapper.
isOptionalfalse
isRequiredfalse

When isOptional: true, isRequired: false

PropTypeDefaultDescription
children*ReactNodeGrouped input children to render side-by-side.
classNamestringAdditional CSS class names applied to the group wrapper.
data-testidstringTest ID applied to the group wrapper.
descriptionReactNodeSupporting text displayed below the label.
isDisabledbooleanfalseWhether all grouped inputs are disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*stringLabel text for the input group.
labelTooltipReactNodeTooltip content shown next to the label.
refRef<HTMLDivElement>Ref forwarded to the group wrapper.
size"sm" | "md" | "lg"'md'Visual size applied to the group.
statusInputStatusValidation status displayed below the group.
styleCSSPropertiesInline styles applied to the group wrapper.
isOptional*true
isRequiredfalse

When isOptional: false, isRequired: true

PropTypeDefaultDescription
children*ReactNodeGrouped input children to render side-by-side.
classNamestringAdditional CSS class names applied to the group wrapper.
data-testidstringTest ID applied to the group wrapper.
descriptionReactNodeSupporting text displayed below the label.
isDisabledbooleanfalseWhether all grouped inputs are disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*stringLabel text for the input group.
labelTooltipReactNodeTooltip content shown next to the label.
refRef<HTMLDivElement>Ref forwarded to the group wrapper.
size"sm" | "md" | "lg"'md'Visual size applied to the group.
statusInputStatusValidation status displayed below the group.
styleCSSPropertiesInline styles applied to the group wrapper.
isOptionalfalse
isRequired*true
PropTypeDefaultDescription
children*ReactNode
classNamestring
data-testidstring
refRef<HTMLDivElement>
styleCSSProperties