Badge Component

Badges are small status indicators that can be used to highlight information or categorize content.

Usage

<Badge text="Status" color="green" />

Props

PropTypeRequiredDescription
textStringYesThe text content to display in the badge
colorStringYesThe color variant of the badge

Color Variants

The Badge component supports 6 different color variants:

Bunker

Bunker Badge 
color="bunker"

Red

Red Badge 
color="red"

Yellow

Yellow Badge 
color="yellow"

Green

Green Badge 
color="green"

Blue

Blue Badge 
color="blue"

Violet

Violet Badge 
color="violet"

Examples

Common use cases for badges in the application:

Status Indicators

Published Draft Pending Rejected Sold 

Priority Levels

High Medium Low 

Code Examples

Basic Usage

<template>
  <div>
    <Badge text="New" color="green" />
    <Badge text="Updated" color="blue" />
    <Badge text="Deprecated" color="red" />
  </div>
</template>

Dynamic Badges

<template>
  <div v-for="item in items" :key="item.id">
    <Badge :text="item.status" :color="getStatusColor(item.status)" />
  </div>
</template>

<script>
export default {
  methods: {
    getStatusColor(status) {
      const colors = {
        'active': 'green',
        'pending': 'yellow',
        'inactive': 'bunker',
        'error': 'red'
      }
      return colors[status] || 'bunker'
    }
  }
}
</script>