Skip to main content

Toolbar Ready

Toolbar is component that is used with Toolbar items to create top navigation area.

Examples #

Open in new window
<duet-toolbar accessible-label="Secondary">
<div slot="left">
<duet-toolbar-item url="#henkiloasiakkaat" active>Henkilöasiakkaat</duet-toolbar-item>
<duet-toolbar-item url="#yritysasiakkaat">Yritysasiakkaat</duet-toolbar-item>
<duet-toolbar-item url="#maatila-asiakkaat">Maatila-asiakkaat</duet-toolbar-item>
<duet-toolbar-item leading-icon="navigation-language" id="toolbar-item-yhtioryhma">Yhtiöryhmä</duet-toolbar-item>
<duet-popup-menu controller="toolbar-item-yhtioryhma" accessible-role="list" skip-teleport>
<duet-popup-menu-item accessible-role="listitem">Valinta</duet-popup-menu-item>
<duet-popup-menu-item accessible-role="listitem">Valinta</duet-popup-menu-item>
<duet-popup-menu-item accessible-role="listitem">Valinta</duet-popup-menu-item>
</duet-popup-menu>
</div>
<div slot="right">
<duet-toolbar-item id="desktop-search-opener" url="#search" icon="form-search">Hae</duet-toolbar-item>
<duet-slideout opener="desktop-search-opener" accessible-role="generic">
<div slot="sticky-header">
<duet-grid alignment="center" style="gap: var(--space-small)">
<duet-icon name="form-search" size="medium" margin="none"></duet-icon>
<duet-heading visual-level="h3" fixed-size margin="none">Haku</duet-heading>
</duet-grid>
<duet-spacer></duet-spacer>
<duet-input type="text" expand label="Haku" label-hidden clear="true"></duet-input>
</div>
<duet-spacer size="x-small"></duet-spacer>
<div>
<duet-heading level="h3" visual-level="h6">Usein haettua</duet-heading>
<div role="list">
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#" accessible-role="listitem">Autovakuutus</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#" accessible-role="listitem">Lapsiturva</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#" accessible-role="listitem">Rahastosäästäminen</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#" accessible-role="listitem">Henkivakuutus</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#" accessible-role="listitem">Varainhoito</duet-popup-menu-item>
</div>
</div>
<duet-divider></duet-divider>
<div>
<duet-heading level="h3" visual-level="h6" color="gray-darker">Ehdotetut haut</duet-heading>
<div role="list">
<duet-popup-menu-item leading-icon="form-search" leading-icon-color="primary" accessible-role="listitem"><b>auto</b>vakuutus</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="form-search" leading-icon-color="primary" accessible-role="listitem">sähkö<b>auto</b>n vakuutus</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="form-search" leading-icon-color="primary" accessible-role="listitem"><b>auto</b>maattinen korvauskäsittely</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="form-search" leading-icon-color="primary" accessible-role="listitem"><b>auto</b>tie</duet-popup-menu-item>
</div>
</div>
<duet-spacer size="large"></duet-spacer>
<div>
<duet-heading level="h3" visual-level="h6" color="gray-darker">Hakutulokset termillä 'auto' (93)</duet-heading>
<ul style="list-style: none; padding: 0;">
<li style="padding: var(--space-medium) 0;">
<duet-button url="#" variation="plain" margin="none" padding="none" fixed>Autovakuutus</duet-button>
<duet-paragraph margin="none">Halvin autovakuutus ei aina ole järkevin vaihtoehto. Suosittelemme vakuutusten sisällön vertailua ja huomioimaan erityisesti...</duet-paragraph>
<duet-spacer size="xx-small"></duet-spacer>
<duet-breadcrumbs variation="plain" color="gray-darker">
<span><duet-breadcrumb icon="">Henkilöasiakas</duet-breadcrumb></span>
<span><duet-breadcrumb >Vakuutukset</duet-breadcrumb></span>
<span><duet-breadcrumb>Ajoneuvot</duet-breadcrumb></span>
<span><duet-breadcrumb>Autovakuutus</duet-breadcrumb></span>
</duet-breadcrumbs>
</li>
</ul>
</div>
</duet-slideout>
<duet-toolbar-item accessible-label="Valitse kieli" leading-icon="navigation-language" id="toolbar-item-language">FI</duet-toolbar-item>
<duet-popup-menu controller="toolbar-item-language" accessible-role="list" skip-teleport>
<duet-popup-menu-item accessible-role="listitem" accessible-label="Vaihda kieli suomeksi" active>Suomeksi</duet-popup-menu-item>
<duet-popup-menu-item accessible-role="listitem" accessible-label="Byt språk till svenska" target-language="sv">På Svenska</duet-popup-menu-item>
<duet-popup-menu-item accessible-role="listitem" accessible-label="Change language to English" target-language="en">In English</duet-popup-menu-item>
</duet-popup-menu>
</div>
</duet-toolbar>
Open in new window
<duet-toolbar accessible-label="Secondary" variation="negative">
<div slot="left">
<duet-toolbar-item variation="negative" url="#henkiloasiakkaat" active>Henkilöasiakkaat</duet-toolbar-item>
<duet-toolbar-item variation="negative" url="#yritysasiakkaat">Yritysasiakkaat</duet-toolbar-item>
<duet-toolbar-item variation="negative" url="#maatila-asiakkaat">Maatila-asiakkaat</duet-toolbar-item>
<duet-toolbar-item variation="negative" leading-icon="navigation-language" id="toolbar-item-yhtioryhma">Yhtiöryhmä</duet-toolbar-item>
<duet-popup-menu controller="toolbar-item-yhtioryhma" accessible-role="list" skip-teleport>
<duet-popup-menu-item accessible-role="listitem">Valinta</duet-popup-menu-item>
<duet-popup-menu-item accessible-role="listitem">Valinta</duet-popup-menu-item>
<duet-popup-menu-item accessible-role="listitem">Valinta</duet-popup-menu-item>
</duet-popup-menu>
</div>
<div slot="right">
<duet-toolbar-item variation="negative" id="desktop-search-opener" url="#search" icon="form-search">Hae</duet-toolbar-item>
<duet-slideout opener="desktop-search-opener" accessible-role="generic">
<div slot="sticky-header">
<duet-grid alignment="center" style="gap: var(--space-small)">
<duet-icon name="form-search" size="medium" margin="none"></duet-icon>
<duet-heading visual-level="h3" fixed-size margin="none">Haku</duet-heading>
</duet-grid>
<duet-spacer></duet-spacer>
<duet-input type="text" expand label="Haku" label-hidden clear="true"></duet-input>
</div>
<duet-spacer size="x-small"></duet-spacer>
<div>
<duet-heading level="h3" visual-level="h6">Usein haettua</duet-heading>
<div role="list">
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#" accessible-role="listitem">Autovakuutus</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#" accessible-role="listitem">Lapsiturva</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#" accessible-role="listitem">Rahastosäästäminen</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#" accessible-role="listitem">Henkivakuutus</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#" accessible-role="listitem">Varainhoito</duet-popup-menu-item>
</div>
</div>
<duet-divider></duet-divider>
<div>
<duet-heading level="h3" visual-level="h6" color="gray-darker">Ehdotetut haut</duet-heading>
<div role="list">
<duet-popup-menu-item leading-icon="form-search" leading-icon-color="primary" accessible-role="listitem"><b>auto</b>vakuutus</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="form-search" leading-icon-color="primary" accessible-role="listitem">sähkö<b>auto</b>n vakuutus</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="form-search" leading-icon-color="primary" accessible-role="listitem"><b>auto</b>maattinen korvauskäsittely</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="form-search" leading-icon-color="primary" accessible-role="listitem"><b>auto</b>tie</duet-popup-menu-item>
</div>
</div>
<duet-spacer size="large"></duet-spacer>
<div>
<duet-heading level="h3" visual-level="h6" color="gray-darker">Hakutulokset termillä 'auto' (93)</duet-heading>
<ul style="list-style: none; padding: 0;">
<li style="padding: var(--space-medium) 0;">
<duet-button url="#" variation="plain" margin="none" padding="none" fixed>Autovakuutus</duet-button>
<duet-paragraph margin="none">Halvin autovakuutus ei aina ole järkevin vaihtoehto. Suosittelemme vakuutusten sisällön vertailua ja huomioimaan erityisesti...</duet-paragraph>
<duet-spacer size="xx-small"></duet-spacer>
<duet-breadcrumbs variation="plain" color="gray-darker">
<span><duet-breadcrumb icon="">Henkilöasiakas</duet-breadcrumb></span>
<span><duet-breadcrumb >Vakuutukset</duet-breadcrumb></span>
<span><duet-breadcrumb>Ajoneuvot</duet-breadcrumb></span>
<span><duet-breadcrumb>Autovakuutus</duet-breadcrumb></span>
</duet-breadcrumbs>
</li>
</ul>
</div>
</duet-slideout>
<duet-toolbar-item variation="negative" accessible-label="Valitse kieli" leading-icon="navigation-language" id="toolbar-item-language">FI</duet-toolbar-item>
<duet-popup-menu controller="toolbar-item-language" accessible-role="list" skip-teleport>
<duet-popup-menu-item accessible-role="listitem" accessible-label="Vaihda kieli suomeksi" active>Suomeksi</duet-popup-menu-item>
<duet-popup-menu-item accessible-role="listitem" accessible-label="Byt språk till svenska" target-language="sv">På Svenska</duet-popup-menu-item>
<duet-popup-menu-item accessible-role="listitem" accessible-label="Change language to English" target-language="en">In English</duet-popup-menu-item>
</duet-popup-menu>
</div>
</duet-toolbar>

Properties #

Property Attribute Description Type Default
accessibleLabel accessible-label Adds accessible label for the button that is only shown for screen readers. Typically, this label text replaces the visible text on the button for users who use assistive technology. string undefined
theme theme Theme. "" | "default" | "turva" ""
variation variation Variation. "default" | "negative" "default"

Slots #

Slot Description
"left" Slot for content in left side.
"right" Slot for content in right side.

Usage #

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

When to use #

  • When you need a bar with utils and tools in it.

When not to use #

  • Don't use it on its own without filling its slots with items.

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.


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.