Skip to main content

Chips

The TkChip component is basically a simple UI block entity, representing for example more advanced underlying data, such as a contact, in a compact way. Chips can contain entities such as an avatar, text or an icon, optionally having a pointer too.

import { TkChips } from '@takeoff-ui/react'

Variant​

The variant of the chips for styling.

View Code
<TkChips variant="primary" label="primary" removable />
<TkChips variant="secondary" label="secondary" removable />
<TkChips variant="neutral" label="neutral" removable />
<TkChips variant="info" label="info" removable />
<TkChips variant="warning" label="warning" removable />
<TkChips variant="success" label="success" removable />
<TkChips variant="danger" label="danger" removable />
<TkChips variant="verified" label="verified" removable />

Type​

This field specifies the design type of the component. "filled", "filledlight", "outlined" designs are available

View Code
<TkChips variant="primary" type="filled" label="primary" />
<TkChips variant="primary" type="filledlight" label="primary" />
<TkChips variant="primary" type="outlined" label="primary" />

Size​

The "size" prop can be used with one of the sizes "small", "base", and "large". The default value is "base".

View Code
<TkChips variant="primary" size="small" label="primary" removable />
<TkChips variant="primary" size="base" label="primary" removable />
<TkChips variant="primary" size="large" label="primary" removable />

Icon​

It can be used with icons. You should use Material Symbols icons.

View Code
<TkChips
variant="primary"
size="large"
icon="flight"
label="primary"
removable
/>

API​

Props​

NameTypeDefaultDescription
booleantrueDetermines whether the chip automatically removes itself when the close button is clicked.
booleanfalseThe disabled status.
IIconOptions, stringnullSpecifies a material icon name to be displayed.
stringnullThe label to display inside the chip.
booleanfalseThis property determines whether the chip component is removable.
"base", "large", "small"'base'Sets size for the component.
"avatar", "filled", "filledlight", "outlined"'filled'This field specifies the design type of the component.
anynullThe value of the chips
"danger", "info", "neutral", "primary", "secondary", "success", "verified", "warning"'primary'The variant of the chip for styling.

Events​

NameDescription
tk-removeWhen an element is deleted, it is triggered. It returns the label.

Interfaces​

interface IChipOptions {
label?: string;
icon?: string | IIconOptions;
type?: 'filled' | 'filledlight' | 'outlined' | 'avatar';
size?: 'large' | 'base' | 'small';
variant?: 'primary' | 'secondary' | 'neutral' | 'info' | 'success' | 'danger' | 'warning' | 'verified';
}