• /
  • Log in
  • Start now

Badge

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

childrenrequiredstring

String to render inside the badge. Ellipsis will apply if the content is more than 24 characters.

classNamestring

Appends class names to the component.

Should be used only for positioning and spacing purposes.

spacingTypeenum[]

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 of
Badge.SPACING_TYPE.EXTRA_LARGE,
Badge.SPACING_TYPE.LARGE,
Badge.SPACING_TYPE.MEDIUM,
Badge.SPACING_TYPE.NONE,
Badge.SPACING_TYPE.OMIT,
Badge.SPACING_TYPE.SMALL,
>
>
styleobject

Inline style for custom styling.

Should be used only for positioning and spacing purposes.

testIdstring

Adds a data-test-id.

Used to target the component in unit and e2e testing.

typeenum
DEFAULT
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 of
Badge.TYPE.CRITICAL,
Badge.TYPE.INFO,
Badge.TYPE.NORMAL,
Badge.TYPE.SUCCESS,
Badge.TYPE.WARNING,
>

Methods

Badge.render

function () => undefined
Edit this pageCreate an issue
Copyright © 2021 New Relic Inc.

This site uses cookies 🍪

We use cookies and other similar technologies ("Cookies") on our websites and services to enhance your experience and to provide you with relevant content. By using our websites and services you are agreeing to the use of cookies. You can read more here. If you consent to our cookies, please click Yes.