# Status badge | | | | :-- | :-- | | **Version** | 1.3 | | **Status** | Ready for build | | **Code** | `components/ui/badge` (shadcn Badge, two variants added) | | **Figma** | LVL Components → Status badge (link) | > Portfolio sample. Reconstructed from the shipped screens; the original file stayed with the company. **What it is.** A short label that says the state of one thing: a lab value, an order, an account. It's read, never clicked. **Intent.** Someone reading their own lab result should know what each value means without relying on color. The badge always says its meaning in words, and color only backs the words up. --- ## Properties Figma property names match the shadcn props one to one, so the design and the code use the same words. | Property | Values | Default | | :-- | :-- | :-- | | **variant** | secondary · success · warning · destructive | secondary | | **icon** | true · false | false | | **children** | The label, 1–3 words | — | **success** and **warning** were added for LVL. The other names match shadcn's. | Variant | Means | Examples | | :-- | :-- | :-- | | **secondary** | Nothing to do | In range, Inactive | | **success** | Done, or ready for you | Active, Confirmed, Final, Ready to read | | **warning** | Worth a look, not an error | Above range, Pending verification | | **destructive** | Stopped | Suspended | Tokens: semantic names only, never a raw hex. **success** uses `brand/mint` on `brand/mint-soft` with a `brand/mint-line` edge. --- ## When to use it - The state of one row, card or result. - Next to the thing it describes, on the same line. ## When to use something else - **Someone can act on it** → Button. A badge is never clickable. - **It explains why** → Alert or an inline note. A badge is a label, not a sentence. - **A critical lab value** → Critical-value banner. That can't wait in a table cell. - **Progress across steps** → Order tracker. --- ## Do - Write the meaning in words: **Above range**, not "High!" or an arrow. - Use **secondary** for in-range values. Calm is the right signal there. - Keep the label in uppercase through the component, not in the text. ## Don't - **Don't use color without a word.** No dots, no color-only cells. - **Don't use success (mint) on a lab value.** Mint means you can act or something is done. An in-range value needs nothing. - **Don't use destructive for out-of-range results.** Above range isn't an error, and red there causes needless alarm. - **Don't put two badges on one item.** If it needs two, the state model is wrong. --- ## Accessibility - The label is real text, so screen readers read the status with the row. - Every variant clears WCAG AA contrast in light and dark mode. - It isn't focusable, because nothing happens when you click it.