Skip to content

OrigamSnackbarItem ​

<OrigamSnackbarItem> is the pure visual layer of a single toast notification. It owns intent theming (surface colour, border, icon tinting), icon + title + message layout, action buttons, dismiss button, and ARIA semantics. Positioning, transitions, overlay, and auto-dismiss logic belong to the parent (OrigamSnackbar or OrigamSnackbarGroup).

Both OrigamSnackbar and OrigamSnackbarGroup consume this component so all visual intent and layout logic lives in one place.

Basic usage ​

vue
<template>
    <OrigamSnackbarItem
        intent="success"
        title="Saved"
        message="Your changes have been saved."
    />
</template>

Intent ​

intent drives the surface colour and icon via the --origam-color__feedback--{intent}---* semantic tokens.

vue
<template>
    <OrigamSnackbarItem intent="info"    title="Info"    message="For your information." />
    <OrigamSnackbarItem intent="success" title="Success" message="Operation completed."  />
    <OrigamSnackbarItem intent="warning" title="Warning" message="Please review."        />
    <OrigamSnackbarItem intent="danger"  title="Error"   message="Something went wrong." />
</template>

Actions ​

Pass an actions array to render inline action buttons after the text block. Each action fires its handler() on click.

vue
<template>
    <OrigamSnackbarItem
        intent="warning"
        title="Item deleted"
        message="A row was removed from your list."
        :actions="[{ label: 'Undo', intent: 'primary', handler: () => undo() }]"
        @action="onAction"
    />
</template>

Dismiss ​

The dismiss (✕) button is shown by default. Pass dismissible=false to hide it.

vue
<template>
    <OrigamSnackbarItem message="Cannot be dismissed." :dismissible="false" />
</template>

Typography ​

fontSize overrides the font-size of the entire item surface via --origam-snackbar-item---font-size. When unset the SCSS default (0.875rem) applies.

fontWeight, lineHeight, letterSpacing and fontFamily were removed from ISnackbarItemProps (issue #501): the SCSS scopes font-weight per BEM child instead (__title hardcoded at 600, __message at 400) and reads no var for the other three at all. fontFamily is a project-level setting configured once on OrigamApp.

vue
<template>
    <OrigamSnackbarItem
        intent="info"
        title="Large text"
        message="Body at xl scale."
        font-size="xl"
    />
</template>

Slots ​

SlotSlot propsDescription
default—Extra content appended after the message block.
prepend—Custom icon replacing the default intent icon.
title—Custom title rendering.
message—Custom message rendering.
actions—Custom action area replacing the actions prop.

Events ​

EventPayloadDescription
dismiss—Fired when the dismiss (✕) button is clicked.
actionISnackbarGroupItemActionFired when an action button is clicked.

Props (interface) ​

ts
interface ISnackbarItemProps extends ICommonsComponentProps, ITypographyProps {
    intent?: TIntent
    title?: string
    message?: string
    icon?: TIcon | false
    actions?: ReadonlyArray<ISnackbarGroupItemAction>
    dismissible?: boolean
    dismissLabel?: string
    role?: 'status' | 'alert'
    ariaLive?: 'polite' | 'assertive'
    dataCy?: string
}

Typography props ​

PropTypeDefaultEffectNote
fontSizeTFontSize—--origam-snackbar-item---font-sizeReal visual effect — root reads this var.

Anatomy ​

html
<div class="origam-snackbar-item origam-snackbar-item--intent-{intent}">
    <div class="origam-snackbar-item__content">
        <div class="origam-snackbar-item__prepend"><!-- icon --></div>
        <div class="origam-snackbar-item__text">
            <div class="origam-snackbar-item__title"><!-- title --></div>
            <div class="origam-snackbar-item__message"><!-- message --></div>
        </div>
    </div>
    <div class="origam-snackbar-item__actions"><!-- action buttons --></div>
    <!-- dismiss button -->
</div>

Design tokens consumed ​

CSS variablePurpose
--origam-snackbar-item---font-sizeItem font-size (default 0.875rem).
--origam-snackbar-item---background-colorSurface background.
--origam-snackbar-item---border-colorSurface border.
--origam-snackbar-item---colorForeground / text colour.
--origam-snackbar-item---box-shadowDrop shadow.
--origam-snackbar-item---border-radiusCorner radius.
--origam-snackbar-item__title---font-weightTitle weight (default 600).
--origam-snackbar-item__message---font-weightMessage weight (default 400).
--origam-color__feedback--{intent}---bgSubtlePer-intent background.
--origam-color__feedback--{intent}---borderPer-intent border.
--origam-color__feedback--{intent}---fgSubtlePer-intent foreground.

Accessibility ​

  • role defaults to 'status' for neutral/info/success intents and 'alert' for warning/danger — set explicitly to override.
  • aria-live defaults to 'polite' / 'assertive' following the same logic.
  • aria-atomic="true" is always present.
  • Provide a localised dismissLabel for the dismiss button when the default "Dismiss notification" text does not suit the language.
  • OrigamSnackbar — single-item managed toast with positioning and auto-dismiss.
  • OrigamSnackbarGroup — teleported stack of OrigamSnackbarItems.