Tag
A Tag is a compact visual indicator used to represent status, category, or metadata associated with an element. It helps users quickly scan, identify, or filter information in an interface.
Use this component when you need to communicate contextual information such as system state, item classification, or feedback message type.
Common alternative names:
Status Pill, Badge Label, Indicator
Variants
Section titled “Variants”Default tag style.
Tag( label: 'Default',)Success
Section titled “Success”Tag with success styling.
Tag( label: 'Success', type: BadgeType.success,)Warning
Section titled “Warning”Tag with warning styling.
Tag( label: 'Warning', type: BadgeType.warning,)Tag with error styling.
Tag( label: 'Error', type: BadgeType.error,)Tag with info styling.
Tag( label: 'Info', type: BadgeType.info,)Tag with Icon
Section titled “Tag with Icon”Tag including an icon alongside the label.
Tag( label: 'With Icon', type: BadgeType.success, icon: Padding( padding: const EdgeInsets.only(right: 5), child: Icon( Icons.circle_outlined, color: BadgeType.success.fgColor(context), ), ),)Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
label | String | Required. The text to display in the badge. |
padding | EdgeInsetsGeometry? | Custom padding for the badge content. Default: horizontal: 8, vertical: 5 |
offset | Offset? | Position offset for the badge when used with a child widget. |
backgroundColor | Color? | Custom background color. If not provided, uses the type’s default color. |
textColor | Color? | Custom text color. If not provided, uses the type’s default color. |
textStyle | TextStyle? | Custom text style. |
alignment | AlignmentGeometry? | Alignment of the badge when used with a child widget. |
child | Widget? | Optional child widget that the badge will be attached to. |
icon | Widget? | Optional icon to display before the label text. |