Configurator
<oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-cfg">Snackbar zeigen</oc-button-v1>
<oc-snackbar-v1 id="snackbar-cfg" message="Der Artikel wurde von deinem Merkzettel entfernt." auto-dismiss="false"><oc-link-v2 variant="inverted" as-button slot="actions">Rückgängig machen</oc-link-v2></oc-snackbar-v1>Usage
Anatomy

Variants
The background color of the snackbar can be adjusted. Therefore you should use semantic design tokens with the prefix "$oc-semantic-color-background-strong-". If you want to use other colors please check with the design system team before doing so.
Press a button: the snackbar appears at the bottom of the window
HTML
<oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-bg-default">Standard</oc-button-v1>
<oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-bg-success">Grün (success)</oc-button-v1>
<oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-bg-error">Rot (error)</oc-button-v1>
<oc-snackbar-v1 id="snackbar-bg-default" message="Deine Änderungen wurden gespeichert." auto-dismiss="false"><oc-link-v2 variant="inverted" as-button slot="actions">Ansehen</oc-link-v2></oc-snackbar-v1>
<oc-snackbar-v1 id="snackbar-bg-success" message="Deine Änderungen wurden gespeichert." auto-dismiss="false" style="--background-color: var(--oc-semantic-color-background-strong-success)"><oc-link-v2 variant="inverted" as-button slot="actions">Ansehen</oc-link-v2></oc-snackbar-v1>
<oc-snackbar-v1 id="snackbar-bg-error" message="Deine Änderungen wurden gespeichert." auto-dismiss="false" style="--background-color: var(--oc-semantic-color-background-strong-error)"><oc-link-v2 variant="inverted" as-button slot="actions">Ansehen</oc-link-v2></oc-snackbar-v1>Behavior
States
The snackbar has no own states. It uses the states of link and icon button.
Open it, then hover, press and tab through the action and the close button
HTML
<oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-states">Snackbar zeigen</oc-button-v1></div>
<oc-snackbar-v1 id="snackbar-states" message="Der Artikel wurde entfernt." auto-dismiss="false"><oc-link-v2 variant="inverted" as-button slot="actions">Rückgängig machen</oc-link-v2></oc-snackbar-v1>Interaction
The snackbar is triggered by a user's action on other components. Once triggered, it appears at the bottom of the viewport and automatically disappears after five seconds. However, there is an auto-dismiss restriction:
The snackbar will not disappear as long as the mouse hovers over it, the focus is on it, or it is held by touch.
Make sure the snackbar does not disappear automatically when you place actions inside it to ensure users do not become stressed trying to access them. The snackbar can then be closed manually using the close button.
1. Click the button to trigger the snackbar
2. Close it with the close button, click anywhere else, or wait five seconds
HTML
<oc-button-v1 variant="secondary" data-live-open="#snackbar-interaction">In den Warenkorb</oc-button-v1>
<oc-snackbar-v1 id="snackbar-interaction" message="Der Artikel liegt jetzt in deinem Warenkorb."></oc-snackbar-v1>Animation
When the snackbar enters, it moves up and increases its opacity simultaneously. When the snackbar exits, it moves down outside the viewport and decreases its opacity simultaneously. In the case of "prefers-reduced-motion", only the opacity animates.
Enter: moves up and fades in
HTML
<oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-enter">Snackbar einblenden</oc-button-v1></div>
<oc-snackbar-v1 id="snackbar-enter" message="Deine Adresse wurde gespeichert." auto-dismiss="false"><oc-link-v2 variant="inverted" as-button slot="actions">Ansehen</oc-link-v2></oc-snackbar-v1>Exit: moves down and fades out
HTML
<oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-exit">Einblenden</oc-button-v1><oc-button-v1 variant="secondary" fit-content data-live-close="#snackbar-exit">Ausblenden</oc-button-v1></div>
<oc-snackbar-v1 id="snackbar-exit" message="Deine Adresse wurde gespeichert." auto-dismiss="false"><oc-link-v2 variant="inverted" as-button slot="actions">Ansehen</oc-link-v2></oc-snackbar-v1>Fitting
For breakpoint S the snackbar uses fill-parent with 24px outer spacing on each side. As soon as there is not enough space for the action on the right side it is positioned below the label.
Mobile: width fills the window minus 24 px each side, height fits the content (narrow the window)
HTML
<oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-fit-m-short">Kurzes Label</oc-button-v1><oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-fit-m-long">Langes Label</oc-button-v1></div>
<oc-snackbar-v1 id="snackbar-fit-m-short" message="Label" auto-dismiss="false"><oc-link-v2 variant="inverted" as-button slot="actions">Action</oc-link-v2></oc-snackbar-v1>
<oc-snackbar-v1 id="snackbar-fit-m-long" message="Ein außergewöhnlich langes Label" auto-dismiss="false"><oc-link-v2 variant="inverted" as-button slot="actions">Action</oc-link-v2></oc-snackbar-v1>For breakpoint M to XL the snackbar uses fit-content. As soon as there is not enough space inside the viewport it switches to fill-parent with 24px outer spacing on each side.
Desktop: fit-content up to the window width minus 24 px each side; long labels move the action below
HTML
<oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-fit-d-short">Kurz</oc-button-v1><oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-fit-d-long">Lang</oc-button-v1><oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-fit-d-longer">Sehr lang</oc-button-v1></div>
<oc-snackbar-v1 id="snackbar-fit-d-short" message="Label" auto-dismiss="false"><oc-link-v2 variant="inverted" as-button slot="actions">Action</oc-link-v2></oc-snackbar-v1>
<oc-snackbar-v1 id="snackbar-fit-d-long" message="Ein wirklich extrem außergewöhnlich langes Label, das super viel Platz weg nimmt." auto-dismiss="false"><oc-link-v2 variant="inverted" as-button slot="actions">Action</oc-link-v2></oc-snackbar-v1>
<oc-snackbar-v1 id="snackbar-fit-d-longer" message="Ein wirklich extrem außergewöhnlich langes Label, das super mega viel Platz weg nimmt." auto-dismiss="false"><oc-link-v2 variant="inverted" as-button slot="actions">Action</oc-link-v2></oc-snackbar-v1>Placement
The snackbar appears centered at the bottom of the viewport. It is positioned 16px from the bottom and 24px from the left and right sides. The snackbar is placed sticky (level 3) on top.
Centred at the bottom of the window: 16 px from the bottom, at least 24 px from the sides, elevation level 3
HTML
<oc-button-v1 variant="secondary" fit-content data-live-open="#snackbar-placement">Snackbar zeigen</oc-button-v1></div>
<oc-snackbar-v1 id="snackbar-placement" message="Zum Merkzettel hinzugefügt." auto-dismiss="false"><oc-link-v2 variant="inverted" as-button slot="actions">Ansehen</oc-link-v2></oc-snackbar-v1>Best practices
1. Aktion: remove the item, 2. Aktion: press “Rückgängig machen” in the snackbar

Content guidelines
Accessibility
For information on accessibility, refer to thetechnical documentation.
Implementation
Live demo
Neu für dich
OTTO products
Sneaker aus Glattleder, Weiß
99,99 € 79,99 €
andas
Sessel „Ilvy“ aus Bouclé, Eiche natur
399,99 €
Hanseatic
Over-Ear-Kopfhörer mit Noise Cancelling
59,99 €
Tap a heart: the snackbar confirms the action at the bottom of the window
HTML
<p class="demo-title" style="font-size:1.25rem">Neu für dich</p>
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(9.5rem,1fr));gap:24px 16px"><article style="display:flex;flex-direction:column;gap:2px;min-width:0"><div style="position:relative;border-radius:16px;overflow:hidden;background:#f3f3f3"><img src="/previews/imagery/samples/otto-product-still/product-sneaker.webp" alt="Sneaker aus Glattleder, Weiß" width="600" height="600" loading="lazy" style="display:block;width:100%;height:auto;margin:0;mix-blend-mode:multiply"><div style="position:absolute;left:12px;bottom:12px;display:flex;gap:4px;flex-wrap:wrap"><oc-tag-v1 variant="sale" size="50">-20 %</oc-tag-v1></div><div style="position:absolute;right:8px;top:8px"><oc-icon-button-v3 variant="secondary" size="50" elevation-level="above" icon="wishlist" oc-aria-label="Auf den Merkzettel" data-live-open="#snackbar-demo"></oc-icon-button-v3></div></div><p class="demo-copy" style="margin-top:10px;color:var(--oc-semantic-color-text-secondary, #6d6d6d);text-transform:uppercase;font-size:0.75rem;letter-spacing:0.02em">OTTO products</p><p class="demo-copy">Sneaker aus Glattleder, Weiß</p><p class="demo-copy" style="margin-top:6px"><s style="color:var(--oc-semantic-color-text-secondary, #6d6d6d)">99,99 €</s> <strong style="color:var(--oc-semantic-color-text-sale, #e20020);font-size:1rem">79,99 €</strong></p></article><article style="display:flex;flex-direction:column;gap:2px;min-width:0"><div style="position:relative;border-radius:16px;overflow:hidden;background:#f3f3f3"><img src="/previews/imagery/samples/otto-product-still/product-armchair.webp" alt="Sessel „Ilvy“ aus Bouclé, Eiche natur" width="600" height="600" loading="lazy" style="display:block;width:100%;height:auto;margin:0;mix-blend-mode:multiply"><div style="position:absolute;left:12px;bottom:12px;display:flex;gap:4px;flex-wrap:wrap"><oc-tag-v1 variant="info-primary" size="50">Neu</oc-tag-v1></div><div style="position:absolute;right:8px;top:8px"><oc-icon-button-v3 variant="secondary" size="50" elevation-level="above" icon="wishlist" oc-aria-label="Auf den Merkzettel" data-live-open="#snackbar-demo"></oc-icon-button-v3></div></div><p class="demo-copy" style="margin-top:10px;color:var(--oc-semantic-color-text-secondary, #6d6d6d);text-transform:uppercase;font-size:0.75rem;letter-spacing:0.02em">andas</p><p class="demo-copy">Sessel „Ilvy“ aus Bouclé, Eiche natur</p><p class="demo-copy" style="margin-top:6px"><strong style="font-size:1rem">399,99 €</strong></p></article><article style="display:flex;flex-direction:column;gap:2px;min-width:0"><div style="position:relative;border-radius:16px;overflow:hidden;background:#f3f3f3"><img src="/previews/imagery/samples/otto-product-still/product-headphones.webp" alt="Over-Ear-Kopfhörer mit Noise Cancelling" width="600" height="600" loading="lazy" style="display:block;width:100%;height:auto;margin:0;mix-blend-mode:multiply"><div style="position:absolute;right:8px;top:8px"><oc-icon-button-v3 variant="secondary" size="50" elevation-level="above" icon="wishlist" oc-aria-label="Auf den Merkzettel" data-live-open="#snackbar-demo"></oc-icon-button-v3></div></div><p class="demo-copy" style="margin-top:10px;color:var(--oc-semantic-color-text-secondary, #6d6d6d);text-transform:uppercase;font-size:0.75rem;letter-spacing:0.02em">Hanseatic</p><p class="demo-copy">Over-Ear-Kopfhörer mit Noise Cancelling</p><p class="demo-copy" style="margin-top:6px"><strong style="font-size:1rem">59,99 €</strong></p></article></div>
<oc-snackbar-v1 id="snackbar-demo" message="Der Artikel liegt jetzt auf deinem Merkzettel." auto-dismiss="false"><oc-link-v2 variant="inverted" as-button slot="actions">Merkzettel ansehen</oc-link-v2></oc-snackbar-v1>

