Navigated to /docs/ui/components/chip

Chip

Compact selected, filter, or metadata token.

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.

TSX
tsximport { Chip } from "@tavojs/ui/chip";

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/chip.

When to use

Use it when

Use `Chip` for selectable-looking tags, filters, and compact tokens

Choose something else when

Avoid Chip when replacing interactive controls with content-only components.

Examples

Chip example

TSX
tsximport { Chip } from "@tavojs/ui/chip";

export function ChipExample1() {
  return (
    <>
      <Chip tone="primary" selected>Active</Chip>
    </>
  );
}

Common props and defaults

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
asstring | Component<Record<string, unknown>>

Changes the rendered root element or component while preserving Tavo.js UI styling and public props.
toneTone

Configures tone for this component.
sizeSize

Configures size for this component.
selectedboolean

Configures selected for this component.
disabledboolean

Configures disabled for this component.

Complete TypeScript API

Import from @tavojs/ui/chip. Published exports: Chip, ChipProps.

ChipProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by Chip.

classNamestring

No

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

sxSx

No

Inherited sx attribute accepted by Chip.

idstring

No

Inherited id attribute accepted by Chip.

rolestring

No

Inherited role attribute accepted by Chip.

styleRecord<string, unknown>

No

Inherited style attribute accepted by Chip.

titlestring

No

Inherited title attribute accepted by Chip.

tabIndexnumber

No

Inherited tabIndex attribute accepted by Chip.

hiddenboolean

No

Inherited hidden attribute accepted by Chip.

disabledboolean

No

Configures disabled for this component.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by Chip.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by Chip.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by Chip.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by Chip.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by Chip.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by Chip.

asPolymorphicAs

No

Changes the rendered root element or component while preserving Tavo.js UI styling and public props.

toneTone

No

Configures tone for this component.

sizeSize

No

Configures size for this component.

selectedboolean

No

Configures selected for this component.

removableboolean

No

Inherited removable attribute accepted by Chip.

removeLabelstring

No

Inherited removeLabel attribute accepted by Chip.

onRemove() => void

No

Inherited onRemove attribute accepted by Chip.

leadingChild

No

Inherited leading attribute accepted by Chip.

State ownership and DOM target

ConcernContract
StateApplication controlled through selected and the matching callback.
DOM targetThe public root follows the as/component prop. Root attributes, className, style, and supported events are forwarded there.

Anatomy and related components

This component exposes one public component root rather than a compound member API.

Limitations

Avoid Chip when replacing interactive controls with content-only components.

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

Content components should keep meaningful text and media alternatives available to assistive technology.

  • Provide alt text for meaningful images.

  • Use semantic text variants for headings and paragraphs.

  • Do not hide essential content visually unless VisuallyHidden is intentional.

Component status

ContractCurrent value
Maturitystable
Categorycontent
Component import@tavojs/ui/chip
Explicit CSS import@tavojs/ui/css/chip
PreviewInteractive preview available on this page