Badge

Alignment target:@astryxdesign/core v0.7.1 · Badge

NeutralInfoSuccessWarningError
BluePurplePinkTealOrange

Usage #

Import the component from its dedicated entry. The component loads its structural styles.

Import the theme in your application entry:

TypeScript
import '@astryx-vue/themes/neutral.css'

Component usage:

Vue
<script setup lang="ts">
import { Badge } from '@astryx-vue/core/Badge'
</script>

<template>
  <Badge variant="success">
    Completed
  </Badge>
</template>

Anatomy

ElementDescription
IconAn optional leading icon that helps identify the badge type at a glance.
LabelThe text or number shown inside the badge.

Best practices #

GuidancePractices
DoEvery status badge steals attention. Only badge states where the user needs to notice or act: errors, warnings, items requiring follow-up. If no action is needed, plain text is fine.
DoUse success, warning, and error variants only for system status that demands attention: "Failed", "Degraded", "Action Required". These have bold solid backgrounds designed to stand out.
DoUse color variants (blue, purple, teal, etc.) for category tags that group or classify items: team names, content types, priority levels.
DoKeep labels to one or two words. If you need more detail, put it in surrounding text instead of the badge.
DoAdd an icon when it helps identify the badge type quickly, but always include a text label alongside it.
DoA string or number label keeps its character order under right-to-left, so +3 and @alice read as written. When slot content mixes directions, mark the direction on your own content, for example with dir or <bdi>.
Don'tApply a "success" badge to every healthy/active/normal item. If all rows show green "Active" badges, none stand out; the badge adds noise, not information. Show only the states that need user attention (errors, warnings, pending actions).
Don'tUse badges for metadata. Durations ("6h window"), counts ("12 trigger types"), dates, and descriptions are not statuses or categories; use description text (Text with type="supporting") instead.
Don'tUse semantic status variants (success, warning, error, info) for categories or informational content. These are visually loud and should only indicate system state.
Don'tRepeat the same badge in every row of a table or list. If the same value appears in most rows, it's not adding information; use plain text for common states and reserve badges for the exceptional ones.
Don'tMake badges clickable; they are read-only indicators. Use a button or link if the user needs to take action.

Examples #

Badge — Colors

Teams
Design DevOps Backend Marketing Engineering Research
Priority
Urgent Critical Review
Open in Playground

Blue, cyan, green, and the other category colors group teams or topics. They do not report system status.

Badge — Counts

3 Messages
99+ Alerts
12 Completed
5 Pending
Open in Playground

A short number for unread messages or open tasks. Values past 99 can read 99+.

Badge — Status

System status
Active Pending Failed
Workflow
Draft In Review
Open in Playground

Success, warning, and error mark a state that needs attention. Neutral and info mark where something sits in a workflow.