Analytics

We measure which pages get used so we can improve the documentation. No cookies, no cross-site tracking. See our privacy notice.

Marigold
v18.2.0
Marigold
v18.2.0

Application

MarigoldProvider
RouterProvider

Layout

AppShellbeta
Aside
Aspect
Center
Columns
Container
Grid
Inline
Inset
OverflowRegionbeta
Pagebeta
Panelbeta
Scrollable
Split
Stack
Tiles

Actions

Buttonupdated
ButtonGroupbeta
Link
LinkButton
ToggleButtonbeta

Form

Autocomplete
Calendar
Checkbox
ComboBox
DateField
DatePicker
DateRangePickerbeta
FileField
Form
NumberField
Radio
RangeCalendaralpha
SearchField
SegmentedControlbeta
Select
SelectListupdated
Slider
Switchupdated
TagFieldbeta
TextArea
TextField
TimeField

Collection

Cardupdated
Table
ListViewbeta
Tag
ActionBaralpha

Navigation

Accordion
Breadcrumbs
Pagination
Sidebarbeta
Stepperbeta
Tabs
TopNavigationbeta

Overlay

ActionMenualpha
ContextualHelp
Dialog
Drawer
Menuupdated
Toastbeta
Tooltip

Content

Badge
Descriptionalpha
Divider
EmptyState
ErrorStatebeta
Headline
Keyboardbeta
List
Loader
SectionMessage
SVG
Text
TextValuealpha
Titlealpha

Formatters

DateFormat
NumericFormat

Hooks and Utils

cn
cva
extendTheme
parseFormData
useAsyncList
useLandmark
useListData
useTheme
VisuallyHidden
Components

Badge

Component for short notes with one color as status messages

A <Badge> is a content component. This component can be used to reflect status messages via a short note and a color.

Anatomy

It consists of a container and the content can either be a text or an icon.

ContainerTextIcon
  • Container: The pill-shaped area that carries the variant color.
  • Text: A short label naming the status or category.
  • Icon: An alternative to the text when the meaning is clear without words.

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.

basic
PropertyTypeDescription
variantdefault | primary | success | warning | info | error | admin | masterThe available variants of this component.
sizedefault | inlineThe available sizes of this component.

Badges use color to convey meaning at a glance. Choose the variant that matches the semantic intent of the status or label.

VariantDescriptionWhen to use
defaultNeutral badge with a subtle border. This is the default variant.Labels or metadata without a specific status, like categories, counts, or version numbers.
primaryBadge in the brand color with high visual weight.Drawing attention to important labels that don't represent a status, like "Recommended", "Pro", or "Featured".
successGreen-tinted badge.Positive statuses like "Active", "Completed", or "Approved".
warningYellow-tinted badge.Cautionary statuses like "Pending", "Expiring", or "Needs review".
infoBlue-tinted badge.Informational statuses like "New", "Updated", or "In progress".
errorRed-tinted badge.Negative statuses like "Failed", "Rejected", or "Expired".
adminOutlined badge with admin-specific color.Marking content visible only to admin users. Learn more.
masterOutlined badge with master-specific color.Marking content visible only to master users. Learn more.

Usage

A <Badge> is a component used to provide information on new updates and notifications. It is used with other components and cannot be used alone. The content of a badge can be arbitrary, but it is preferred to use a string and/or a icon.

Sizes

Badges come in two sizes. Which one is right depends on whether the badge sits next to a line of text or inside one.

SizeDescriptionWhen to use
defaultTaller than a line of text. This is the default size.Wherever the badge sits beside text rather than within it: a table cell, a card header, a list row, or a tab label.
inlineDrawn to the height of a text line, with the access icon scaled to match.Inside a run of text, and in field labels, where a default badge would make the line taller than the text around it.

A badge at its default size is taller than a line of text, which is right when it sits next to text: in a table cell, a card header, a list row. The row grows around it and nothing else has to move.

Inside a line of text it is not. A default badge in the label of a <Checkbox>, <Radio> or <Switch> makes that line taller than the control beside it, and the control ends up sitting above the words it belongs to. Their badge slot sizes a <Badge> to fit the line automatically, so you don't pass size yourself. Placing a badge inside a line of text anywhere else needs size="inline" directly.

Default, next to the text: in a table cell the badge is taller than the line it sits beside, and the row simply makes room for it.
Event
Status
Sommernachts-Konzert
On sale
Hafenlichter Festival
Pending
Winterzauber Gala
Cancelled
Inline, inside the text: in a checkbox label the badge is drawn to the height of the line, so the checkbox stays level with the words. The badge slot sets the size here, so no size prop is needed.
Sells a limited contingent at a reduced price before regular sales open.

Text Label Length

The Badge is a simple and compact component for use in a limited space in the context of more complex components. When it includes a text label, make sure it fits into the dedicated space.

Do

Do: Use short and precise text labels.
Use short and precise text labels.

Don't

Don't: Use long descriptions for labels.
Don't use long descriptions for labels.

Color

As the Badge is used as an indicator, its color must be precise and relevant to the message that the badge conveys.

Do

Do: Use the colors wisely and according to the meaning that the Badge implies.

Use the colors wisely and according to the meaning that the Badge implies.

Don't

Don't: Avoid using arbitrary colors that would not match the message that the Badge conveys.

Avoid using arbitrary colors that would not match the message that the Badge conveys.

Props

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

Badge

Prop

Type

Related

Admin- & master mark

Used for marking internal-only features.
Last update: 4 minutes ago

Tooltip

Component for displaying short information.

Description

Help text or supporting content paired with a title or label.

© Reservix GmbH — Marigold Design System
ImpressumDatenschutzGitHubRSS

On this page

AnatomyAppearanceUsageSizesText Label LengthColorPropsBadgeRelated