Chip

The Chip component displays small, contextual messages or notifications. It supports icons and floating positions.

Usage

Default

<Chip id="default" message="This is a chip message!" visible={visible} usePortal onClose={...} />

Props

Data table
TypeDescription
autoClosebooleanWhether the chip should close automatically after a delay.
classNamestringAdditional class name for custom styling.
closeButtonAriaLabelstringCustom accessible label for the close button. Defaults to "Close notification".
data-testidstringOptional test ID for testing frameworks.
durationnumberTime in milliseconds before auto-closing (default: 3000).
iconElementTypeOptional icon component to show on the left side.
iconAriaLabelstringAccessible label for the leading icon when it is not decorative.
iconDecorativebooleanWhether the leading icon is decorative. When true, it will be hidden from assistive technology. Defaults to true.
idstringOptional unique ID for the chip.
messagestringMessage text to display inside the chip.
messageIdstringOptional ID for the message element. If omitted, a stable fallback based on testId/id is used.
onClose(() => void)Callback when the chip is closed manually or automatically.
positionPositionTypePosition of the chip on the screen ('topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight').
role"none" | "alert" | "log" | "presentation" | "status"ARIA role for the chip container. Defaults to "alert".
roundingRoundingTypeRounding style for the chip ('none' | 'small' | 'medium' | 'large' | 'full').
shadowShadowTypeShadow style for the chip ('none' | 'light' | 'medium' | 'strong' | 'intense').
sizeSizeTypeSize of the chip ('xs' | 'small' | 'medium' | 'large' | 'xl').
stackIndexnumberIndex for stacking multiple chips, useful for z-index logic.
stateStateTypeState of the chip ('success' | 'error' | 'warning' | 'disabled' | '').
themeThemeTypeTheme color for the chip ('primary' | 'secondary' | 'tertiary' | 'quaternary' | 'clear').
usePortalbooleanWhether to use a portal for rendering the chip.
visiblebooleanWhether the chip is currently visible.