Flutter docs
Default skin

Tag

Used for marking and categorization.

When to use

  • It can be used to tag by dimension or property.

  • When categorizing.

Examples

Basic

Usage of basic Tag, and it could be closable and customize close button by set closeIcon property, will display default close button when closeIcon is setting to true. Closable Tag supports onClose events.

Add & Remove Dynamically

Generating a set of Tags by array, you can add and remove dynamically.

Animate

Animating the Tag by using motion.

Status Tag

We preset five different colors, you can set color property such as success,processing,error,default and warning to indicate specific status.

Custom semantic dom styling

You can customize the semantic dom style of Tag by passing objects/functions through classNames and styles.

Colorful Tag

We preset a series of colorful tag styles for use in different situations. You can also set it to a hex color string for custom color.

Checkable

CheckableTag works like Checkbox, click it to toggle checked state. CheckableTagGroup provides function that is similar to CheckboxGroup or RadioGroup. > CheckableTag is absolute controlled component and has no uncontrolled mode.

Icon

You can add a custom icon to the tag via the icon prop. Note that the icon prop for CheckableTag is only supported in version >=5.27.0. If you need to control the icon position, please use the <XXXIcon /> component directly in children instead of the icon prop. icon also accepts a bare <svg> element from a third-party icon library. It stays vertically centred with the label whether it is sized in em or in px.

Draggable Tag

Draggable tags using dnd kit.

API

Tag and Tag.CheckableTag are exported from @ceebee/ui/client.

Tag

PropertyDescriptionTypeDefaultVersion
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-—
closeIconCustom close icon. 5.7.0: close button will be hidden when setting to null or falseReactNodefalse4.4.0
colorColor of the Tagstringdefault when variant="solid"solid default color: 6.4.0
disabledWhether the tag is disabledbooleanfalse6.0.0
hrefThe address to jump when clicking, when this property is specified, the tag component will be rendered as an <a> tagstring-6.0.0
iconSet the icon of tagReactNode-—
onCloseCallback executed when tag is closed (can be prevented by e.preventDefault())(e: React.MouseEvent<HTMLElement, MouseEvent>) => void-—
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-—
targetSame as target attribute of a, works when href is specifiedstring-6.0.0
variantVariant of the tag'filled' | 'solid' | 'outlined''filled'6.0.0
borderedWhether has border style, please use variant="filled" insteadbooleantrue-

Tag.CheckableTag

PropertyDescriptionTypeDefaultVersion
checkedChecked status of Tagbooleanfalse—
iconSet the icon of tagReactNode-5.27.0
onChangeCallback executed when Tag is checked/unchecked(checked) => void-—

Tag.CheckableTagGroup

PropertyDescriptionTypeDefaultVersion
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props }) => Record<SemanticDOM, string>-—
defaultValueInitial valuestring | number | Array<string | number> | null-—
disabledDisable check/uncheckboolean-—
multipleMultiple select modeboolean-—
optionsOption list. Object options support per-item className and style.Array<{ className?: string; label: ReactNode; style?: CSSProperties; value: string | number } | string | number>-className and style: 6.4.0
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props }) => Record<SemanticDOM, CSSProperties>-—
valueValue of checked tag(s)string | number | Array<string | number> | null-—
onChangeCallback when Tag is checked/unchecked(value: string | number | Array<string | number> | null) => void-—