Skip to main content

Slideout Ready

Slideout is component to be used to create slideouts.

Examples #

Open in new window
<duet-menu-bar-button icon="navigation-menu" id="main-navigation-opener"></duet-menu-bar-button>
<duet-slideout opener="main-navigation-opener">
<duet-slideout-panel active label-size="large">
<span slot="label">Vakuutukset</span>
<duet-slideout-panel-dropdown icon="category-car">
<span slot="label">Ajoneuvot</span>
<duet-slideout-link>Auto</duet-slideout-link>
<duet-slideout-link>Pakettiauto</duet-slideout-link>
<duet-slideout-link>Moottoripyörä</duet-slideout-link>
<duet-slideout-link>Mopo</duet-slideout-link>
<duet-slideout-link>Kaikki ajoneuvot</duet-slideout-link>
</duet-slideout-panel-dropdown>
<duet-slideout-panel-dropdown icon="category-personal">
<span slot="label">Koti</span>
<duet-slideout-link>Kotivakuutus</duet-slideout-link>
<duet-slideout-link>Mökkivakuutus</duet-slideout-link>
<duet-slideout-link>Vuokralaisen kotivakuutus</duet-slideout-link>
<duet-slideout-link>Vuokranantajan vakuutus</duet-slideout-link>
</duet-slideout-panel-dropdown>
<duet-slideout-panel-dropdown icon="category-personal">
<span slot="label">Terveys</span>
<duet-slideout-link active>Tapaturmavakuutus</duet-slideout-link>
<duet-slideout-link>Sairaskuluvakuutus</duet-slideout-link>
<duet-slideout-link>Urheiluvakuutus</duet-slideout-link>
<duet-slideout-link>Vauvavakuutus</duet-slideout-link>
<duet-slideout-link>Lapsivakuutus</duet-slideout-link>
<duet-slideout-link>Työkyvyttömyysvakuutus</duet-slideout-link>
<duet-slideout-link>Kaikki henkilövakuutukset</duet-slideout-link>
</duet-slideout-panel-dropdown>
<duet-slideout-link active icon="category-travel">Matka</duet-slideout-link>
<duet-slideout-link icon="category-life-insurance">Henki</duet-slideout-link>
<duet-slideout-panel-dropdown icon="category-pet">
<span slot="label">Eläin</span>
<duet-slideout-link>Koiravakuutus</duet-slideout-link>
<duet-slideout-link>Kissavakuutus</duet-slideout-link>
<duet-slideout-link>Hevosvakuutus</duet-slideout-link>
</duet-slideout-panel-dropdown>
<duet-slideout-link icon="category-forest">Metsä</duet-slideout-link>
</duet-slideout-panel>
<duet-slideout-link size="large">Sijoittaminen</duet-slideout-link>
<duet-slideout-link size="large">Rahoitus</duet-slideout-link>
<duet-slideout-link size="large">Asiakkaalle</duet-slideout-link>
<duet-spacer size="large"></duet-spacer>
<duet-slideout-link size="medium" icon="category-block" active>Kirjautuneen palvelut</duet-slideout-link>
<duet-slideout-link size="medium" icon="form-search">Hae sivustolta</duet-slideout-link>
<duet-divider></duet-divider>
<duet-slideout-link size="small" active>Henkilöasiakkaat</duet-slideout-link>
<duet-slideout-link size="small">Yritysasiakkaat</duet-slideout-link>
<duet-slideout-link size="small">Maa- ja metsätilat</duet-slideout-link>
<duet-slideout-link size="small">Yhtiöryhmä</duet-slideout-link>
<duet-spacer size="medium"></duet-spacer>
<duet-slideout-lang>
<duet-slideout-link size="small" active>Suomi</duet-slideout-link>
<duet-slideout-link size="small">Svenska</duet-slideout-link>
<duet-slideout-link size="small">English</duet-slideout-link>
</duet-slideout-lang>
</duet-slideout>
Open in new window
<duet-menu-bar-button accessible-label="Avaa valikko" icon="navigation-menu" id="main-navigation-opener"  accessible-popup="true" accessible-expanded="false"></duet-menu-bar-button>
<duet-slideout>
<duet-slideout-panel active label-size="large">
<span slot="label">Vakuutukset</span>
<duet-slideout-panel-dropdown icon="category-car">
<span slot="label">Ajoneuvot</span>
<duet-slideout-link>Auto</duet-slideout-link>
<duet-slideout-link>Pakettiauto</duet-slideout-link>
<duet-slideout-link>Moottoripyörä</duet-slideout-link>
<duet-slideout-link>Mopo</duet-slideout-link>
<duet-slideout-link>Kaikki ajoneuvot</duet-slideout-link>
</duet-slideout-panel-dropdown>
<duet-slideout-panel-dropdown icon="category-personal">
<span slot="label">Koti</span>
<duet-slideout-link>Kotivakuutus</duet-slideout-link>
<duet-slideout-link>Mökkivakuutus</duet-slideout-link>
<duet-slideout-link>Vuokralaisen kotivakuutus</duet-slideout-link>
<duet-slideout-link>Vuokranantajan vakuutus</duet-slideout-link>
</duet-slideout-panel-dropdown>
<duet-slideout-panel-dropdown icon="category-personal">
<span slot="label">Terveys</span>
<duet-slideout-link active>Tapaturmavakuutus</duet-slideout-link>
<duet-slideout-link>Sairaskuluvakuutus</duet-slideout-link>
<duet-slideout-link>Urheiluvakuutus</duet-slideout-link>
<duet-slideout-link>Vauvavakuutus</duet-slideout-link>
<duet-slideout-link>Lapsivakuutus</duet-slideout-link>
<duet-slideout-link>Työkyvyttömyysvakuutus</duet-slideout-link>
<duet-slideout-link>Kaikki henkilövakuutukset</duet-slideout-link>
</duet-slideout-panel-dropdown>
<duet-slideout-link active icon="category-travel">Matka</duet-slideout-link>
<duet-slideout-link icon="category-life-insurance">Henki</duet-slideout-link>
<duet-slideout-panel-dropdown icon="category-pet">
<span slot="label">Eläin</span>
<duet-slideout-link>Koiravakuutus</duet-slideout-link>
<duet-slideout-link>Kissavakuutus</duet-slideout-link>
<duet-slideout-link>Hevosvakuutus</duet-slideout-link>
</duet-slideout-panel-dropdown>
<duet-slideout-link icon="category-forest">Metsä</duet-slideout-link>
</duet-slideout-panel>
<duet-slideout-link size="large">Sijoittaminen</duet-slideout-link>
<duet-slideout-link size="large">Rahoitus</duet-slideout-link>
<duet-slideout-link size="large">Asiakkaalle</duet-slideout-link>
<duet-spacer size="large"></duet-spacer>
<duet-slideout-link size="medium" icon="category-block" active>Kirjautuneen palvelut</duet-slideout-link>
<duet-slideout-link size="medium" icon="form-search">Hae sivustolta</duet-slideout-link>
<duet-divider></duet-divider>
<duet-slideout-link size="small" active>Henkilöasiakkaat</duet-slideout-link>
<duet-slideout-link size="small">Yritysasiakkaat</duet-slideout-link>
<duet-slideout-link size="small">Maa- ja metsätilat</duet-slideout-link>
<duet-slideout-link size="small">Yhtiöryhmä</duet-slideout-link>
<duet-spacer size="medium"></duet-spacer>
<duet-slideout-lang>
<duet-slideout-link size="small" active>Suomi</duet-slideout-link>
<duet-slideout-link size="small">Svenska</duet-slideout-link>
<duet-slideout-link size="small">English</duet-slideout-link>
</duet-slideout-lang>
</duet-slideout>

<script>
var loginSlideout = document.querySelector("duet-slideout")
var loginNavigationOpener = document.querySelector("#main-navigation-opener")
loginNavigationOpener.addEventListener("click", function (e) {
e.preventDefault()
loginSlideout.show()
})
</script>
Open in new window
<duet-toolbar-link variation="negative" id="desktop-search-opener" href="#search" icon="form-search">Hae</duet-toolbar-link>
<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></duet-input>
</div>
<div>
<duet-label>Usein haettua</duet-label>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#">Autovakuutus</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#">Lapsiturva</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#">Rahastosäästäminen</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#">Henkivakuutus</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="navigation-arrow-right" leading-icon-color="primary" url="#">Varainhoito</duet-popup-menu-item>
</div>
<duet-divider></duet-divider>
<div>
<duet-label color="gray-darker">Ehdotetut haut</duet-label>
<duet-popup-menu-item leading-icon="form-search" leading-icon-color="primary"><b>auto</b>vakuutus</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="form-search" leading-icon-color="primary">sähkö<b>auto</b>n vakuutus</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="form-search" leading-icon-color="primary"><b>auto</b>maattinen korvauskäsittely</duet-popup-menu-item>
<duet-popup-menu-item leading-icon="form-search" leading-icon-color="primary"><b>auto</b>tie</duet-popup-menu-item>
</div>
<duet-spacer size="large"></duet-spacer>
<div>
<duet-label color="gray-darker">Hakutulokset termillä 'auto' (93)</duet-label>
</div>
</duet-slideout>

Properties #

Property Attribute Description Type Default
accessibleRole accessible-role Role of the slot's container. By default this is menubar and the slideout should by default contain menuitems. string "menubar"
backgroundColor background-color Background color. Use one of the color tokens. string "gray-lightest"
open open Open boolean false
opener opener Id of the DuetMenuBarButton or DuetButton that opens the menu. string undefined
theme theme Theme. "" | "default" | "turva" ""

Events #

Event Description Type
duetSlideoutEvent Event raised when the menu has been opened. 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: { element: HTMLElement; open: boolean; }; component: "duet-slideout"; }>

Methods #

hide() => Promise<void> #

Hides the slideout dialog and puts focus back to the original element
that triggered the slideout (if we’re still in the same view).

Returns #

Type: Promise<void>

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

Sets focus. Use this method instead of the global focus().

Parameters #

Name Type Description
options FocusOptions

Returns #

Type: Promise<void>

show() => Promise<void> #

Shows the slideout. Additionally saves the element (DuetButton or DuetMenuBarButton) that triggered
the slideout so that focus can be moved back to this specific element when
the slideout dialog is closed.

Returns #

Type: Promise<void>

toggle() => Promise<void> #

Toggles the slideout.

Returns #

Type: Promise<void>

Slots #

Slot Description
"sticky-header" Content will be fixed to the top of the modal when scrolling.

Usage #

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

When to use #

  • When you are using Nav and want to fill its slots with a slideout menu.

When not to use #

  • If you are not using Nav.

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.