Variant Badge
A variant's clinical classification on the ACMG/AMP five-tier scale. Color carries the meaning, red toward pathogenic and green toward benign, and five pips show where on the scale it sits, so the tier reads without color too.
Install
npx shadcn@latest add @nelumbo/variant-badgeFive tiers
Pathogenic and benign at full strength, the likely tiers lighter, uncertain significance neutral. ClinVar's conflicting and not provided sit off the scale. A badge is as wide as its text; give them className="w-full justify-center" in a grid to line them up at one width.
Styles and sizes
Tonal (default), outline for dense tables, solid for the one call that matters most. notation="short" gives P, LP, VUS, LB and B.
Review status
review adds ClinVar's stars: how well reviewed the classification is, from no criteria to a practice guideline.
From the evidence
classifyVariant combines ACMG/AMP criteria by the 2015 rules, ClinGen's strength suffixes included (PM2_Supporting). VariantEvidence shows the criteria as chips: red argue pathogenic, green benign, and the bars give each one's strength. Pick some.
- PVS1, pathogenic, very strong
- PM2, pathogenic, supporting
- PP3, pathogenic, supporting
In a table
TP53 variants as ClinVar classifies them, paired with Amino Acid Change.
- R175Hc.524G>APathogenic
- R248Qc.743G>APathogenic
- R273Hc.818G>APathogenic
- P72Rc.215C>GBenign
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
classification | VariantClassification | string | pathogenic, likely-pathogenic, uncertain, likely-benign, benign, conflicting, not-provided; or text such as "VUS" or "Likely benign". | |
notation | "full" | "short" | "full" | Pathogenic or P. |
variant | "tonal" | "outline" | "solid" | "tonal" | Fill strength. |
size | "sm" | "default" | "lg" | "default" | 20, 24 or 32 px tall. |
scale | boolean | true | Five pips for the tier. |
review | 0 to 4 | ClinVar review stars. | |
VariantEvidence | { criteria: string[], size } | ACMG criteria as chips, by direction and strength. | |
Helpers | classifyVariant, parseCriterion, toClassification, VARIANT_CLASSES | The 2015 combining rules; a criterion's direction and strength; text to a classification; names and tiers. |