AstraUI

Components

Badge

A small concise visual indicator displaying a status notification count or short label.

smallmediumlarge
NeutralBadgeBadgeBadge
ErrorBadgeBadgeBadge
WarningBadgeBadgeBadge
SuccessBadgeBadgeBadge
BrandBadgeBadgeBadge

Props

NameTypeDefaultDescription
textstring-The text to display inside the badge.
countnumber-The count to display inside the badge.
maxCountnumber99The maximum count to display inside the badge.
colorstringbg-gray-200The background color of the badge in light mode.
darkColorstringbg-gray-700The background color of the badge in dark mode.
textColorstringtext-gray-900The text color of the badge in light mode.
darkTextColorstringtext-gray-100The text color of the badge in dark mode.
sizesmall | medium | largemediumThe size of the badge.

Best Practices

  • Highlight notification counts on icons for instant updates.
  • Show item status like active, inactive, new with badges.
  • Tag or categorize items in lists or card views using badges.
  • Display counts compactly, like items in a cart or post likes.
  • Label elements with extra context, e.g., `beta` or `coming soon`.