AisBadge

Badge Component

Props

Variant

The variant prop accepts the standard variants and dictates the badge styles. The variants are: primary, secondary, default, plain, info, success, warning, and danger. The default value is default.

Badge
Primary
Badge
Secondary
Badge
Default
Badge
Plain
Badge
Info
Badge
Success
Badge
Warning
Badge
Danger

Outline

The outline prop can be combined with variant to provide an alternate set of badge styles. outline is a boolean prop that can be added without a value. Outline variants use a lighter background with a visible border.

Outline
Default
Outline
Primary
Outline
Secondary
Outline
Plain
Outline
Info
Outline
Success
Outline
Warning
Outline
Danger

Alternate

The alternate prop has been deprecated and has been replaced by outline. Please update your usages as alternate will be removed.

Sizes

Thesize prop controls the badge size. The accepted values are: xl, lg, md, sm, and xs. The default value is md.

X-Large
xl
Large
lg
Medium
md
Small
sm
X-Small
xs

Font

The font prop sets the badge's font. It will accept one of our three brand fonts: sans, serif, and caps. sans is the default value. (Link to Typography page.)

Sans
sans
Serif
serif

Icon

The AisIcon component can be used inside a badge. When using icons in badges, be careful not to make the badge look like a clickable button. Icons on a badge should represent resting states (e.g. locked & unlocked). They should not be used for active states (e.g. busy).

Locked
Locked
Unlocked
Unlocked

Component Reference

Props

Property
1
Type(s)
Description
Required
Default
alternate
Boolean
Removes the background color and applies one of the theme color variants to the border
Deprecated
- Replaced by outline
false
font
String
Set the font of the text inside of the badge
Valid values:
caps, sans, serif
'sans'
outline
Boolean
Applies one of the theme color variants to the border instead of the background. This replaces the deprecated alternate prop
false
size
String
Set the size of the component's appearance
Valid values:
xs, sm, md, lg, xl
'md'
variant
String
Applies one of the theme color variants to the component
Valid values:
primary, secondary, default, info, success, warning, danger, plain
'default'

Slots

Name
1
Scoped
Description
default
No

Events

Event
1
Arguments
Description