VSnackbar
TheVSnackbar component is used to display a quick message to a user. Snackbars support positioning, can have actions, and can be dismissed automatically after a timeout.
Usage
Snackbars are controlled by av-model which determines whether the snackbar is visible.
Timeout
Control how long the snackbar is displayed with thetimeout prop (in milliseconds). Set to -1 to keep it open indefinitely.
The default timeout is 5000ms (5 seconds). The timer pauses when hovering over or focusing the snackbar.
Actions
Add action buttons to the snackbar using theactions slot.
Location
Position the snackbar using thelocation prop.
Color and Variant
Customize the appearance with color and variant props.Vertical
Display actions below the message with thevertical prop.
Title and Text
Use structured content with thetitle and text props.
Timer
Display a progress indicator showing the remaining time with thetimer prop.
The timer can be positioned at the
top or bottom by setting timer="top" or timer="bottom". The default position is bottom.Reverse Timer
Show the timer counting down instead of up withreverseTimer.
Prepend Content
Add icons or avatars to the beginning of the snackbar.Multi-line
Snackbars automatically adapt to multi-line content.Position
Combine location with position props for precise placement.Props
Controls whether the snackbar is visible.
The text content of the snackbar.
The title text of the snackbar.
Time in milliseconds to wait before automatically hiding the snackbar. Set to
-1 to keep open.Position of the snackbar. Options:
top, bottom, left, right, center, or combinations like top end.Stacks snackbar content and actions vertically.
Applies specified color to the snackbar.
Applies a distinct style to the component. Options:
flat, elevated, tonal, outlined, text, plain.Designates the border-radius applied to the component.
Displays a progress indicator showing remaining time. Can be positioned at top or bottom.
Makes the timer progress bar count down instead of up.
Color of the timer progress bar.
Prepends an icon to the snackbar content.
Prepends an avatar to the snackbar content.
Displays a loading spinner at the start of the snackbar.
Sets the position for the snackbar (e.g.,
fixed, absolute).Sets the component transition. Supports
-auto suffix for automatic direction.The z-index used for the snackbar.
Closes the snackbar when the browser back button is pressed.
Keeps the snackbar contained within its parent element.
Specifies which DOM element the snackbar should detach to.
Slots
default
The default Vue slot for snackbar content.
Slot for the activator element that triggers the snackbar.
Slot for action buttons.
header
Slot for custom header content.
title
Slot for the snackbar title.
text
Slot for the snackbar text content.
prepend
Slot for prepended content (icon, avatar, etc.).
Events
Emitted when the snackbar visibility changes.