Skip to content

Badge ​

A compact label for counts, statuses, and short metadata. Supports numeric overflow capping, a dot-only indicator, an optional icon slot, and all color themes.

Variants ​

The badge comes with five visual variants to match different levels of emphasis.

Full width

Frost Variant ​

Modern frost effect with backdrop blur that adapts based on color:

  • Without color: Subtle canvas-based frost overlay
  • With color: Frosted glass effect with colored tint

Best Used With

Frost variant works best when placed over colorful backgrounds or images to showcase the blur and transparency effects.

Full width

Colors ​

Six semantic colors for different contexts.

Full width

Sizes ​

Three sizes for different contexts.

Full width

Count Badge ​

Use count and max for numeric notification badges. When count exceeds max the label renders as {max}+. Use color="error" for notification counts to draw immediate attention.

Full width

Dot Indicator ​

Use dot for a minimal presence indicator with no label: for example, online status or unread indicators where presence alone is enough.

Full width

With Icon ​

Use the icon slot to prepend an SVG or icon font glyph.

Full width

Rounded Variants ​

Full width

Using Badges with Other Components ​

Badges work great when combined with other components to show counts, status, or notifications.

Overlay / Notification Badge ​

Use the anchor prop with the target slot to pin a badge to the corner of any element. The host becomes position: relative and the badge is positioned absolutely at the specified corner.

Full width

Four corner positions are available:

anchor valueCorner
top-end (default)Top-right
top-startTop-left
bottom-endBottom-right
bottom-startBottom-left
Full width

With Icons ​

Combine badges with icon buttons for compact notification indicators.

Full width

Multiple Badges ​

Stack multiple badges to show different types of information.

Full width

API Reference ​

Attributes ​

AttributeTypeDefaultDescription
variant'solid' | 'flat' | 'bordered' | 'outline' | 'frost''solid'Visual style variant
color'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'-Theme color
size'sm' | 'md' | 'lg''md'Badge size
rounded'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full''full'Border radius
countnumber-Numeric count to display
maxnumber99Maximum count before showing {max}+
dotbooleanfalseShow as a dot indicator (no label)
anchor'top-end' | 'top-start' | 'bottom-end' | 'bottom-start'N/APin badge to a corner of the target slot content
aria-labelstringN/AAccessible label for assistive technology. Recommended for count-only and dot mode.

Slots ​

SlotDescription
(default)Badge label text
iconIcon prepended inside the badge
targetElement the badge overlays when anchor prop is set

CSS Custom Properties ​

PropertyDescriptionDefault
--badge-bgBackground colorTheme-dependent
--badge-colorText / icon colorTheme-dependent
--badge-border-colorBorder colorTheme-dependent
--badge-radiusBorder radiusvar(--rounded-full)
--badge-font-sizeFont sizevar(--text-xs)
--badge-font-weightFont weightvar(--font-semibold)
--badge-padding-xHorizontal paddingvar(--size-1-5)
--badge-padding-yVertical paddingvar(--size-0-5)
--badge-gapGap between icon and labelvar(--size-1)
--badge-max-widthMaximum text width24ch

Accessibility ​

Badge text content is read by screen readers as inline text. Count badges expose the full value (or {max}+) as visible text that is read aloud. Dot indicator badges and count-only badges convey meaning through color and shape alone: use the aria-label attribute directly on ore-badge to provide a text description for assistive technology. When multiple badges are present, each should have a distinct aria-label to distinguish them.

Keep badge labels very short (1–3 words). For longer status text use ore-alert. Badges should not be used as the primary call-to-action; use ore-button for that.