Chapter 09 Labels
Badge
A short status label, such as the state of an order. The words carry the meaning and the colour only repeats it, so every status reads the same without colour.
import { BadgeComponent } from '@okaapi-ui/angular';Variants
Each pair of text and fill passes 7:1 in both themes. Danger uses brand red, so keep it for problems.
<ui-badge>Draft</ui-badge>
<ui-badge variant="info">New</ui-badge>
<ui-badge variant="success">Paid</ui-badge>
<ui-badge variant="warning">Late</ui-badge>
<ui-badge variant="danger">Cancelled</ui-badge>In Arabic
<ui-badge variant="success">مدفوع</ui-badge>
<ui-badge variant="warning">متأخر</ui-badge>When to use something else
| If you need | Use |
|---|---|
| A label the user added or can remove, such as a filter | Tag |
| A live state such as online or offline | Status dot |
| A message the reader must read | Alert |
Inputs
| Name | Type | Default | What it does |
|---|---|---|---|
variant | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'neutral' | The colour. The text must say the status too. |
Keyboard and screen readers
- The words carry the status; the colour only repeats them.