Badge

Presents users with short, relevant information.

Badge

To implement Badge component into your project you’ll need to add the import:

import Badge from "@kiwicom/orbit-components/lib/Badge";

After adding import into your project you can use it simply like:

<Badge>Hello!</Badge>

Props

Table below contains all types of the props available in Badge component.

NameTypeDefaultDescription
childrenReact.NodeThe content of the Badge.
dataTeststringOptional prop for testing purposes.
idstringSet id for Badge
iconReact.NodeThe displayed icon on the left.
typeenum"neutral"The color type of the Badge.
ariaLabelstringAdds prop adds aria-label to an element, useful for screenreaders.
borderbooleantrueShow or hide border around Badge
carriersCarrier[]The content of the CarrierLogo, passed as array of objects.

Carrier

Table below contains all types of the props available for object in Carrier array.

NameTypeDescription
codestringThe code of the Carrier, defines which logo will be rendered.
namestringThe name of the Carrier, mainly for information.
typeenumThe preferred placeholder for non-existing carrier. See Functional specs

enum

type
"neutral"
"dark"
"info"
"success"
"warning"
"critical"
"infoSubtle"
"criticalSubtle"
"successSubtle"
"warningSubtle"
"bundleBasic"
"bundleMedium"
"bundleTop"

Functional specs

  • If you want to use circled badge, please take a look on NotificationBadge.