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 | Type(s) | Required | Default | Description | Deprecated |
|---|---|---|---|---|---|
| font | String | 'sans' | Set the font of the text inside of the badge Valid values: caps, sans, serif | false | |
| outline | Boolean | false | Applies one of the theme color variants to the border instead of the background. This replaces the
deprecated alternate prop | false | |
| size | String | 'md' | Set the size of the component's appearance Valid values: xs, sm, md, lg, xl | false | |
| variant | String | 'default' | Applies one of the theme color variants to the component Valid values: primary, secondary, default, info, success, warning, danger, plain | false | |
| alternate | Boolean | false | Removes the background color and applies one of the theme color variants to the border Deprecated - Replaced by outline | true |
Slots
Name | Scoped | Description |
|---|---|---|
| default | No |
Events
Event | Arguments | Description |
|---|---|---|