DÁP badge

This badge is a brand item showing that the frontend of the app uses the DÁP design system.

Examples
<dap-ds-stack>
<dap-ds-dap-badge>
</dap-ds-dap-badge>
<dap-ds-dap-badge variant="inverted">
</dap-ds-dap-badge>
</dap-ds-stack>
Sizes
<dap-ds-stack>
  <dap-ds-dap-badge size="lg">
  </dap-ds-dap-badge>
  <dap-ds-dap-badge size="lg" variant="inverted">
  </dap-ds-dap-badge>
</dap-ds-stack>
Importing
import { DapDSDAPBadge } from 'dap-design-system'
Importing React
import { DapDSDAPBadgeReact } from 'dap-design-system/react'
Tree-Shakeable Imports

For optimal bundle sizes, use the tree-shakeable import syntax:

import { DapDSDAPBadge } from 'dap-design-system/components'
Attributes
PropertyTypeDefaultDescription
variant'normal', 'inverted''normal'The variant of the DÁP badge
size'sm', 'lg''sm'The size of the DÁP badge
Slots
NameDescription
(default)Description of badge *
Events

No custom events available.

CSS Parts
Part NameDescription
baseMain badge container
iconBadge icon
textBadge text
How to Use CSS Parts

You can style CSS parts using the ::part() pseudo-element selector:

/* Target a specific part */
.my-custom-dap-ds-dap-badge::part(base) {
  /* Your custom styles */
}

/* Target multiple parts */
.my-custom-dap-ds-dap-badge::part(base),
.my-custom-dap-ds-dap-badge::part(icon) {
  /* Shared styles */
}

Example usage:

<dap-ds-dap-badge class="my-custom-dap-ds-dap-badge">
  DÁP badge
</dap-ds-dap-badge>
.my-custom-dap-ds-dap-badge::part(base) {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

CSS parts allow you to style internal elements of the component while maintaining encapsulation. Learn more in our styling guide.

CSS Custom Properties
Property NameDescription
--dds-badge-padding-smCustom padding for the small badge (default: var(--dds-spacing-200) var(--dds-spacing-300))
--dds-badge-padding-lgCustom padding for the large badge (default: var(--dds-spacing-400))
--dds-badge-border-widthCustom border width for the badge (default: var(--dds-border-width-base))
--dds-badge-border-colorCustom border color for the badge (default: var(--dds-border-neutral-divider))
--dds-badge-border-radiusCustom border radius for the badge (default: var(--dds-radius-base))
--dds-badge-colorCustom text color for the badge (default: var(--dds-text-neutral-base))
--dds-badge-gapCustom gap between icon and text (default: var(--dds-spacing-200))
--dds-badge-font-size-smCustom font size for the small badge (default: var(--dds-font-xs))
--dds-badge-font-size-lgCustom font size for the large badge (default: var(--dds-font-xs))
--dds-badge-font-weightCustom font weight for the badge (default: var(--dds-font-weight-medium))
--dds-badge-line-heightCustom line height for the badge (default: var(--dds-font-line-height-large))
--dds-badge-border-color-normalCustom border color for the normal variant (default: var(--dds-transparent-black-medium))
--dds-badge-background-color-normalCustom background color for the normal variant (default: var(--dds-background-brand-subtle))
--dds-badge-color-normalCustom text color for the normal variant (default: var(--dds-text-brand-subtle))
--dds-badge-border-color-invertedCustom border color for the inverted variant (default: var(--dds-transparent-white-medium))
--dds-badge-background-color-invertedCustom background color for the inverted variant (default: var(--dds-background-brand-base-inverted))
--dds-badge-color-invertedCustom text color for the inverted variant (default: var(--dds-text-neutral-inverted))
How to Use CSS Custom Properties

CSS custom properties (CSS variables) can be set directly on the component or in your stylesheet:

Method 1: Inline styles (Quick customization)

<dap-ds-dap-badge
  style="--dds-badge-padding-sm: value; --dds-badge-padding-lg: value;">
  DÁP badge
</dap-ds-dap-badge>

Method 2: CSS classes (Reusable styles)

.my-custom-dap-ds-dap-badge {
  --dds-badge-padding-sm: value;
  --dds-badge-padding-lg: value;
  --dds-badge-border-width: value;
}
<dap-ds-dap-badge class="my-custom-dap-ds-dap-badge">
  DÁP badge
</dap-ds-dap-badge>

Method 3: Global theme customization

/* Apply to all instances */
dap-ds-dap-badge {
  --dds-badge-padding-sm: value;
  --dds-badge-padding-lg: value;
}

CSS custom properties inherit through the Shadow DOM, making them perfect for theming. Changes apply immediately without rebuilding.