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.
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
Choose something else when
Examples
Chip example
tsximport { Chip } from "@tavojs/ui/chip";
export function ChipExample1() {
return (
<>
<Chip tone="primary" selected>Active</Chip>
</>
);
}Common props and defaults
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Optional class hook applied to the public root element owned by the component. |
as | string | Component<Record<string, unknown>> | — | Changes the rendered root element or component while preserving Tavo.js UI styling and public props. |
tone | Tone | — | Configures tone for this component. |
size | Size | — | Configures size for this component. |
selected | boolean | — | Configures selected for this component. |
disabled | boolean | — | Configures disabled for this component. |
Complete TypeScript API
Import from @tavojs/ui/chip. Published exports: Chip, ChipProps.
ChipProps
| Property | Type | Required | Description |
|---|---|---|---|
children | Child | No | Inherited children attribute accepted by Chip. |
className | string | No | Optional class hook applied to the public root element owned by the component. |
sx | Sx | No | Inherited sx attribute accepted by Chip. |
id | string | No | Inherited id attribute accepted by Chip. |
role | string | No | Inherited role attribute accepted by Chip. |
style | Record<string, unknown> | No | Inherited style attribute accepted by Chip. |
title | string | No | Inherited title attribute accepted by Chip. |
tabIndex | number | No | Inherited tabIndex attribute accepted by Chip. |
hidden | boolean | No | Inherited hidden attribute accepted by Chip. |
disabled | boolean | No | Configures disabled for this component. |
onClick | TavoEventHandler<MouseEvent> | No | Inherited onClick attribute accepted by Chip. |
onChange | TavoEventHandler<Event> | No | Inherited onChange attribute accepted by Chip. |
onInput | TavoEventHandler<Event> | No | Inherited onInput attribute accepted by Chip. |
onKeyDown | TavoEventHandler<KeyboardEvent> | No | Inherited onKeyDown attribute accepted by Chip. |
onFocus | TavoEventHandler<FocusEvent> | No | Inherited onFocus attribute accepted by Chip. |
onBlur | TavoEventHandler<FocusEvent> | No | Inherited onBlur attribute accepted by Chip. |
as | PolymorphicAs | No | Changes the rendered root element or component while preserving Tavo.js UI styling and public props. |
tone | Tone | No | Configures tone for this component. |
size | Size | No | Configures size for this component. |
selected | boolean | No | Configures selected for this component. |
removable | boolean | No | Inherited removable attribute accepted by Chip. |
removeLabel | string | No | Inherited removeLabel attribute accepted by Chip. |
onRemove | () => void | No | Inherited onRemove attribute accepted by Chip. |
leading | Child | No | Inherited leading attribute accepted by Chip. |
State ownership and DOM target
| Concern | Contract |
|---|---|
| State | Application controlled through selected and the matching callback. |
| DOM target | The public root follows the as/component prop. Root attributes, className, style, and supported events are forwarded there. |
Anatomy and related components
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
| Contract | Current value |
|---|---|
| Maturity | stable |
| Category | content |
| Component import | @tavojs/ui/chip |
| Explicit CSS import | @tavojs/ui/css/chip |
| Preview | Interactive preview available on this page |