Badge

Badges are small status descriptors for UI elements, used to convey concise information about an item or its status.

Design system docs Examples Default badge
<dap-ds-badge>Default Badge</dap-ds-badge>
Badge types

Different types of badges for different statuses

<dap-ds-stack direction="row">
<dap-ds-badge type="neutral">
    Neutral Badge
</dap-ds-badge>
<dap-ds-badge type="brand">
    Brand Badge
</dap-ds-badge>
<dap-ds-badge type="info">
    Info Badge
</dap-ds-badge>
<dap-ds-badge type="positive">
    Positive Badge
</dap-ds-badge>
<dap-ds-badge type="warning">
    Warning Badge
</dap-ds-badge>
<dap-ds-badge type="negative">
    Negative Badge
</dap-ds-badge>
</dap-ds-stack>
Badge sizes

Badges can be small or large

<dap-ds-stack direction="row">
<dap-ds-badge size="sm">
    Small Badge
</dap-ds-badge>
<dap-ds-badge size="lg">
    Large Badge
</dap-ds-badge>
</dap-ds-stack>
Importing
import { DapDSBadge } from 'dap-design-system/dist/dds'
Importing React
import { DapDSBadgeReact } from 'dap-design-system/dist/react'
Attributes
PropertyTypeDefaultDescription
type'neutral', 'brand' , 'info' , 'positive' , 'warning' , 'negative''neutral'The type of the badge
size'lg', 'sm''sm'The size of the badge
iconstringThe icon of the badge, this is a name of a built in icon
Slots
NameDescription
(default)The content of the badge.
iconThe icon of the badge.
Events

No custom events available.

CSS Parts
Part NameDescription
baseThe main container of the badge.
iconThe icon of the badge.
contentThe content of the badge.
icon-baseThe base of the icon.
CSS Custom Properties
Property NameDescription
--dds-badge-border-widthThe width of the badge's border. Default is the design system's base border width.
--dds-badge-border-styleThe style of the badge's border. Default is solid.
--dds-badge-border-radiusThe border radius of the badge. Default is the design system's base radius.
--dds-badge-font-weightThe font weight of the badge text. Default is bold.
--dds-badge-line-heightThe line height of the badge text. Default is 1.2.
--dds-badge-transitionThe transition property for the badge. Default is 'all 0.2s ease-in-out'.
--dds-badge-padding-smThe padding of the small badge. Default is the design system's spacing-100 and spacing-200.
--dds-badge-padding-lgThe padding of the large badge. Default is the design system's spacing-100 and spacing-300.
--dds-badge-font-size-smThe font size of the small badge. Default is the design system's font-xs.
--dds-badge-font-size-lgThe font size of the large badge. Default is the design system's font-sm.
--dds-badge-neutral-border-colorThe border color of the neutral badge. Default is the design system's border-neutral-base.
--dds-badge-neutral-backgroundThe background color of the neutral badge. Default is the design system's background-neutral-medium.
--dds-badge-neutral-colorThe text color of the neutral badge. Default is the design system's text-neutral-subtle.
--dds-badge-brand-border-colorThe border color of the brand badge. Default is the design system's border-brand-base.
--dds-badge-brand-backgroundThe background color of the brand badge. Default is the design system's background-brand-medium.
--dds-badge-brand-colorThe text color of the brand badge. Default is the design system's text-brand-subtle.
--dds-badge-info-border-colorThe border color of the info badge. Default is the design system's border-informative-base.
--dds-badge-info-backgroundThe background color of the info badge. Default is the design system's background-informative-medium.
--dds-badge-info-colorThe text color of the info badge. Default is the design system's text-informative-subtle.
--dds-badge-positive-border-colorThe border color of the positive badge. Default is the design system's border-positive-base.
--dds-badge-positive-backgroundThe background color of the positive badge. Default is the design system's background-positive-medium.
--dds-badge-positive-colorThe text color of the positive badge. Default is the design system's text-positive-subtle.
--dds-badge-warning-border-colorThe border color of the warning badge. Default is the design system's border-warning-subtle.
--dds-badge-warning-backgroundThe background color of the warning badge. Default is the design system's background-warning-medium.
--dds-badge-warning-colorThe text color of the warning badge. Default is the design system's text-warning-subtle.
--dds-badge-negative-border-colorThe border color of the negative badge. Default is the design system's border-negative-base.
--dds-badge-negative-backgroundThe background color of the negative badge. Default is the design system's background-negative-medium.
--dds-badge-negative-colorThe text color of the negative badge. Default is the design system's text-negative-subtle.