Badges indicate the status of an object.
Usage
import { Badge } from 'nr1'
Examples
Basic
ReferenceError: Badge is not defined
Types
ReferenceError: Badge is not defined
Props
String to render inside the badge. Ellipsis will apply if the content is more than 24 characters.
Appends class names to the component.
Should be used only for positioning and spacing purposes.
Spacing property. Spacing is defined as a tuple of zero to four
values, which follow the same conventions as CSS properties like
margin
or padding
. To omit a value, use SPACING_TYPE.OMIT
.
<Array of<One ofBadge.SPACING_TYPE.EXTRA_LARGE,Badge.SPACING_TYPE.LARGE,Badge.SPACING_TYPE.MEDIUM,Badge.SPACING_TYPE.NONE,Badge.SPACING_TYPE.OMIT,Badge.SPACING_TYPE.SMALL,>
>
Inline style for custom styling.
Should be used only for positioning and spacing purposes.
Adds a data-test-id
.
Used to target the component in unit and e2e testing.
Badge .TYPE .NORMAL
Type can be:
- Normal — indicates general or in-progress status, eg. ‘Coming soon’ or ‘Minor’.
- Info - indicates a new, created, or help status, eg. ‘New’, ‘Beta’ or ‘Information’.
- Success - indicates a successful state.
- Warning - indicates items that require advice state.
- Critical - indicates problematic items.
<One ofBadge.TYPE.CRITICAL,Badge.TYPE.INFO,Badge.TYPE.NORMAL,Badge.TYPE.SUCCESS,Badge.TYPE.WARNING,>
Methods
Badge.render
function () => undefined