Skip to content
Okaapiأوكابي
Framework for the code
Theme
Okaapi on GitHub

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.

Use it in Angular
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.

DraftNewPaidLateCancelled
Angular
<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

مدفوعمتأخر
Angular
<ui-badge variant="success">مدفوع</ui-badge>
<ui-badge variant="warning">متأخر</ui-badge>

When to use something else

If you needUse
A label the user added or can remove, such as a filterTag
A live state such as online or offlineStatus dot
A message the reader must readAlert

Inputs

NameTypeDefaultWhat 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.