Skip to main content

Chip

A compact, pressable label used for selection, filtering, or tagging, with optional selected state and remove action.

Selectable

<Chip label="Selected" isSelected onPress={() => {}} />
<Chip label="Unselected" onPress={() => {}} />
<Chip label="Disabled" isDisabled onPress={() => {}} />

Removable

React
TypeScript
<Chip label="React" isSelected onRemove={() => {}} />
<Chip label="TypeScript" isSelected onRemove={() => {}} />

Custom remove icon

By default the remove button shows a plain ✕ glyph. Pass removeIcon to use a real icon instead: any component matching TVajraIconComponent.

React
import { XIcon } from '@devraj-labs/vajra-ui-icons';

<Chip label="React" isSelected onRemove={() => {}} removeIcon={XIcon} />

Custom colors

<Chip
label="Custom"
isSelected
selectedBg="success"
selectedColor="textInverse"
onPress={() => {}}
/>

Props

PropTypeDefaultDescription
labelstringRequired. Chip text.
isSelectedbooleanfalseToggles between selected and unselected color scheme.
onPress() => voidWhen provided, makes the chip pressable.
onRemove() => voidWhen provided, renders a remove (✕) button.
removeIconTVajraIconComponentIcon shown in the remove button, when onRemove is set. Defaults to a plain ✕ glyph.
isDisabledbooleanfalseDisables press interactions and dims opacity.
selectedBgTVajraColors'primary'Background color when selected.
selectedColorTVajraColors'textInverse'Text/icon color when selected.
unselectedBgTVajraColors'surfaceRaised'Background color when not selected.
unselectedColorTVajraColors'text'Text/icon color when not selected.
testIDstringTest identifier forwarded to the root container.