SnackbarItem

Feedback & Status
stable

Pure visual layer for a single toast notification. Handles intent theming, icon, title, message, action buttons and the dismiss control.

Preview

Rendering the live preview…

info

Rendering the live preview…

success

Rendering the live preview…

warning

Rendering the live preview…

danger

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamSnackbarItemSchematic of the SnackbarItem component with 7 numbered internal parts. __content icon __text __title __message __actions ✕ 1 2 3 4 5 6 7
Anatomy of <origam-snackbar-item> — 7 internal parts. The __content row holds the prepend icon and the text block; __actions and __dismiss are appended when present.
1.origam-snackbar-item
Root element. Carries the intent modifier class (e.g. --intent-success) and the role / aria-live / aria-atomic attributes.
2.origam-snackbar-item__content
Flex row hosting the prepend icon and the text block.
3.origam-snackbar-item__prepend
Leading icon area. Defaults to the per-intent MDI icon; replaced by the #prepend slot or hidden when icon=false.
4.origam-snackbar-item__title
Bold first-line label. Rendered only when the title prop is set.
5.origam-snackbar-item__message
Body text. Rendered when the message prop or the #message slot is provided.
6.origam-snackbar-item__actions
Action buttons row. Rendered only when actions is non-empty or the #actions slot is used.
7.origam-snackbar-item__dismiss
Close button (OrigamBtn icon x-small). Hidden when dismissible=false.

API

Props

All props accepted by this component, with their type, default value and description.

intent
'info'
Semantic intent — drives the icon default and the surface colouring via feedback tokens (primary, success, warning, danger, info).
title
string
Optional bold first line rendered above the message. Useful for short labels such as "Saved" or "Error".
message
string
Body text rendered under the title. Can be omitted when content is supplied via the default slot.
Prepend icon override. Omit to use the per-intent default. Pass false to suppress the icon entirely.
actions
ReadonlyArray<ISnackbarGroupItemAction>
Action buttons rendered inline after the text block. Each action fires handler() and dismisses the item unless keepOpen: true.
dismissible
boolean
true
Whether to render the close (x) dismiss button.
dismissLabel
string
'Dismiss notification'
Accessible label for the dismiss button. Defaults to the DS locale key origam.snackbar.dismiss.
role
'status' | 'alert'
ARIA role. Inferred from intent when not set: warning / danger → "alert", others → "status".
ariaLive
'polite' | 'assertive'
ARIA live region politeness. Inferred from intent when not set: warning / danger → "assertive", others → "polite".
dataCy
string
data-cy attribute injected on the root element so each toast is addressable in e2e tests.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
fontSize
TFontSize

API

Slots

Content slots exposed by this component.

#prepend
Replaces the intent icon with custom content.
#title
Replaces the title text with custom content. Rendered only when the title prop is set.
#message
Replaces the message text with custom content.
#default
Additional content rendered inside the text block after the message.
#actions
Replaces the rendered action buttons with custom content.

API

Emits

Events emitted by this component.

@dismiss
void
Fired when the user clicks the dismiss button.
@action
ISnackbarGroupItemAction
Fired when the user clicks an action button, forwarding the action descriptor.

API

Exposed members

Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props to a child component.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Gap between the prepend area and the text+actions block.
Minimum width of the item.
Maximum width of the item.
Inner padding of the item.
Corner radius of the item card.
Default background. Intent variants override this via feedback tokens.
Default border colour. Intent variants override this via feedback tokens.
Elevation shadow for the item card.
Font weight of the title line.
Opacity of the message text, giving the title visual priority.

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

status
alert

Keyboard interactions

Keyboard interactions
KeyAction
TabMoves focus to the dismiss button or action buttons.
Enter / SpaceActivates the focused dismiss or action button.

Notes

  • aria-live is set to "assertive" for warning and danger intents, "polite" for others. The value can be overridden via the ariaLive prop.
  • aria-atomic="true" ensures screen readers read the entire item when it is updated.
  • The dismiss button carries aria-label="Dismiss notification" (or the dismissLabel prop value). It is keyboard-focusable and activated via Enter/Space.
  • The v-contrast directive ensures foreground and background token combinations meet WCAG AA contrast ratios for each intent.

Foundation

Design tokens

Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.

Source
color
var(--origam-color__surface---default)
Default background color. Intent variants reference feedback tokens.
dimension
var(--origam-radius---md)
Corner radius of the item card.
shadow
var(--origam-shadow---md)
Elevation shadow applied to the card.
fontWeight
var(--origam-font__weight---semibold)
Font weight of the title text.
number
0.85
Opacity of the message text.

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Intents

vue

With actions

vue

Ecosystem

Family

Components from the same folder that share conventions and often compose together.