jingrow c7bac1a7a0
Some checks failed
Publish on NPM / publish (push) Has been cancelled
Build and Deploy Storybook / build (push) Has been cancelled
Tests / test (push) Has been cancelled
initial commit
2025-10-24 00:40:30 +08:00

1.7 KiB

Badge

The Badge component is used to show a status badge for an entity.

Usage

Draft Pending Completed Error In Progress
<template>
  <Badge>Draft</Badge>
  <Badge color="yellow">Pending</Badge>
  <Badge color="green">Completed</Badge>
  <Badge color="red">Error</Badge>
  <Badge color="blue">In Progress</Badge>
  <!-- using colorMap and label -->
  <Badge :colorMap="colorMap" label="Success" />
  <Badge :colorMap="colorMap" label="Warning" />
  <Badge :colorMap="colorMap" label="Info" />
</template>

<script setup>
import { Badge } from 'jingrow-ui'
let colorMap = {
  Success: 'green',
  Warning: 'yellow',
  Info: 'blue',
}
</script>

Props

Name Default Value Description
color 'gray' gray | yellow | green | red | blue
colorMap null Object An object containing label as key and color as value
label null String This must be passed when using colorMap