v1.2.0

Snackbar

Snackbars provide brief notifications at the bottom of the screen. They appear temporarily and should not interrupt the user experience.

Basic Snackbar

Click a button to show a snackbar. It dismisses automatically after 3 seconds.

Show Snackbar Show Long Message
File deleted successfully Your changes have been saved to the cloud <me-snackbar id="snackbar" auto-hide-duration="3000"> File deleted successfully </me-snackbar> <script> document.querySelector('#show-btn').addEventListener('click', () => { document.querySelector('#snackbar').setAttribute('open', ''); }); document.querySelector('#snackbar').addEventListener('me-close', (e) => { document.querySelector('#snackbar').removeAttribute('open'); }); </script>

With Action

Show with Action
Message archived UNDO <me-snackbar id="snackbar-action" auto-hide-duration="5000"> Message archived <me-button slot="action">UNDO</me-button> </me-snackbar>

Anchor Origin

Control where the snackbar appears on screen.

Top Center Top Left Top Right Bottom Left Bottom Right
Top Center Top Left Top Right Bottom Left Bottom Right <me-snackbar anchor-origin="top-right" auto-hide-duration="3000"> Saved to top-right </me-snackbar>

API

AttributeTypeDefaultDescription
openbooleanfalseWhether the snackbar is visible.
auto-hide-durationnumber (ms)Milliseconds before auto-dismissing. Omit for persistent.
anchor-originbottom-center | bottom-left | bottom-right | top-center | top-left | top-rightbottom-centerScreen position.

Events

EventDetailDescription
me-close{ reason: 'timeout' }Fired when the snackbar auto-dismisses.

Slots

SlotDescription
defaultSnackbar message text.
actionOptional action button (right-aligned).