InputGroup
Composed input with addons and inline action controls.
Preview
A live, theme-aware example rendered with the published component.
Loading preview…
Import
Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.
tsximport { InputGroup } from "@tavojs/ui/input-group";Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/input-group.
When to use
Use it when
Choose something else when
Examples
InputGroup example
tsximport { InputGroup } from "@tavojs/ui/input-group";
export function InputGroupExample1() {
return (
<>
<InputGroup>
<InputGroup.Addon>$</InputGroup.Addon>
<InputGroup.Input name="amount" placeholder="Amount" />
<InputGroup.Button>Apply</InputGroup.Button>
</InputGroup>
</>
);
}Common props and defaults
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Optional class hook applied to the public root element owned by the component. |
size | Size | — | Configures size for this component. |
Complete TypeScript API
Import from @tavojs/ui/input-group. Published exports: InputGroup, InputGroupAddon, InputGroupAddonProps, InputGroupButton, InputGroupInput, InputGroupInputProps, InputGroupProps, InputGroupRoot.
InputGroupProps
| Property | Type | Required | Description |
|---|---|---|---|
children | Child | No | Inherited children attribute accepted by InputGroup. |
className | string | No | Optional class hook applied to the public root element owned by the component. |
sx | Sx | No | Inherited sx attribute accepted by InputGroup. |
id | string | No | Inherited id attribute accepted by InputGroup. |
role | string | No | Inherited role attribute accepted by InputGroup. |
style | Record<string, unknown> | No | Inherited style attribute accepted by InputGroup. |
title | string | No | Inherited title attribute accepted by InputGroup. |
tabIndex | number | No | Inherited tabIndex attribute accepted by InputGroup. |
hidden | boolean | No | Inherited hidden attribute accepted by InputGroup. |
disabled | boolean | No | Inherited disabled attribute accepted by InputGroup. |
onClick | TavoEventHandler<MouseEvent> | No | Inherited onClick attribute accepted by InputGroup. |
onChange | TavoEventHandler<Event> | No | Inherited onChange attribute accepted by InputGroup. |
onInput | TavoEventHandler<Event> | No | Inherited onInput attribute accepted by InputGroup. |
onKeyDown | TavoEventHandler<KeyboardEvent> | No | Inherited onKeyDown attribute accepted by InputGroup. |
onFocus | TavoEventHandler<FocusEvent> | No | Inherited onFocus attribute accepted by InputGroup. |
onBlur | TavoEventHandler<FocusEvent> | No | Inherited onBlur attribute accepted by InputGroup. |
size | Size | No | Configures size for this component. |
InputGroupAddonProps
| Property | Type | Required | Description |
|---|---|---|---|
children | Child | No | Inherited children attribute accepted by InputGroup. |
className | string | No | Optional class hook applied to the public root element owned by the component. |
sx | Sx | No | Inherited sx attribute accepted by InputGroup. |
id | string | No | Inherited id attribute accepted by InputGroup. |
role | string | No | Inherited role attribute accepted by InputGroup. |
style | Record<string, unknown> | No | Inherited style attribute accepted by InputGroup. |
title | string | No | Inherited title attribute accepted by InputGroup. |
tabIndex | number | No | Inherited tabIndex attribute accepted by InputGroup. |
hidden | boolean | No | Inherited hidden attribute accepted by InputGroup. |
disabled | boolean | No | Inherited disabled attribute accepted by InputGroup. |
onClick | TavoEventHandler<MouseEvent> | No | Inherited onClick attribute accepted by InputGroup. |
onChange | TavoEventHandler<Event> | No | Inherited onChange attribute accepted by InputGroup. |
onInput | TavoEventHandler<Event> | No | Inherited onInput attribute accepted by InputGroup. |
onKeyDown | TavoEventHandler<KeyboardEvent> | No | Inherited onKeyDown attribute accepted by InputGroup. |
onFocus | TavoEventHandler<FocusEvent> | No | Inherited onFocus attribute accepted by InputGroup. |
onBlur | TavoEventHandler<FocusEvent> | No | Inherited onBlur attribute accepted by InputGroup. |
position | "start" | "end" | No | Inherited position attribute accepted by InputGroup. |
InputGroupInputProps
| Property | Type | Required | Description |
|---|---|---|---|
children | Child | No | Inherited children attribute accepted by InputGroup. |
className | string | No | Optional class hook applied to the public root element owned by the component. |
sx | Sx | No | Inherited sx attribute accepted by InputGroup. |
id | string | No | Inherited id attribute accepted by InputGroup. |
role | string | No | Inherited role attribute accepted by InputGroup. |
style | Record<string, unknown> | No | Inherited style attribute accepted by InputGroup. |
title | string | No | Inherited title attribute accepted by InputGroup. |
tabIndex | number | No | Inherited tabIndex attribute accepted by InputGroup. |
hidden | boolean | No | Inherited hidden attribute accepted by InputGroup. |
disabled | boolean | No | Inherited disabled attribute accepted by InputGroup. |
onClick | TavoEventHandler<MouseEvent> | No | Inherited onClick attribute accepted by InputGroup. |
onChange | TavoEventHandler<Event> | No | Inherited onChange attribute accepted by InputGroup. |
onInput | TavoEventHandler<Event> | No | Inherited onInput attribute accepted by InputGroup. |
onKeyDown | TavoEventHandler<KeyboardEvent> | No | Inherited onKeyDown attribute accepted by InputGroup. |
onFocus | TavoEventHandler<FocusEvent> | No | Inherited onFocus attribute accepted by InputGroup. |
onBlur | TavoEventHandler<FocusEvent> | No | Inherited onBlur attribute accepted by InputGroup. |
type | string | No | Inherited type attribute accepted by InputGroup. |
name | string | No | Inherited name attribute accepted by InputGroup. |
value | string | number | No | Inherited value attribute accepted by InputGroup. |
placeholder | string | No | Inherited placeholder attribute accepted by InputGroup. |
required | boolean | No | Inherited required attribute accepted by InputGroup. |
readOnly | boolean | No | Inherited readOnly attribute accepted by InputGroup. |
State ownership and DOM target
| Concern | Contract |
|---|---|
| State | No component state contract is exposed; the application owns the rendered content and surrounding behavior. |
| DOM target | Native input attributes target the owned form control; wrapper-specific props stay on the documented component root. |
Anatomy and related components
Public compound members: Root, Addon, Input, Button
Limitations
Avoid InputGroup when wrapping controls without labels or accessible names.
Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.
Accessibility
Form components pass through native attributes and should be paired with visible labels or accessible names.
Use Field, FormLabel, FormControlLabel, or aria-label for labeling.
Preserve native input semantics whenever possible.
Expose validation with error text and aria-invalid where relevant.
Component status
| Contract | Current value |
|---|---|
| Maturity | stable |
| Category | forms |
| Component import | @tavojs/ui/input-group |
| Explicit CSS import | @tavojs/ui/css/input-group |
| Preview | Interactive preview available on this page |