Photonix

Snackbar

Brief messages about app processes at the bottom of the screen.

Preview

Click to see the snackbar appear at the bottom of the screen.

Component API

Snackbar

Prop
Type
Default
Description
message
string
-
Primary message content (required)
action
SnackbarAction
-
Action button configuration
duration
number
5
Number of seconds before auto-dismissing when no action is present. Ignored when an action is provided.
actionPosition
"auto" | "inline" | "below"
'auto'
Action button layout behavior - auto: Place long action labels on a new line automatically (default) - inline: Keep the action on the same line - below: Always place the action on a new line
closable
boolean
false
Show close button
onClose
(() => void)
-
Callback when close button is clicked
portal
boolean
true
Whether to render in a portal (fixed to viewport). Default is true.
open
boolean
true
Visibility state

Variants

Action and Close

Combine a primary action button (always underlined) with a close icon button.

Action and Close
<Snackbar portal={false} message="Note archived" action={{ label: 'Undo' }} closable />

Two-line wrapping

The message wraps up to 2 lines automatically while keeping actions inline.

Two-line wrapping
<Snackbar portal={false} message="Two-line snackbar with action text wrapping" action={{ label: 'Action' }} closable />

Long Action Label

Long action labels automatically move to their own line. You can still force inline or below manually with actionPosition.

Long Action Label
<Snackbar portal={false} message="Your subscription will expire soon." action={{ label: 'View Settings', onClick: () => {} }} closable />

On this page

Preview
Component API
Variants
Photonix UI - React Components, Templates & Figma Design System