Skip to content

React

Prop Type Description Required
label string Label for the chip ✅
size Size Defines the size of the chip
className ClassValue Custom classNames you want to apply on the chip button
isSelected boolean Indicates if the chip is currently selected
leadingIcon ToyotaIcon | LexusIcon Icon displayed before the text
trailingIcon ToyotaIcon | LexusIcon Icon displayed after the text
dropdown ChipDropdown Custom settings for dropdown
Prop Type Description Required
options ChipDropdownOption[] Options shown in the dropdown ✅
clearAllLabel string Label for the clear button
onApply (value: string[]) => void Called with selected values on apply
applyLabel (count: number) => string Label for the apply button, based on count

Each option in the options array follows this shape:

Prop Type Description Required
label string Text shown for the option ✅
value string Value for the option ✅
import { Chip } from '@tmedxp/react-components';
const ChipExample = () => {
return <Chip label="Label" />;
};
export { ChipExample };
import { Chip } from '@tmedxp/react-components';
const ChipDropDownExample = () => {
return (
<Chip
label="Label"
dropdown={{
options: [
{ label: 'Option 1', value: '1' },
{ label: 'Option 2', value: '2' },
{ label: 'Option 3', value: '3' },
],
clearAllLabel: 'Clear all',
applyLabel: (count) =>
count ? `Show ${count} results` : 'Show results',
}}
/>
);
};
export { ChipDropDownExample };