Badge
A small round label for a status, in neutral, green and blue.
Live
Draft
Beta
Options
Code
import "./badge.css";
export function Badge({ tone, children }) {
const className = tone ? "dh-badge dh-badge--" + tone : "dh-badge";
return <span className={className}>{children}</span>;
}.dh-badge {
display: inline-flex;
align-items: center;
height: 1.7em;
padding: 0 0.65em;
border-radius: 999px;
background: var(--dh-raised, #fff);
color: var(--dh-muted, #5c5c5c);
font-size: 0.88em;
font-weight: 500;
white-space: nowrap;
box-shadow: 0 0 0 1px rgb(23 23 23 / 0.08), 0 1px 2px rgb(23 23 23 / 0.1);
}
.dh-badge--green {
background: #e2f4e6;
color: #1c7a3a;
box-shadow: 0 0 0 1px rgb(28 122 58 / 0.14);
}
.dh-badge--blue {
background: #e6edff;
color: #1d4ed8;
box-shadow: 0 0 0 1px rgb(29 78 216 / 0.14);
}<span class="dh-badge dh-badge--green">Live</span>
<span class="dh-badge">Draft</span>
<span class="dh-badge dh-badge--blue">Beta</span>.dh-badge {
display: inline-flex;
align-items: center;
height: 1.7em;
padding: 0 0.65em;
border-radius: 999px;
background: var(--dh-raised, #fff);
color: var(--dh-muted, #5c5c5c);
font-size: 0.88em;
font-weight: 500;
white-space: nowrap;
box-shadow: 0 0 0 1px rgb(23 23 23 / 0.08), 0 1px 2px rgb(23 23 23 / 0.1);
}
.dh-badge--green {
background: #e2f4e6;
color: #1c7a3a;
box-shadow: 0 0 0 1px rgb(28 122 58 / 0.14);
}
.dh-badge--blue {
background: #e6edff;
color: #1d4ed8;
box-shadow: 0 0 0 1px rgb(29 78 216 / 0.14);
}Badge is a Figma component
- Open it in Figma.
- Copy the component (Cmd or Ctrl + C).
- Paste it into your own file.