Badge

Badges are used to show notification count and call the user's attention to take action on them.

Comparisions

ComponentPurpose / Use Case
LozengeHighlight an item's status
BadgeCounts and tallies
TagVisually label items
Attachments
0Attachments
50Alert
+99Mailbox
<SpacedGroup xs={24}>
    <Badge count={0}>
      <AttachmentsIcon size={32} />
    
    <Badge count={0} showZero>
      <AttachmentsIcon size={32} />
    </Badge>
    <Badge count={50} maxCount={51}>
      <AlertIcon size={32} />
    </Badge>
    <Badge count={10000} maxCount={99}>
      <MailboxIcon size={32} />
    </Badge>
  </SpacedGroup>
</Playground>

Without Children

12
Count
+10
Max Count
100
Ignore Max Count
0
Show Zero
<SpacedGroup xs={32}>
    <SpacedGroup direction="vertical" center>
      <Badge count={12} />
      <span>Count
    </SpacedGroup>
    <SpacedGroup direction="vertical" center>
      <Badge count={12} maxCount={10} />
      <span>Max Count</span>
    </SpacedGroup>
    <SpacedGroup direction="vertical" center>
      <Badge count={100} maxCount={1000} />
      <span>Ignore Max Count</span>
    </SpacedGroup>
    <SpacedGroup direction="vertical" center>
      <Badge count={0} showZero />
      <span>Show Zero</span>
    </SpacedGroup>
  </SpacedGroup>
</Playground>

Colors

12
Fern
+10
Paper
100
Denim
0
Sunset (Default)
<SpacedGroup xs={32}>
    <SpacedGroup direction="vertical" center>
      <Badge count={12} backgroundColor={palette.fern} />
      <span>Fern
    </SpacedGroup>
    <SpacedGroup direction="vertical" center>
      <Badge
        count={12}
        maxCount={10}
        backgroundColor={palette.paper}
        color={palette.obsidian}
        bordered
      />
      <span>Paper</span>
    </SpacedGroup>
    <SpacedGroup direction="vertical" center>
      <Badge
        count={100}
        maxCount={1000}
        backgroundColor={palette.denim}
        color={palette.paper}
      />
      <span>Denim</span>
    </SpacedGroup>
    <SpacedGroup direction="vertical" center>
      <Badge count={0} showZero />
      <span>Sunset (Default)</span>
    </SpacedGroup>
  </SpacedGroup>
</Playground>

API