Badge

Badges are used to draw attention and display statuses or counts.

Badge

Set the variant attribute to change the badge’s variant.

Neutral Info Success Warning Error

Use the pill attribute to give badges rounded edges.

Neutral Info Success Warning Error 1 100 5 10
import '@ods/components/web.badge';

Note: You only need to import a web component once in your code, as it registers itself globally when defined, allowing you to use it anywhere within your application without needing to re-import it each time you want to use the component.

Slots

NameDescription
(default)The badge's content.

Properties

Please note, both DOM properties and HTML attributes are shown in the table below. Unless otherwise specified, the property and attribute names are identical.

Property/AttributeReflectsTypeDefault
variant
'primary' | 'success' | 'neutral' | 'warning' | 'danger''primary'
pill
booleanfalse

Parts

NameDescription
baseThe component's base wrapper.

Search