Code

API

You can import the interfaces that are used for the onRemove and onChange.This component extends the native <div>arrow-up-right API. That's why the className prop is not included in the table.

Props
Type
Required

children

ReactNode

βœ…

value

string

❌

isRemovable

boolean

❌

isSelectable

boolean

❌

characterLimit

number

❌

tooltipPosition

'top' | 'bottom' | 'right' | 'left';

❌

checked

boolean

❌

defaultChecked

boolean

❌

onRemove

(e: TagRemoveEventProps) => void;

❌

onChange

(e: TagChangeEventProps) => void; }

❌

chevron-rightchildrenhashtag

The children can be a string, an HTML element or even a Tag.Avatar without the need to install the Avatar component as a dependency.

chevron-rightvaluehashtag

Used to have a controlled way of using the Tag component.

chevron-rightisRemovable and isSelectablehashtag

Capability of removing and selecting the Tag.

chevron-rightcharacterLimithashtag

The character limit used to constrain the string passed as child. If the string passed surpassed the characterLimit value,a tooltip is rendered. The default value is 15.

chevron-rightcheckedhashtag

Use when having a controlled state of the tags.

chevron-rightdefaultCheckedhashtag

Use to change the checked state in an uncontrolled way.

chevron-rightonRemove and onChangehashtag

The methods that are triggered when the Tag is removed/state changes.

Example

Last updated