Tag

Used to manage related options.

Tags help users explore, filter, or manage related options in a compact and accessible format. They are arranged in a container where they can be interacted with as a group. Tag groups are commonly used in search interfaces, content management systems, or anywhere users need to explore, refine, or manage categories and topics.

Anatomy

A tag group consists of a group label, a field label, individual tags with tag labels, and optional remove buttons for each tag.

Anatomy of a tag

Appearance

The appearance of a component can be customized using the variant and size props. These props adjust the visual style and dimensions of the component, available values are based on the active theme.

Variant
Size
The selected theme does not has any options for "variant" and "size".
Audience type
Families
Couples
Students
Seniors
Tourists
PropertyTypeDescription
variant-The available variants of this component.
size-The available sizes of this component.

Usage

Tags are best used to help users explore, filter, or manage related options in a clear and compact format. They work well in interfaces where users need to select from a list of categories, refine content through filters, or manage applied labels such as interests, skills, or topics.

Because tags are small, lightweight, and easily scannable, they support quick decision-making and reduce visual noise. Use them when grouping semantically similar items, especially in forms, search experiences, or when summarizing user-defined inputs like selected filters or preferences.

Selection modes

Tag groups support single or multiple selection to match different interaction needs. Use single selection when users need to make a clear and exclusive choice, such as selecting a format or category. Use multiple selection when users are refining results, customizing preferences, or filtering a list based on several criteria.

Ticket type
Standard
VIP
Student
Senior
Interests
Music
Theater
Comedy
Workshops
Food & Drink

Content and labeling

Tag labels should be concise, typically under 20 characters, to keep them easily scannable and prevent visual clutter. Keep the total number of tags manageable, generally no more than 8 to 10 at once, to avoid overwhelming users.

Use sentence case and avoid unnecessary words or filler to maintain a consistent and clear labeling style. Each tag should be descriptive and specific to avoid ambiguity and help users quickly understand the meaning or purpose of the tag in context.

Do
Use labels that are short, specific, and consistently formatted.

Use labels that are short, specific, and consistently formatted.

Don't
Dont use less than three options

Avoid inconsistent casing, vague or lengthy labels, and hard-to-scan text.

Interactive vs static

Tags should not be used to display the status of an object or to highlight newly added content, as these are static indicators that do not require user interaction. Use the badge component instead.

Tags are interactive elements intended for selection, filtering, or removal, whereas badges are static indicators meant to convey status or highlight new or updated items. Use badges when the information should be visible but not acted upon, and tags when the user needs to interact with or manage the content.

Removable tags

Removable tags are ideal when users need to manage selected filters, categories, or input tokens. Use them when the tag represents user-generated or user-controlled content that may need to be revised or undone.

Applied filters
Category: Live music
Location: Berlin
Date: This weekend
Setting: Outdoor

Props

Did you know? You can explore, test, and customize props live in Marigold's storybook. Watch the effects they have in real-time!

Tag

children?
ReactNode;
The children of the component. A function may be provided to alter the children based on component state.
disabled?
boolean;
download?
string | boolean;
Causes the browser to download the linked URL. A string may be provided to suggest a file name. See MDN.
href?
string;
A URL to link to. See MDN.
hrefLang?
string;
Hints at the human language of the linked URL. SeeMDN.
id?
Key;
A unique id for the tag.
onHoverChange?
(isHovering: boolean) => void;
Handler that is called when the hover state changes.
onHoverEnd?
(e: HoverEvent) => void;
Handler that is called when a hover interaction ends.
onHoverStart?
(e: HoverEvent) => void;
Handler that is called when a hover interaction starts.
ping?
string;
A space-separated list of URLs to ping when the link is followed. See MDN.
referrerPolicy?
HTMLAttributeReferrerPolicy;
How much of the referrer to send when following the link. See MDN.
rel?
string;
The relationship between the linked resource and the current page. See MDN.
routerOptions?
undefined;
Options for the configured client side router.
target?
HTMLAttributeAnchorTarget;
The target window for the link. See MDN.
textValue?
string;
A string representation of the tags's contents, used for accessibility. Required if children is not a plain text string.

Tag.Group

aria-describedby?
string;
Identifies the element (or elements) that describes the object.
aria-details?
string;
Identifies the element (or elements) that provide a detailed, extended description for the object.
aria-label?
string;
Defines a string value that labels the current element.
aria-labelledby?
string;
Identifies the element (or elements) that labels the current element.
children?
ReactNode | ((item: object) => ReactNode);
The contents of the collection.
defaultSelectedKeys?
Iterable<Key> | "all";
The initial selected keys in the collection (uncontrolled).
description?
ReactNode;
A helpful text.
disabledKeys?
Iterable<Key>;
The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.
disallowEmptySelection?
boolean;
Whether the collection allows empty selection.
emptyState?
(props: TagListRenderProps) => ReactNode;
Provides content to display when there are no items in the tag list.
id?
string;
The element's unique identifier. See MDN.
items?
Iterable<object>;
Item objects in the collection.
label?
ReactNode;
Specifies the label of the field.
name?
string;
The name of the field, used when submitting form data.
onRemove?
(keys: Set<Key>) => void;
Handler that is called when a user deletes a tag.
onSelectionChange?
(keys: Selection) => void;
Handler that is called when the selection changes.
selectedKeys?
Iterable<Key> | "all";
The currently selected keys in the collection (controlled).
selectionBehavior?
SelectionBehavior;
How multiple selection should behave in the collection.
selectionMode?
SelectionMode;
The type of selection that is allowed in the collection.
shouldSelectOnPressUp?
boolean;
Whether selection should occur on press up instead of press down.
slot?
string | null;
A slot name for the component. Slots allow the component to receive props from a parent component. An explicit null value indicates that the local props completely override all props received from a parent.
width?
WidthProp;
Sets the width of the field. You can see allowed tokens here: https://tailwindcss.com/docs/width
Defaults to:
"full"

Alternative components

  • Badge: Small indicator often used to show a status, count, or notification on another UI element. It is not interactive like a Tag and used for highlighting statuses.

  • Checkbox: Used when users need to select one or more options from a list in a form-like setting. Better suited than tags for structured input fields where persistent visibility of all choices is important.

  • Radio: Ideal for mutually exclusive choices, especially in forms or settings. Prefer over tags when the focus is on making a single clear decision with labeled options.

  • Select: Suitable for selecting one or more options from a longer or dynamic list. Use instead of tags when space is limited or when the list of options is too long to display at once.

Last update: 7 minutes ago