Skip to contentEnma

Components

Badge

Live demo

PaidOverdueDraftNew+8%

How to use it

One or two words of status, or a delta like "+8%", beside the thing it describes.

  • Provide children and tone: positive, negative, neutral or accent. dot adds a leading status dot.
  • Status is always a word, never color alone ("Paid", "Overdue", "Draft").
  • Numbers inside badges use tabular figures automatically.

Don't: more than two badges on one row, sentences inside badges, accent badges for status.

In every theme

Follows the mode picked in the header.
Graphite
PaidOverdueDraftNew
Glass
PaidOverdueDraftNew
Paper
PaidOverdueDraftNew
Mineral
PaidOverdueDraftNew
Enamel
PaidOverdueDraftNew
Ember
PaidOverdueDraftNew

Code

React
import { Badge } from 'enma/react';

<Badge tone="positive" dot>Paid</Badge>
<Badge tone="negative">Overdue</Badge>
<Badge>Draft</Badge>
<Badge tone="accent">New</Badge>
Plain HTML
<span class="e-badge e-badge--positive"><span class="e-badge__dot" aria-hidden="true"></span>Paid</span>
<span class="e-badge e-badge--negative">Overdue</span>

Props

BadgeProps

Also accepts every attribute of React.HTMLAttributes<HTMLSpanElement>.

Props of BadgeProps
PropTypeDefaultDescription
toneTone'neutral'
dotboolean
childrenReact.ReactNode

↑ ↓ to move, Enter to open, Esc to close

Keyboard shortcuts

Open the command palette
Ctrl then K
Search
/
Show keyboard shortcuts
?
Close the top overlay
Esc
Go to Home
G then H
Go to Themes
G then T
Go to Playground
G then P
Go to Components
G then C
Go to Guides
G then G
Go to Samples
G then S