Badge

Badges can be used for notification, tags, and status. They are used for count and numbers.

Summary
Rectangle

badge-rectangle

HStack {
  PBBadge(text: "+1", variant: .primary)
  PBBadge(text: "+4", variant: .primary)
  PBBadge(text: "+1000", variant: .primary)
 }
Rounded

badge-rounded

HStack {
  PBBadge(text: "+1", rounded: true, variant: .primary)
  PBBadge(text: "+4", rounded: true, variant: .primary)
  PBBadge(text: "+1000", rounded: true, variant: .primary)
 }
Colors

badge-colors

HStack {
  PBBadge(text: "1", rounded: true, variant: .chat)
  PBBadge(text: "4", variant: .chat)
  PBBadge(text: "1000", variant: .chat)

  PBBadge(text: "1", rounded: true, variant: .error)
  PBBadge(text: "4", variant: .error)
  PBBadge(text: "1000", variant: .error)

  PBBadge(text: "1", rounded: true, variant: .info)
  PBBadge(text: "4", variant: .info)
  PBBadge(text: "1000", variant: .info)

  PBBadge(text: "1", rounded: true, variant: .neutral)
  PBBadge(text: "4", variant: .neutral)
  PBBadge(text: "1000", variant: .neutral)

  PBBadge(text: "1", rounded: true, variant: .primary)
  PBBadge(text: "4", variant: .primary)
  PBBadge(text: "1000", variant: .primary)

  PBBadge(text: "1", rounded: true, variant: .success)
  PBBadge(text: "4", variant: .success)
  PBBadge(text: "1000", variant: .success)

  PBBadge(text: "1", rounded: true, variant: .warning)
  PBBadge(text: "4", variant: .warning)
  PBBadge(text: "1000", variant: .warning)
 }
Notification

badge-chat-notification

HStack {
  PBBadge(text: "1", rounded: true, variant: .chat)
  PBBadge(text: "4", variant: .chat)
  PBBadge(text: "1000", variant: .chat)
 }

Props

Name Type Description Default Values
text String Specifies the value of the Badge
rounded Bool Displays the rounded variant false
variant Variant Changes the color of the Badge .primary .chat .error .info .neutral .primary .success .warning

UI Samples using Badge Kit

Get the full picture. See how this kit is used in our samples.