Notification

Show temporary, programmatic notifications outside the main flow.

Notification

Default

It generates a notification with the Sax Design function (SNotification), to use the instance of the notification it is necessary to save it in a variable, for example if you need to close the notification manually or do other functionalities with the instance

Copied
import { SNotification } from 'sax-design-vue'

SNotification({ ...options })

The necessary properties are the title and the content

Position

Change the notification position with the position property

supported values

  • bottom-right Default
  • top-right
  • top-center
  • top-left
  • bottom-left
  • bottom-center

Color

Use the color property to change the base color of the component and some of the child components, to better understand the handling of colors and themes you can see it here

Allowed values ​​are:

  • primary
  • success
  • danger
  • warning
  • dark
  • RGB
  • HEX

Icons

Pass an icon component through icon. Click a labeled button to view the corresponding notification.

Progress

Add a progress bar to the notification, if the value of the progress property is auto be determined by the duration property to reach 100%, if you want the value to be manual you can add a number of the (0 - 100) being 100 100% and use the function in the changeProgress instance and change the value to the one provided as the first parameter

Duration

Change the duration of the notification with the duration property, the value is numerical and determine the seconds before the bone component is hidden that 10s equals 10000 as the value

if you need the notification to never be hidden, the duration value would be 0

Square

Change the style of the notification with the square property so as not to have border-radius making it a rectangle

Border

Change the notification style with the border property by adding a border of the color provided as the value

Flat

Change the style of the notification with the flat property, having this property changes to lighter colors and the text of the color property, this property is a boolean so you can only use the value true

Loading

Set loading to show the shared Sax logo loader while the notification content is hidden.

Width

Change the size of the notification to the total screen with the property width and giving it a value of full

If you need the notification to have an automatic size to your content you can do it with the value auto

Sticky

You can add a style to the paste component to the nearest corner with the sticky property, this property is a boolean po which can only have the value true

Custom content

Create a VNode from an imported component and pass it to content to render custom notification content.

Close animation

Notifications close with a 220ms particle dissolve by default. The close button, automatic expiry and handle.close() share this behavior. Set closeAnimation: false or closeAnimationDuration: 0 for immediate dismissal; onClose runs once after closing finishes.

API

PROPS

Property
Type
Values
Description
default
Example
More
close-animation
Boolean
true | false
Dissolve the notification before closing. False closes immediately; reduced motion skips the effect.
true
close-animation-duration
Number
Non-negative milliseconds
Particle close duration in milliseconds; zero closes immediately.
220
on-close
() => void
—
Called once after closing finishes, including manual, automatic and handle.close() dismissal.
—
dangerous-html-string
Boolean
true | false
Render string content as HTML. Only use trusted content.
false
—
icon-size
String
CSS length
Set the notification icon size.
1.2rem
—
offset
Number
pixels
Set the notification stack offset from the viewport edge.
0
—
z-index
Number
layer number
Set the initial stacking order.
—
—
show-close
Boolean
true | false
Show the close button.
true
—
on-click-close
Function
close callback
Called when the close button is clicked; return false to keep the notification open.
—
—
title
String
String
Add a title to the notification.
—
content
String, Component
StringVNode
Add the content to the notification.
—
position
String
bottom-righttop-righttop-centertop-leftbottom-leftbottom-center
Change the position of the component.
bottom-right
color
String
primary | success | danger | warn | warning | dark | text | light | secondary | RGB | RGBA | HEX | HSL | HSLA
Change the base color of the entire component.
—
border
String
primary | success | danger | warn | warning | dark | text | light | secondary | RGB | RGBA | HEX | HSL | HSLA
Add a color border to the notification.
—
icon
String
String
Add an icon to the notification.
—
duration
Number, StringNumber
Numbernone
Determine the time until the notification is hidden (none determines not to hide).
4500 (4.5s)
onClick
function
function
function that is executed by clicking on the notification.
—
buttonClose
Boolean
truefalse
Determine if the notification has the close button.
true
flat
Boolean
truefalse
Change the notification style to flat.
false
onDestroy
() => void
Function
Function that is executed when the notification is destroyed.
—
sticky
boolean
truefalse
Change the position of the notification attached to the nearest corner.
false
square
boolean
truefalse
Determine if the notification is square and remove the border-radius.
false
width
String
100%auto
Determine the width of the notification.
340px
loading
boolean
truefalse
Determine if the notification has a loading animation.
false
progressAuto
Boolean
truefalse
Add a progress bar to the notification.
—
notPadding
Boolean
truefalse
Remove padding from notification.
20px
clickClose
Boolean
truefalse
Determine if clicking on the notification closes.
false
instance.close()
function
null
Close the notificationn.
—
custom-class
String
String
Add a custom class to the notification.
—

EVENTS

Event
Type
Description
default
Example
More
destroy
—
Fires when the notification instance is destroyed.
—
—
Last Updated: 2026-10-28, 06:17:56 UTC
Copied