Navigated to /docs/ui/components/input-group

InputGroup

Composed input with addons and inline action controls.

Preview

A live, theme-aware example rendered with the published component.

Loading preview…

Import

Import from the focused entry point below, or use the same named export from @tavojs/ui. Both are public APIs; measure the built application when comparing their bundle cost.

TSX
tsximport { InputGroup } from "@tavojs/ui/input-group";

The component import loads compiled component CSS. Enable tavoUi() for your project theme variables, or import @tavojs/ui/theme.css once for the package default theme. The equivalent CSS-safe component alias is @tavojs/ui/css/input-group.

When to use

Use it when

Use `InputGroup` for controls with prefixes, suffixes, or inline actions

Choose something else when

Avoid InputGroup when wrapping controls without labels or accessible names.

Examples

These examples include imports and local state where interaction requires it. Render the exported component in a page after completing UI installation. Demo state stays in the mounted component; connect file handling, persistence, and data loading to your application as needed.

InputGroup example

TSXCreate: src/components/examples/InputGroupExample1.tsx
tsximport { InputGroup } from "@tavojs/ui/input-group";

export function InputGroupExample1() {
  return (
    <>
      <InputGroup>
        <InputGroup.Addon>$</InputGroup.Addon>
        <InputGroup.Input name="amount" aria-label="Amount in dollars" placeholder="0.00" />
      </InputGroup>
    </>
  );
}

Common props and defaults

A curated starting point. The complete TypeScript API below includes additional props and compound member contracts.

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
sizeSize

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

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by InputGroup.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by InputGroup.

idstring

No

Inherited id attribute accepted by InputGroup.

rolestring

No

Inherited role attribute accepted by InputGroup.

styleRecord<string, unknown>

No

Inherited style attribute accepted by InputGroup.

titlestring

No

Inherited title attribute accepted by InputGroup.

tabIndexnumber

No

Inherited tabIndex attribute accepted by InputGroup.

hiddenboolean

No

Inherited hidden attribute accepted by InputGroup.

disabledboolean

No

Inherited disabled attribute accepted by InputGroup.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by InputGroup.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by InputGroup.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by InputGroup.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by InputGroup.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by InputGroup.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by InputGroup.

sizeSize

No

Configures size for this component.

InputGroupAddonProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by InputGroup.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by InputGroup.

idstring

No

Inherited id attribute accepted by InputGroup.

rolestring

No

Inherited role attribute accepted by InputGroup.

styleRecord<string, unknown>

No

Inherited style attribute accepted by InputGroup.

titlestring

No

Inherited title attribute accepted by InputGroup.

tabIndexnumber

No

Inherited tabIndex attribute accepted by InputGroup.

hiddenboolean

No

Inherited hidden attribute accepted by InputGroup.

disabledboolean

No

Inherited disabled attribute accepted by InputGroup.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by InputGroup.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by InputGroup.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by InputGroup.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by InputGroup.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by InputGroup.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by InputGroup.

position"start" | "end"

No

Inherited position attribute accepted by InputGroup.

InputGroupInputProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by InputGroup.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by InputGroup.

idstring

No

Inherited id attribute accepted by InputGroup.

rolestring

No

Inherited role attribute accepted by InputGroup.

styleRecord<string, unknown>

No

Inherited style attribute accepted by InputGroup.

titlestring

No

Inherited title attribute accepted by InputGroup.

tabIndexnumber

No

Inherited tabIndex attribute accepted by InputGroup.

hiddenboolean

No

Inherited hidden attribute accepted by InputGroup.

disabledboolean

No

Inherited disabled attribute accepted by InputGroup.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by InputGroup.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by InputGroup.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by InputGroup.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by InputGroup.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by InputGroup.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by InputGroup.

typestring

No

Inherited type attribute accepted by InputGroup.

namestring

No

Inherited name attribute accepted by InputGroup.

valuestring | number

No

Inherited value attribute accepted by InputGroup.

placeholderstring

No

Inherited placeholder attribute accepted by InputGroup.

requiredboolean

No

Inherited required attribute accepted by InputGroup.

readOnlyboolean

No

Inherited readOnly attribute accepted by InputGroup.

State ownership and DOM target

ConcernContract
StateNo component state contract is exposed; the application owns the rendered content and surrounding behavior.
DOM targetNative 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

ContractCurrent value
Maturitystable
Categoryforms
Component import@tavojs/ui/input-group
Explicit CSS import@tavojs/ui/css/input-group
PreviewInteractive preview available on this page