Badges and status

On this page

Badges label a record's state (Active, Expiring, Suspended). Status indicators show whether something is working right now (Online, Offline, Live). Avatars stand in for people, and keyboard keys show shortcuts.

Badges

Badge tonesBadge tones

Figure 1: Neutral, success, warning, danger, info and purple badges

<span class="ph-badge">Draft</span>
<span class="ph-badge ph-badge--success">Active</span>
<span class="ph-badge ph-badge--warning">Expiring</span>
<span class="ph-badge ph-badge--danger">Suspended</span>
<span class="ph-badge ph-badge--info">New</span>
<span class="ph-badge ph-badge--purple">Beta</span>
ClassUse for
.ph-badgeNeutral states and counts: Draft, a number in a tab
.ph-badge--successGood states: Active, Paid, Connected
.ph-badge--warningNeeds attention soon: Expiring, Paused, Retrying
.ph-badge--dangerSomething is wrong: Suspended, Failed, Denied
.ph-badge--infoNeutral news: New, Updated
.ph-badge--purpleSpecial categories: Beta, VIP

Status

Status indicatorsStatus indicators

Figure 2: Status indicators, including the pulsing live status

<span class="ph-status ph-status--success">Online</span>
<span class="ph-status ph-status--live">Live</span>
ClassDotUse for
.ph-statusGreyUnknown or not reporting
.ph-status--successGreenOnline, healthy
.ph-status--warningOrangeDegraded, slow
.ph-status--dangerRedOffline, failed
.ph-status--infoBlueUpdating, syncing
.ph-status--liveGreen, pulsingA live feed that is updating now. The pulse stops when the viewer asks for reduced motion.

Avatars and keyboard keys

Avatars, an avatar group and keyboard keysAvatars, an avatar group and keyboard keys

Figure 3: Avatar sizes, an avatar group and keyboard keys

<span class="ph-avatar" aria-hidden="true">NP</span>
<div class="ph-avatar-group" aria-label="4 team members">
  <span class="ph-avatar" aria-hidden="true">CN</span>
  <span class="ph-avatar" aria-hidden="true">MK</span>
  <span class="ph-avatar" aria-hidden="true">+2</span>
</div>
<p>Press <kbd>Ctrl</kbd> + <kbd>K</kbd> to search.</p>
ClassSize
.ph-avatar--sm24px
.ph-avatar32px
.ph-avatar--lg48px
.ph-avatar-groupOverlaps avatars, with a ring around each
kbd or .ph-kbdA key cap

Avatars show initials. Hide them from screen readers (aria-hidden="true") when the person's name is next to them, and label a group with a count.

React

import { StatusChip } from 'ph-app-kit-react';

<StatusChip tone="success">Active</StatusChip>   // tone: success | danger | warning | info | neutral

Guidelines

  • Colour is never the only signal: the badge or status always has a word.
  • Use one word or two. Badges aren't sentences.
  • Pick the tone by what the person should do: nothing (success), keep an eye on it (warning), act now (danger).
  • Use badges for a record's state and status dots for whether something is connected or running.