Notification
Bold notification blocks to alert your users of something
Examples
Base
Show code
Variants
Show code
Use types
Show code
Add custom buttons
Show code
Programmatically opening
Show code
Class props
Notification component
Bold notification blocks to alert your users of something
html
<o-notification></o-notification>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
active | Whether modal is active or not, use v-model:active to make it two-way binding | boolean | - | true |
animation | Custom animation (transition name) | string | - | From config: notification: { |
ariaCloseLabel | Accessibility label for the close button | string | - | From config: notification: { |
closable | Add close button to the item that closes the notification | boolean | - | false |
closeIcon | Close icon name | string | - | From config: notification: { |
closeIconSize | Size of close icon | string | small , medium , large | From config: notification: { |
icon | Icon name to use | string | - | |
iconPack | Icon pack to use | string | mdi , fa , fas and any other custom icon pack | From config: notification: { |
iconSize | Icon size | string | small , medium , large | From config: notification: { |
message | Message text (can contain HTML), unnecessary when default slot is used | string | string[] | - | |
override | Override existing theme classes completely | boolean | - | |
position | Which position the notification will appear when programmatically | string | top-right , top , top-left , bottom-right , bottom , bottom-left | From config: notification: { |
type | Type (color) of the notification | string | info , success , warning , danger | |
variant | Color of the control | string | primary , info , success , warning , danger , and any other custom color | From config: notification: { |
Events
Event name | Properties | Description |
---|---|---|
update:active | value boolean - updated active prop | active prop two-way binding |
close | value any - close event data | on component close event |
Slots
Name | Description | Bindings |
---|---|---|
inner | Notification inner content, outside of the message container | close (...args): void - function to close the notification |
default | Notification default content, default is message prop | close (...args): void - function to close the notification |
NotificationNotice component
Notification Notice is an extension of the Notification component and is used for the programmatic usage
html
<o-notification-notice></o-notification-notice>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
active | Whether notification is active or not, use v-model:active to make it two-way binding. | boolean | - | true |
component | Component to be injected. Close notification within the component by emitting a 'close' event — $emit('close'). | Component | - | |
container | DOM element the toast will be created on (for programmatic usage). Note that this also changes the position of the toast from fixed to absolute. Meaning that the container should be fixed. | string | HTMLElement | - | From config: notification: { |
duration | Hide notification after duration (in miliseconds) | number | - | From config: notification: { |
events | Events to be binded to the injected component. | object | - | {} |
infinite | Show the Notification infinitely until it is dismissed. | boolean | - | false |
onCancel | Callback function to call after user canceled (pressed escape / clicked outside). | () => void | - | Default function (see source code) |
onClose | Callback function to call after close (programmatically close or user canceled). | () => void | - | Default function (see source code) |
override | Override existing theme classes completely | boolean | - | |
position | Which position the notification will appear when programmatically. | string | top-right , top , top-left , bottom-right , bottom , bottom-left | From config: notification: { |
props | Props to be binded to the injected component. | object | - | |
queue | If notice should queue with others notices (snackbar/toast/notification). | boolean | - | From config: notification: { |
Events
Event name | Properties | Description |
---|---|---|
update:active | value boolean - updated active prop | active prop two-way binding |
close | value any - close event data | on component close event |
Slots
Name | Description | Bindings |
---|---|---|
default |
Sass variables
Current theme ➜ Oruga Base
SASS Variable | Default |
---|---|
$notification-background-color | $primary |
$notification-border-radius | 4px |
$notification-padding | 1.75em 1.75em |
$notification-margin-bottom | 1.5rem |
$notification-animantion | append-animate 0.3s linear |
$notification-color | $white |
$notification-close-border-radius | $base-rounded-border-radius |
$notification-close-right | 0.5rem |
$notification-close-top | 0.5rem |
$notification-close-size | 20px |
$notification-close-color | $white |
$notification-close-background-color | hsla(0, 0%, 4%, 0.2) |
$notification-icon-margin-right | 1rem |
$notification-notices-padding | 2em |
$notification-notices-zindex | 1000 |
See ➜ 📄 Full scss file
Current theme ➜ Oruga Full
SASS Variable | Default |
---|---|
$notification-background-color | $primary |
$notification-border-radius | 4px |
$notification-padding | 1.75em 1.75em |
$notification-margin-bottom | 1.5rem |
$notification-animantion | append-animate 0.3s linear |
$notification-color | $white |
$notification-close-border-radius | $base-rounded-border-radius |
$notification-close-right | 0.5rem |
$notification-close-top | 0.5rem |
$notification-close-size | 20px |
$notification-close-color | $white |
$notification-close-background-color | hsla(0, 0%, 4%, 0.2) |
$notification-icon-margin-right | 1rem |
$notification-notices-padding | 2em |
$notification-notices-zindex | 1000 |
See ➜ 📄 Full scss file
Current theme ➜ Bulma
SASS Variable | Default |
---|---|
$notification-margin-bottom | 1.5rem |
$notification-notices-padding | 2em |
$notification-notices-zindex | 1000 |
See ➜ 📄 Full scss file
Current theme ➜ Bootstrap
SASS Variable | Default |
---|---|
$notification-close-btn-position | 1rem |
$notification-notices-padding | 2em |
$notification-notices-zindex | $zindex-toast |
$notification-notices-max-width | 600px |
$notification-notices-space | 1.5rem |
$notification-icon-margin-right | 0.5rem |
See ➜ 📄 Full scss file