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.
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
<scriptsetup>import{ AisBadge }from"@ais-public/ais-components";import Example from"@/components/docs/ComponentExample.vue";import{ variants }from"@/util/variants-util";import{ capitalizeFirst }from"@/util/util";</script><template><divclass="grid grid-cols-3 md:grid-cols-4 gap-x-4 gap-y-8"><Examplev-for="variant in variants":label="capitalizeFirst(variant)"><AisBadge:variant="variant"outlinehoverfastpress>
Outline
</AisBadge></Example></div></template>
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
<template><divclass="docs-example grid gap-y-8"><divclass="flex items-center space-x-4"><Examplelabel="sans"><AisBadgefont="sans"size="lg">Sans</AisBadge></Example><Examplelabel="serif"><AisBadgefont="serif"size="lg">Serif</AisBadge></Example></div></div></template><scriptsetup>import Example from"@/components/docs/ComponentExample.vue";import{ AisBadge }from"@ais-public/ais-components";</script>
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).