EWC Badge
A compact inline chip for a European Waste Catalogue code — the formatted code, a hazard asterisk and dot for hazardous entries, and an optional short label.
$
Registry itembunx shadcn@latest add @nx-ui/ewc-badgeInstalls withutils
Codes
Any accepted spelling normalises to the spaced form; hazardous codes carry the asterisk and red dot.
17 01 0117 05 0417 06 05*20 03 07
Labels
A short label after the code, for lists where the material name saves a lookup.
17 01 01Concrete17 05 04Soil and stones17 06 05*Asbestos-containing materials
Entry objects
Pass an EwcEntry-compatible object — its hazard flag wins over the asterisk on the code.
17 06 05*Construction materials containing asbestos19 12 09Minerals
Interactive
With an onClick the chip renders as a button — handy for opening the code detail in the EWC lookup.
API reference
Exported parts and their props, extracted from the component source.
| Prop | Type | Default | Description |
|---|---|---|---|
code | string | — | The EWC code — "170101", "17 01 01" or "17 01 01*" (asterisk = hazardous). |
entry | EwcBadgeEntry | — | An `EwcEntry`-compatible object; its hazard flag wins over the asterisk. |
label | string | — | Optional short label shown after the code, e.g. a material name. |
onClick | () => void | — | Renders the chip as a button. |
className | string | — | — |
…extends VariantProps<typeof ewcBadgeVariants>