Skip to content

Import

import { Badge } from '@dnb/eufemia'

Description

Badge generates a small badge on its children, or can be an inline/standalone badge.

Relevant links

Badge variants

Notification Badge

The notification badge has a very limited use. The area of use is currently limited to a counter of messages in the message center.

Information Badge

Can be used to describe or inform about new activity or features in our applications. The label can be placed on top of element backgrounds or inline with text within cells.

The logic of how long it should be visible would differ from case to case, so that's up to the designer.

Demos

Setting the variant property

Information

The default variant. Equivalent to variant='information'.

New

Notification

variant='notification'.

Notifications

Usage examples

Text Info Text
PersonsANy
Text Notifications Text
PersonsANotifications

Setting the status and subtle properties

The information variant has 5 possible status values, and two possible subtle values.

The default state is equivalent to status='default' and subtle={false}.

defaultdefault (subtle)neutralneutral (subtle)positivepositive (subtle)warningwarning (subtle)negativenegative (subtle)

Setting property horizontal and vertical

vertical 'top' horizontal 'left'

PersonsANotifications

vertical 'top' horizontal 'right'

PersonsANotifications

vertical 'bottom' horizontal 'left'

PersonsANotifications

vertical 'bottom' horizontal 'right'

PersonsANotifications