Skip to main content

Header Ready

Header is used to display the logo, primary navigation and utility menus. It’s always visible at the top of the interface and can be configured to show just the logo and a back link.

Header contains your application’s primary navigation items that perform an action when clicked. Each action in the header should navigate to a href or trigger another action like a Modal overlay.

Examples #

Open in new window
<duet-header
language="fi"
region="Pääkaupunkiseutu"
contact="Ota yhteyttä"
skip-to-id="#content"
current-href="/"
>

</duet-header>

<script>
// Select the above navigation component
var header = document.querySelector("duet-header")

// Set the main navigation items
header.items = [
{ label: "Etusivu", href: "/" },
{ label: "Vakuutukset", href: "#" },
{ label: "Vahinkoasiat", href: "#" },
{ label: "Säästöt ja sijoitukset", href: "#" },
{ label: "Laskut", href: "#", badge: true },
{ label: "Viestit", href: "#" },
]

// Set the contact menu items
header.contactItems = [
{ label: "Lähetä viesti", href: "/viestit/laheta" },
{ label: "Avaa chat", href: "/chat/" },
{ label: "Yhteystiedot", href: "/yhteystiedot/", external: true },
]

// Set the language menu items
header.languageItems = [
{ label: "Suomeksi", country: "fi", href: "/?lang=fi" },
{ label: "På Svenska", country: "sv", href: "/?lang=sv" },
{ label: "In English", country: "en", href: "/?lang=en" },
]

// Set label and href for session link
header.session = {
label: "Kirjaudu ulos",
href: "/?logout",
type: "logout",
}

// Set label and href for user profile link
header.user = {
label: "Elina",
href: "/?userId=elina",
}

// Listen for language selection events
header.addEventListener("duetLanguageSelect", function (e) {
console.log("Language selection detected in nav:", e.detail)

// Set document language correctly when changing language
e.detail.originalEvent.preventDefault()
document.documentElement.setAttribute("lang", e.detail.data.country)
})
</script>
Open in new window
<duet-header current-href="/" language="en" class="duet-example-without-padding"></duet-header>

<script>
// Select the above navigation component
var header = document.querySelector("duet-header")

// Set the main navigation items
header.items = [
{ label: "Home", href: "/" },
{ label: "Insurances", href: "#" },
{ label: "Claims", href: "#" },
{ label: "Investments", href: "#" },
{ label: "Invoices", href: "#" },
{ label: "Messages", href: "#", badge: true },
]

// Set the language menu items
header.languageItems = [
{ label: "Suomeksi", country: "fi", href: "/?lang=fi" },
{ label: "På Svenska", country: "sv", href: "/?lang=sv" },
{ label: "In English", country: "en", href: "/?lang=en" },
]

// Set label and href for session link
header.session = {
label: "Log out",
href: "/?logout",
type: "logout",
}

// Set label and href for user profile link
header.user = {
label: "William",
href: "/?userId=william",
}
</script>
Open in new window
<duet-header language="fi"></duet-header>

<script>
// Select the above navigation component
var header = document.querySelector("duet-header")

header.logoHref = null

// Set label and href for back link
header.back = {
label: "Takaisin",
href: "/",
}
</script>
Open in new window
<duet-header
language="fi"
region="Pääkaupunkiseutu"
contact="Ota yhteyttä"
skip-to-id="#content"
current-href="/"
items='[
{ "label": "Etusivu","href": "/" },
{ "label": "Vakuutukset", "href": "#" },
{ "label": "Vahinkoasiat", "href": "#" },
{ "label": "Säästöt ja sijoitukset", "href": "#" },
{ "label": "Laskut", "href": "#", "badge": true },
{ "label": "Viestit", "href": "#" }
]'

language-items='[
{ "label": "Suomeksi", "country": "fi", "href": "/?lang=fi" },
{ "label": "På Svenska", "country": "sv", "href": "/?lang=sv" },
{ "label": "In English", "country": "en", "href": "/?lang=en" }
]'

contact-items='[
{ "label": "Lähetä viesti", "href": "/viestit/laheta" },
{ "label": "Avaa chat", "href": "/chat/" },
{ "label": "Yhteystiedot", "href": "/yhteystiedot/", "external": true }
]'

session='{ "label": "Kirjaudu ulos", "href": "/?logout", "type": "logout" }'
user='{ "label": "Elina", "href": "/?userId=elina" }'
>

</duet-header>
Open in new window
<duet-header
language="fi"
skip-to-id="#content"
current-href="/"
language-items='[
{ "label": "Suomeksi", "country": "fi", "href": "/?lang=fi" },
{ "label": "På Svenska", "country": "sv", "href": "/?lang=sv" },
{ "label": "In English", "country": "en", "href": "/?lang=en" }
]'

session='{ "label": "Kirjaudu ulos", "href": "/?logout", "type": "logout" }'
>

<duet-button
slot="logo-utility"
margin="none"
size="small"
color="color-secondary"
variation="plain"
icon="action-arrow-left-small"
icon-size="small"
url="/"
>Poistu</duet-button
>

</duet-header>
Open in new window
<div class="duet-example-without-padding">
<duet-header
language="fi"
contact="Ota yhteyttä"
skip-to-id="#content"
current-href="/"
>

</duet-header>
</div>
<duet-hero
heading="Laskut"
description="Tällä sivulla näet vakuutuksiisi liittyvät laskut. Voit myös
vaihtaa e-laskutukseen klikkaamalla&nbsp;alta."

image="https://cdn.duetds.com/api/assets/illustrations/placeholder-light.svg"
button-label="Vaihda e-laskutukseen"
button-url="#"
>

</duet-hero>
<script>
// Select the above navigation component
var header = document.querySelector("duet-header")

// Set the main navigation items
header.items = [
{ label: "Henkilöasiakkaat", href: "#", active: true, items: [
{ label: "Vakuutukset", href: "#", active: true, items: [
{ label: "Ajoneuvot", href: "#", icon: "category-car" },
{ label: "Koti", href: "#", icon: "category-apartment" },
{ label: "Terveys", href: "#", icon: "category-personal", active: true },
{ label: "Matka", href: "#", icon: "category-travel"},
{ label: "Henki", href: "#", icon: "category-life-insurance"},
{ label: "Eläimet", href: "#", icon: "category-pet"},
{ label: "Metsä", href: "#", icon: "category-forest"},
] },
{ label: "Talous", href: "#", items: [
{ label: "Raha", href: "#", icon: "category-business" },
{ label: "Varallisuus", href: "#", icon: "category-wealth" },
] },
{ label: "Tietoa meistä", href: "#", items: [
{ label: "LähiTapiola", href: "#", icon: "category-union" },
{ label: "Vauraus", href: "#", icon: "category-legal-liability" },
] },
{ label: "Asiakaspalvelu", href: "#", items: [
{ label: "Ota yhteyttä", href: "#", icon: "category-liability-damage" },
{ label: "Lupauksemme", href: "#", icon: "category-motor-boat" },
] },
] },
{ label: "Yritysasiakkaat", href: "#"}
]

// Set the language menu items
header.languageItems = [
{ label: "Suomeksi", country: "fi", href: "/?lang=fi" },
{ label: "På Svenska", country: "sv", href: "/?lang=sv" },
{ label: "In English", country: "en", href: "/?lang=en" },
]

// Set label and href for session link
header.session = {
label: "Kirjaudu",
href: "/?login",
type: "login",
sessionItems: [
{label: "Vakuutukset ja sijoitukset:", items: [
{ label: "Henkilöasiakas", href: "#" },
{ label: "Yritysasiakas", href: "#" }]
},
{items: [{ label: "Rahoitus", href: "#" }]},
{items: [{ label: "Pankkipalvelut", href: "#" }]}
]
}

header.search = {
label: "Hae",
href: "/?hae",
}

// Listen for language selection events
header.addEventListener("duetLanguageSelect", function (e) {
console.log("Language selection detected in nav:", e.detail)

// Set document language correctly when changing language
e.detail.originalEvent.preventDefault()
document.documentElement.setAttribute("lang", e.detail.data.country)
})

// Listen for language selection events
header.addEventListener("duetSessionClick", function (e) {
console.log("Session click detected in nav:", e.detail)
e.detail.originalEvent.preventDefault()
})

// Listen for mobile nav toggle events
header.addEventListener("duetMobileNavToggle", function (e) {
console.log("Mobile nav toggle detected in nav:", e.detail)
e.detail.originalEvent.preventDefault()
})

// duet events
header.addEventListener("duetEvent", function (e) {
console.log("Duet event:", e.detail)
})
</script>
Open in new window
<div class="duet-example-without-padding">
<duet-header
language="fi"
contact="Ota yhteyttä"
skip-to-id="#content"
current-href="/"
>

<div slot="logo-utility" class="mobile-basket">
<style>
.mobile-basket button {
width: 100%;
height: 100%;
display: flex;
align-items: center;
gap: 1rem;
background: #ffffff;
padding: 0.5rem 0.675rem;
border: 1px solid #e1e3e6;
border-radius: 4px;
}

.mobile-basket {
position: absolute;
right: 56px;
}

.mobile-basket span {
background: #e6f2f8;
border-radius: 20rem;
padding: 0.125rem 0.5rem;
font-weight: 400;
font-size: 0.75rem;
}
</style>
<button><duet-icon name="messaging-buy-online" margin="none" size="small"></duet-icon><span>0</span></button>
</div>
<div slot="utility" class="desktop-basket">
<style>
.desktop-basket button {
width: 100%;
height: 100%;
display: flex;
gap: 0.5rem;
align-items: center;
background: #ffffff;
padding: 0.5rem 1rem;
color: rgb(0, 41, 77);
font-weight: 600;
font-size: 0.875rem;
border: 1px solid #e1e3e6;
border-radius: 4px;
}

.desktop-basket {
display: none;
position: absolute;
top: 72px;
right: 72px;
z-index: 700;
}

@media (min-width: 62em) {
.desktop-basket {
display: block;
}
}

.desktop-basket .amount {
background: #e6f2f8;
border-radius: 20rem;
padding: 0.125rem 0.5rem;
font-weight: 400;
font-size: 0.75rem;
}
</style>
<button><duet-icon name="messaging-buy-online" margin="none" size="small"></duet-icon><span>Yhteydenottokori</span><span class="amount">0</span></button>
</div>
</duet-header>
</div>
<duet-hero
heading="Laskut"
description="Tällä sivulla näet vakuutuksiisi liittyvät laskut. Voit myös
vaihtaa e-laskutukseen klikkaamalla&nbsp;alta."

image="https://cdn.duetds.com/api/assets/illustrations/placeholder-light.svg"
button-label="Vaihda e-laskutukseen"
button-url="#"
>

</duet-hero>
<script>
// Select the above navigation component
var header = document.querySelector("duet-header")

// Set the main navigation items
header.items = [
{ label: "Henkilöasiakkaat", href: "#", active: true, items: [
{ label: "Vakuutukset", href: "#", active: true, items: [
{ label: "Ajoneuvot", href: "#", icon: "category-car" },
{ label: "Koti", href: "#", icon: "category-apartment" },
{ label: "Terveys", href: "#", icon: "category-personal", active: true },
{ label: "Matka", href: "#", icon: "category-travel"},
{ label: "Henki", href: "#", icon: "category-life-insurance"},
{ label: "Eläimet", href: "#", icon: "category-pet"},
{ label: "Metsä", href: "#", icon: "category-forest"},
] },
{ label: "Talous", href: "#", items: [
{ label: "Raha", href: "#", icon: "category-business" },
{ label: "Varallisuus", href: "#", icon: "category-wealth" },
] },
{ label: "Tietoa meistä", href: "#", items: [
{ label: "LähiTapiola", href: "#", icon: "category-union" },
{ label: "Vauraus", href: "#", icon: "category-legal-liability" },
] },
{ label: "Asiakaspalvelu", href: "#", items: [
{ label: "Ota yhteyttä", href: "#", icon: "category-liability-damage" },
{ label: "Lupauksemme", href: "#", icon: "category-motor-boat" },
] },
] },
{ label: "Yritysasiakkaat", href: "#"}
]

// Set the language menu items
header.languageItems = [
{ label: "Suomeksi", country: "fi", href: "/?lang=fi" },
{ label: "På Svenska", country: "sv", href: "/?lang=sv" },
{ label: "In English", country: "en", href: "/?lang=en" },
]

// Set label and href for session link
header.session = {
label: "Kirjaudu",
href: "/?login",
type: "login",
}

header.search = {
label: "Hae",
href: "/?hae",
}

// Listen for language selection events
header.addEventListener("duetLanguageSelect", function (e) {
console.log("Language selection detected in nav:", e.detail)

// Set document language correctly when changing language
e.detail.originalEvent.preventDefault()
document.documentElement.setAttribute("lang", e.detail.data.country)
})

// Listen for language selection events
header.addEventListener("duetSessionClick", function (e) {
console.log("Session click detected in nav:", e.detail)
e.detail.originalEvent.preventDefault()
})
</script>
Open in new window
<style>
duet-header {
position: static;
}
</style>

<div class="duet-example-without-padding">
<duet-header
language="fi"
contact="Ota yhteyttä"
skip-to-id="#content"
current-href="/"
>
</duet-header>
<duet-breadcrumbs>
<duet-breadcrumb href="#" icon="damage-home"></duet-breadcrumb>
<duet-breadcrumb href="#">Edut ja kampanjat</duet-breadcrumb>
<duet-breadcrumb href="#">LähiTapiola Pirkanmaa</duet-breadcrumb>
</duet-breadcrumbs>
<duet-hero
heading="Laskut"
description="Tällä sivulla näet vakuutuksiisi liittyvät laskut. Voit myös
vaihtaa e-laskutukseen klikkaamalla&nbsp;alta."

image="https://cdn.duetds.com/api/assets/illustrations/placeholder-light.svg"
button-label="Vaihda e-laskutukseen"
button-url="#"
>

</duet-hero>
</div>
<script>
// Select the above navigation component
var header = document.querySelector("duet-header")

// Set the main navigation items
header.items = [
{ label: "Henkilöasiakkaat", href: "#", active: true, items: [
{ label: "Vakuutukset", href: "#", active: true, items: [
{ label: "Ajoneuvot", href: "#", icon: "category-car" },
{ label: "Koti", href: "#", icon: "category-apartment" },
{ label: "Terveys", href: "#", icon: "category-personal", active: true },
{ label: "Matka", href: "#", icon: "category-travel"},
{ label: "Henki", href: "#", icon: "category-life-insurance"},
{ label: "Eläimet", href: "#", icon: "category-pet"},
{ label: "Metsä", href: "#", icon: "category-forest"},
] },
{ label: "Talous", href: "#", items: [
{ label: "Raha", href: "#", icon: "category-business" },
{ label: "Varallisuus", href: "#", icon: "category-wealth" },
] },
{ label: "Tietoa meistä", href: "#", items: [
{ label: "LähiTapiola", href: "#", icon: "category-union" },
{ label: "Vauraus", href: "#", icon: "category-legal-liability" },
] },
{ label: "Asiakaspalvelu", href: "#", items: [
{ label: "Ota yhteyttä", href: "#", icon: "category-liability-damage" },
{ label: "Lupauksemme", href: "#", icon: "category-motor-boat" },
] },
] },
{ label: "Yritysasiakkaat", href: "#"}
]

// Set the language menu items
header.languageItems = [
{ label: "Suomeksi", country: "fi", href: "/?lang=fi" },
{ label: "På Svenska", country: "sv", href: "/?lang=sv" },
{ label: "In English", country: "en", href: "/?lang=en" },
]

// Set label and href for session link
header.session = {
label: "Kirjaudu",
href: "/?login",
type: "login",
}

header.search = {
label: "Hae",
href: "/?hae",
}

// Listen for language selection events
header.addEventListener("duetLanguageSelect", function (e) {
console.log("Language selection detected in nav:", e.detail)

// Set document language correctly when changing language
e.detail.originalEvent.preventDefault()
document.documentElement.setAttribute("lang", e.detail.data.country)
})

// Listen for language selection events
header.addEventListener("duetSessionClick", function (e) {
console.log("Session click detected in nav:", e.detail)
e.detail.originalEvent.preventDefault()
})
</script>

Properties #

Property Attribute Description Type Default
accessibleI18nLabels -- Adds i18n translations of all internally used textStrings I18nText getLocaleString( this.accessibleI18nLabelsDefaults )
accessibleI18nLabelsDefaults accessible-labels-default Default strings for accessibleI18nLabels string | { fi: I18nText; en: I18nText; sv: I18nText; } { fi: { skipLabel: "Siirry pääsisältöön", changeLanguage: "Vaihda kieltä", activeLanguage: "Suomi valittuna", }, sv: { skipLabel: "Gå till huvudinnehåll", changeLanguage: "Ändra Språk", activeLanguage: "Svenska valt", }, en: { skipLabel: "Skip to main content", changeLanguage: "Change language", activeLanguage: "English selected", }, }
accessibleLabel accessible-label Accessible label that is shown for screen reader users in the mobile navigation toggle. Not visible for normal users. string getLocaleString(this.accessibleLabelDefaults)
accessibleLabelDefaults accessible-label-default Property to change accessibleLabel defaults on the component. normally you would handle these strings on an application level and override accessibleLabel when needed DuetLangObject | string { fi: "Valikko", sv: "Meny", en: "Menu", }
accessibleLabelExternal accessible-label-external Adds accessible label for tooltip that is shown in external link (url & external have both been set) string getLocaleString(this.accessibleLabelExternalDefaults)
accessibleLabelExternalDefaults accessible-label-external-default Property to change accessibleLabelExternal defaults on the component. normally you would handle these strings on an application level and override accessibleLabelExternal when needed DuetLangObject | string DuetStringsExternalDefaults
back back An object that includes mandatory "label" and "href" fields for the back link. Additionally, you can pass an "id" that is added as an HTML identifier for the element. If nothing is passed, back link won’t be shown. NOTE: The back link should be ONLY used in combination with language and logoHref props. any undefined
contact contact Label of the contact menu. If empty, contact menu will be hidden. Note: not available in multilevel headers. string ""
contactItems contact-items An array of items for the contact menu. "label" and "href" are mandatory. Additionally, you can pass an "id" that is added as an HTML identifier for the element, and pass an "external" flag if the link is to open in a new window. any undefined
currentHref current-href The href of the current page item that is shown as “active”. Note: not available in multilevel headers. string "/"
items items An array of items for the main navigation. Items have to include mandatory "label" and "href" fields to work. Additionally, you can pass an "id" that is added as an HTML identifier for the element, "active" boolean that makes item active, "badge" boolean to add notification badge next to the item and "items" array consisting of sub items that are allowed up to three levels. Two and three level menus are deprecated and you should instead use Nav component to create multilevel navigations. any undefined
language language [DEPRECATED] this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing

The currently active language. This setting also changes the logo to match the chosen language.
"en" | "fi" | "sv" getLanguage()
languageItems language-items An array of items for the language menu. If empty, the language menu will be hidden. "label", "country" and "href" are mandatory. Additionally you can pass an "id" that is added as an HTML identifier for the element. any undefined
logoHref logo-href URL that the logo link points to. string "/"
region region Region that is shown next to the logo. If empty, region will be hidden. Note: not available in multilevel header. string ""
search search An object that includes mandatory "label" and "href" fields for the search link. Additionally, you can pass an "id" that is added as an HTML identifier for the element. If nothing is passed, this link won’t be shown. any undefined
session session An object that includes mandatory "label", "href" and "type" fields for the session login/logout link. Additionally, you can pass an "id" that is added as an HTML identifier for the element. If nothing is passed, this link won’t be shown. any undefined
skipToId skip-to-id The ID of the element where "skip to content" link should take the user. If empty, the functionality won’t be rendered in the DOM. string ""
theme theme Theme of the header. "" | "default" | "turva" ""
user user An object that includes mandatory "label" and "href" fields for the user profile link. Additionally, you can pass an "id" that is added as an HTML identifier for the element. If nothing is passed, user won’t be shown. Note: not available in multilevel headers. any undefined

Events #

Event Description Type
duetAnalytics Event raised when an items with an associated analytics ID is clicked. Analytics ID can be accessed via event.detail.analyticsId CustomEvent<{ analyticsId: string; component: "duet-header"; }>
duetBackClick Event raised when a user has clicked the back button. You can prevent the default browser functionality by calling event.detail.originalEvent.preventDefault() inside your listener. Additionally, the passed data is available via event.detail.data. CustomEvent<{ originalEvent: Event; data: DuetHeaderItem | DuetHeaderLanguageItem | DuetHeaderSession; component: "duet-header"; }>
duetChange [DEPRECATED] in favour of more specific events like duetLogoClick. Callback for when a user is about to navigate to another page. You can prevent the default browser functionality by calling event.detail.originalEvent.preventDefault() inside your listener. Additionally, the passed data is available via event.detail.data.

CustomEvent<{ originalEvent: Event; data: DuetHeaderItem | DuetHeaderLanguageItem | DuetHeaderSession; component: "duet-header"; }>
duetContactClick Event raised when a user has clicked an option from the contact dropdown. You can prevent the default browser functionality by calling event.detail.originalEvent.preventDefault() inside your listener. Additionally, the passed data is available via event.detail.data. CustomEvent<{ originalEvent: Event; data: DuetHeaderItem | DuetHeaderLanguageItem | DuetHeaderSession; component: "duet-header"; }>
duetEvent General event stream for the following events: item: onMouseEnter, onTouchDown; menuItem: onMouseEnter, onTouchDown;. You can prevent the default browser functionality by calling event.detail.originalEvent.preventDefault() inside your listener. Additionally, the passed data is available via event.detail.data. CustomEvent<{ originalEvent: Event; data: DuetHeaderItem | DuetHeaderLanguageItem | DuetHeaderSession; component: "duet-header"; }>
duetItemClick Event raised when a user has clicked a menu item. You can prevent the default browser functionality by calling event.detail.originalEvent.preventDefault() inside your listener. Additionally, the passed data is available via event.detail.data. CustomEvent<{ originalEvent: Event; data: DuetHeaderItem | DuetHeaderLanguageItem | DuetHeaderSession; component: "duet-header"; }>
duetLanguageSelect Event raised when a user has selected a language from the language dropdown. You can prevent the default browser functionality by calling event.detail.originalEvent.preventDefault() inside your listener. Additionally, the passed data is available via event.detail.data. CustomEvent<{ originalEvent: Event; data: DuetHeaderItem | DuetHeaderLanguageItem | DuetHeaderSession; component: "duet-header"; }>
duetLogoClick Event raised when a user has clicked the logo. You can prevent the default browser functionality by calling event.detail.originalEvent.preventDefault() inside your listener. Additionally, the passed data is available via event.detail.data. CustomEvent<{ originalEvent: Event; data: DuetHeaderItem | DuetHeaderLanguageItem | DuetHeaderSession; component: "duet-header"; }>
duetMobileNavToggle Event raised mobile navigation is toggled. event.detail.open shows the current status of the navigation. CustomEvent<{ originalEvent: Event; open: boolean; }>
duetSearchClick Event for when a user has clicked the search link. You can prevent the default browser functionality by calling event.detail.originalEvent.preventDefault() inside your listener. Additionally, the passed data is available via event.detail.data. CustomEvent<{ originalEvent: Event; data: DuetHeaderItem | DuetHeaderLanguageItem | DuetHeaderSession; component: "duet-header"; }>
duetSessionClick Event for when a user has clicked the session link. You can prevent the default browser functionality by calling event.detail.originalEvent.preventDefault() inside your listener. Additionally, the passed data is available via event.detail.data. CustomEvent<{ originalEvent: Event; data: DuetHeaderItem | DuetHeaderLanguageItem | DuetHeaderSession; component: "duet-header"; }>
duetSkipClick Event raised when a user has clicked the "skip to content" button. You can prevent the default browser functionality by calling event.detail.originalEvent.preventDefault() inside your listener. Additionally, the passed data is available via event.detail.data. CustomEvent<{ originalEvent: Event; data: DuetHeaderItem | DuetHeaderLanguageItem | DuetHeaderSession; component: "duet-header"; }>
duetUserClick Event raised when a user has clicked the user link. You can prevent the default browser functionality by calling event.detail.originalEvent.preventDefault() inside your listener. Additionally, the passed data is available via event.detail.data. CustomEvent<{ originalEvent: Event; data: DuetHeaderItem | DuetHeaderLanguageItem | DuetHeaderSession; component: "duet-header"; }>

Methods #

closeMenus(moveFocusToButton?: boolean) => Promise<void> #

Closes all dropdown menus in header when called.

Parameters #

Name Type Description
moveFocusToButton boolean

Returns #

Type: Promise<void>

setFocus(options?: FocusOptions) => Promise<void> #

Sets focus on the specified duet-header. Use this method instead of the global
header.focus().

Parameters #

Name Type Description
options FocusOptions

Returns #

Type: Promise<void>

Slots #

Slot Description
"logo-utility" A slot to place elements alongside the logo. This takes precedence over the region prop. Note: not available in multilevel header.
"utility" A slot for utilities, such as a notification drawer or shopping basket.

Shadow Parts #

Part Description
"header" piercing selector for styling the header element.

Usage #

This section includes guidelines for designers and developers about the usage of this component in different contexts.

When to use #

  • Header is used to display the logo, primary navigation and utility menus.
  • Always visible at the top of the interface.

When not to use #

  • Inside HTML header element as Duet Header already uses it internally.

Accessibility #

This component has been validated to meet the WCAG 2.1 AA accessibility guidelines. You can find additional information regarding accessibility of this component below.

Keyboard support #

Additional considerations #


Integration

For integration, event and theming guidelines, please see Using Components. This documentation explains how to implement and use Duet’s components across different technologies like Angular, React or Vanilla JavaScript.

Integration guidelines


Tutorials

Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:

Tutorials

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes

Tutorials

Usage With Markdown


Troubleshooting

If you experience any issues while using a component, please head over to the Support page for more guidelines and help.