Skip to main content

StatusBadge

import { StatusBadge } from '@enmovil/ui-design-system';

A coloured status pill. Its tone is picked automatically from common status strings, and you can override the tone, add a leading dot or change the label.

Properties​

PropertyTypeRequiredDefaultAllowed valuesDescription
classNamestringNo——Extra CSS class added to the badge, after its tone and size classes.
statusstringYes——Status string. Used both as label and to pick a tone if tone is unset.
tonestringNo—'info', 'teal', 'green', 'red', 'amber', 'slate', 'navy'Override the auto-resolved tone
dotbooleanNo——Show a leading dot indicator
sizestringNo'md''md', 'sm'Smaller padding/font
labelReactNodeNo——Optional label override (defaults to humanized status)
Other attributes

StatusBadge passes 271 further attributes through to the underlying element. They aren't part of the supported API and may change between releases, so use only the properties listed on this page.

Events​

NameSignatureWhen it fires
onClickMouseEventHandler<HTMLSpanElement>Fires when the badge is clicked, e.g. to filter a list by this status.
onMouseEnterMouseEventHandler<HTMLSpanElement>Fires when the pointer enters the badge.
onMouseLeaveMouseEventHandler<HTMLSpanElement>Fires when the pointer leaves the badge.

Children​

StatusBadge does not accept children.

Variants​

Loading examples…

Playground​

Change the controls to see how the properties affect the component. Values the controls don't cover come from the Gallery example.

Loading playground…

Storybook​

Open StatusBadge in Storybook to try every story with the full set of controls.