Skip to content

OrigamSnackbar ​

<OrigamSnackbar> is a toast notification that slides into view for a configurable timeout and then auto-dismisses. It supports status icons, a progress timer bar, multi-line and vertical layouts, and custom action slots.

Basic usage ​

vue
<template>
    <OrigamBtn @click="open = true">Show snackbar</OrigamBtn>
    <OrigamSnackbar v-model="open" text="File saved successfully." />
</template>

Location ​

Position the snackbar in any corner.

vue
<template>
    <OrigamSnackbar v-model="open" location="top right" text="Top right!" />
</template>

Timeout ​

Default 5 000 ms. Pass -1 to keep it open indefinitely.

vue
<template>
    <OrigamSnackbar v-model="open" :timeout="8000" text="Long message." />
</template>

Timer bar ​

Show a linear progress bar counting down.

vue
<template>
    <OrigamSnackbar v-model="open" timer text="5 seconds…" />
</template>

Multi-line ​

vue
<template>
    <OrigamSnackbar v-model="open" multi-line text="Very long notification text that wraps." />
</template>

Vertical layout ​

Stacks the action below the text.

vue
<template>
    <OrigamSnackbar v-model="open" vertical text="Choose an action.">
        <template #action="{ isActive }">
            <OrigamBtn @click="isActive.value = false">Dismiss</OrigamBtn>
        </template>
    </OrigamSnackbar>
</template>

Status ​

vue
<template>
    <OrigamSnackbar v-model="open" status="success" text="Done!" />
    <OrigamSnackbar v-model="open" status="danger" text="Error occurred." />
</template>

Action slot ​

vue
<template>
    <OrigamSnackbar v-model="open" text="Item deleted.">
        <template #action="{ isActive }">
            <OrigamBtn @click="undo(); isActive.value = false">Undo</OrigamBtn>
        </template>
    </OrigamSnackbar>
</template>

Slots ​

SlotSlot propsDescription
prepend—Icon / avatar before the text. Defaults to status icon.
text—Text area override.
default—Additional content after the text.
action{ isActive }Action button area. isActive.value closes the snackbar.

Events ​

NamePayloadWhen
update:modelValuebooleanSnackbar opens or closes.

Design tokens ​

<OrigamSnackbar> owns the overlay shell, the wrapper box and the timer bar. Everything inside the box — text, icon, actions, their font size, padding and colours — is rendered by OrigamSnackbarItem and themed through the --origam-snackbar-item---* family documented there.

Read by OrigamSnackbar.vue ​

CSS variableDescription
--origam-snackbar---z-indexZ-index.
--origam-snackbar---marginOuter margin.
--origam-snackbar--absolute---z-indexZ-index when absolute is set.
--origam-snackbar__wrapper---min-heightMinimum wrapper height.
--origam-snackbar__wrapper---min-widthMinimum wrapper width.
--origam-snackbar__wrapper---max-widthMaximum wrapper width.
--origam-snackbar__wrapper---border-radiusWrapper corner radius.
--origam-snackbar__wrapper---border-widthWrapper border width.
--origam-snackbar__wrapper---border-styleWrapper border style.
--origam-snackbar--multi-line---wrapper-min-heightMinimum wrapper height in multi-line mode.
--origam-snackbar--vertical---actions-margin-bottomSpace under the actions row in vertical mode.
--origam-snackbar--{status}---borderPer-status border colour override (success, info, warning, danger); falls back to --origam-color__feedback--{status}---border.
--origam-snackbar__timer---heightHeight of the timer bar.
--origam-snackbar__timer---durationTimer animation duration. Set inline from timeout — override it in CSS and the inline value still wins.
--origam-snackbar__timer-bar---background-colorTimer-bar fill.
--origam-snackbar__timer-bar---opacityTimer-bar opacity (default intent).
--origam-snackbar__timer-bar---opacity-statusTimer-bar opacity when a status is set.

Declared but not read ​

--origam-snackbar__content---font-size, -font-weight, -letter-spacing, -line-height, -padding-block, -padding-inline and --origam-snackbar__actions---margin-inline-end exist in light.css / dark.css / tokens.type.ts but no component reads them. They predate the extraction of the content chrome into OrigamSnackbarItem; overriding one has no effect. Use the --origam-snackbar-item---* equivalents instead (---font-size, ---padding, ---gap).

Accessibility ​

  • The content area has role="status" and aria-live="polite" for screen-reader announcements.
  • Swipe up to dismiss on touch devices.
  • Hovering pauses the auto-dismiss timer.