Official website banner

The official website banner is a banner that displays that the website is an official government website.

Examples
<dap-ds-official-website-banner headingLevel="1">
</dap-ds-official-website-banner>
Importing
import { DapDSOfficialWebsiteBanner } from 'dap-design-system'
Importing React
import { DapDSOfficialWebsiteBannerReact } from 'dap-design-system/react'
Tree-Shakeable Imports

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

import { DapDSOfficialWebsiteBanner } from 'dap-design-system/components'
Attributes
PropertyTypeDefaultDescription
size'sm', 'lg'The size of the official website banner. Default is sm.
headingstringThe heading text of the accordion, this will be used as the aria label of the heading also if ariaLabel is not provided
headingLevel1, 2 , 3 , 4 , 5 , 6The heading level of the accordion. Default is 4.
openedbooleanWhether the accordion is opened. Default is false.
iconLocation'left', 'right'The location of the icon. Default is right.
variant'default', 'collapsed' , 'clean' , 'clean-collapsed'The variant of the accordion.
lastItembooleanWhether the accordion is the last item.
Slots
NameDescription
defaultThe content of the accordion.
headingThe heading of the accordion.
icon-openedThe icon when the accordion is opened.
icon-closedThe icon when the accordion is closed.
Events
Event NameDescriptionType
dds-openedEvent fired when the accordion is opened.{void }
dds-closedEvent fired when the accordion is closed.{void }
CSS Parts
Part NameDescription
baseThe main accordion container.
headingThe heading of the accordion.
buttonThe button of the accordion.
contentThe content of the accordion.
content-containerThe container of the accordion content.
icon-wrapperThe icon wrapper of the accordion.
open-iconThe icon when the accordion is opened.
open-icon-baseThe base of the icon when the accordion is opened.
close-iconThe icon when the accordion is closed.
close-icon-baseThe base of the icon when the accordion is closed.
How to Use CSS Parts

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

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

/* Target multiple parts */
.my-custom-dap-ds-official-website-banner::part(base),
.my-custom-dap-ds-official-website-banner::part(heading) {
  /* Shared styles */
}

Example usage:

<dap-ds-official-website-banner class="my-custom-dap-ds-official-website-banner">
  Official website banner
</dap-ds-official-website-banner>
.my-custom-dap-ds-official-website-banner::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-official-banner-background-colorThe background color of the official website banner (default: var(--dds-background-brand-medium-inverted))
--dds-official-banner-text-colorThe text color of the official website banner (default: var(--dds-text-neutral-on-inverted))
--dds-official-banner-heading-hover-colorThe heading hover color of the official website banner (default: var(--dds-background-brand-medium-inverted))
--dds-official-banner-border-radiusThe border radius of the official website banner (default: 0)
--dds-official-banner-icon-colorThe icon color of the official website banner (default: var(--dds-text-neutral-on-inverted))
--dds-official-banner-icon-color-hoverThe icon hover color of the opener icon official website banner (default: var(--dds-text-neutral-on-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-official-website-banner
  style="--dds-official-banner-background-color: value; --dds-official-banner-text-color: value;">
  Official website banner
</dap-ds-official-website-banner>

Method 2: CSS classes (Reusable styles)

.my-custom-dap-ds-official-website-banner {
  --dds-official-banner-background-color: value;
  --dds-official-banner-text-color: value;
  --dds-official-banner-heading-hover-color: value;
}
<dap-ds-official-website-banner class="my-custom-dap-ds-official-website-banner">
  Official website banner
</dap-ds-official-website-banner>

Method 3: Global theme customization

/* Apply to all instances */
dap-ds-official-website-banner {
  --dds-official-banner-background-color: value;
  --dds-official-banner-text-color: value;
}

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