Snackbar

Feedback & Status
stable

Temporary overlay that delivers brief non-blocking feedback at a configurable viewport location with optional auto-dismiss timer.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

multiLine
boolean
false
Increases the minimum height to accommodate multi-line message text.
text
string
Body text displayed inside the snackbar. Can also be provided via the text slot.
timer
boolean | string
false
Displays a shrinking progress bar at the top of the snackbar showing the remaining timeout duration.
timeout
number | string
5000
Auto-dismiss delay in milliseconds. Pass -1 to keep the snackbar open indefinitely.
vertical
boolean
false
Stacks the action buttons below the message text instead of inline.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
tag
string
'div'
HTML element rendered at the root.
status
TStatus
statusIconPosition
TStatusPosition
icon
TIcon
color
TColor
Intent or custom foreground color applied to the snackbar surface.
bgColor
TColor
Background color override for the snackbar wrapper.
absolute
boolean
closeOnBack
boolean
contentClass
string | Array<string>
contentProps
any
disabled
boolean
noClickAnimation
boolean
modelValue
boolean
zIndex
number | string
disableGlobalStack
boolean
persistent
boolean
height
number | string
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
target
'parent' | 'cursor' | TAnyString | Element | ComponentPublicInstance | [x: number, y: number] | undefined
activator
'parent' | 'cursor' | TAnyString | Element | ComponentPublicInstance
activatorProps
any
openOnClick
boolean
openOnContextMenu
boolean
openOnHover
boolean
openOnFocus
boolean
closeOnContentClick
boolean
closeDelay
number | string
openDelay
number | string
locationStrategy
TLocationStrategy | TLocationStrategyFn
location
TAnchor
'bottom'
Viewport anchor for the snackbar. Accepts compound values such as "bottom right".
origin
TAnchor | 'auto' | 'overlap'
offset
number | string | Array<number>
viewportMargin
number
scrollStrategy
TScrollStrategy | TScrollStrategyFn
contained
boolean
eager
boolean
transition
boolean | string | TTransitionProps
{ component: OrigamSnack }
Transition used when the snackbar enters and exits. Defaults to the OrigamSnack slide-up transition.
scrim
boolean | string
attach
boolean | string | Element | null
position
TPosition
top
number | string
bottom
number | string
left
number | string
right
number | string
rounded
boolean | number | string | TRounded | null | undefined
true
Border-radius token. Defaults to the theme default radius.
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
true
Applies a border to the snackbar wrapper. Defaults to true.
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
elevation
TElevation
1
Box-shadow elevation token applied to the snackbar wrapper.
active
boolean | IStateEffectConfig
activeClass
string
hover
boolean | IStateEffectConfig
hoverClass
string

API

Slots

Emplacements de contenu exposés par ce composant.

#prepend
Custom icon or avatar placed before the message.
#title
Bold title line rendered above the message.
#text
Message body content. Alias: message slot.
#message
#default
Custom content rendered inside the snackbar item body.
#action
Action area (buttons) rendered inside the snackbar. Receives isActive to allow dismissing programmatically.

API

Emits

Événements émis par ce composant.

@update:modelValue
any
Fired when the snackbar open state changes. Bind with v-model.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Basic usage

vue

Status variants

vue

With action button

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.