Skip to content
On this page

Notification

Bold notification blocks to alert your users of something

Examples

Base

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id fermentum quam. Proin sagittis, nibh id hendrerit imperdiet, elit sapien laoreet elit
Show code

Variants

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id fermentum quam. Proin sagittis, nibh id hendrerit imperdiet, elit sapien laoreet elit
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id fermentum quam. Proin sagittis, nibh id hendrerit imperdiet, elit sapien laoreet elit
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id fermentum quam. Proin sagittis, nibh id hendrerit imperdiet, elit sapien laoreet elit
Show code

Use types

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id fermentum quam. Proin sagittis, nibh id hendrerit imperdiet, elit sapien laoreet elit
Show code

Add custom buttons

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id fermentum quam. Proin sagittis, nibh id hendrerit imperdiet, elit sapien laoreet elit
Show code

Programmatically opening

Show code

Class props

'Classes applied to the element'
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id fermentum quam. Proin sagittis, nibh id hendrerit imperdiet, elit sapien laoreet elit
How does the Class props inspector work?
Class propDescriptionPropsSuffixes
closeClassClass of the close button container.closable
contentClassClass of the content element.
iconClassClass of the icon on the left.type
noticeClassRoot class of the notice.
noticeCustomContainerClassClass of the custom container element.
noticePositionClassClass of the notice when positioned.positiontop-right
top
top-left
bottom-right
bottom
bottom-left
positionClassClass of the element when positioned.
👉 You have to declare a class for top and bottom position when override mode
positiontop-right
top
top-left
bottom-right
bottom
bottom-left
rootClassClass of the root element.
👉 You have to declare a class when override mode
variantClassClass of the notification variant.variantprimary
info
warning
danger
wrapperClassClass of the wrapper element.

Notification component

html
<o-notification></o-notification>

Props

Prop nameDescriptionTypeValuesDefault
activeWhether modal is active or not, use the .sync modifier (Vue 2.x) or v-model:active (Vue 3.x) to make it two-way bindingboolean-true
animationCustom animation (transition name).string-'fade'
ariaCloseLabelLabel for the close button, to be read by accessibility screenreaders.string-
autoCloseHide notification after duration only not programmatic.boolean-false
closableAdds an 'X' button that closes the notification.boolean-false
closeIconClose icon namestring-
From config:
notification: {
  closeIcon: 'close'
}
closeIconSizeSize of close iconstring-'small'
componentComponent to be injected, used to open a component modal programmatically. Close modal within the component by emitting a 'close' event — this.$emit('close')object|func-
durationVisibility duration in miliseconds.number-2000
eventsEvents to be binded to the injected componentobject-{}
hasIconAdds an icon on the left side depending on the type (or the icon prop if defined).boolean-
iconIcon name to use with has-icon.string-
iconPackIcon pack to use.string-
iconSizeIcon sizestring-'large'
messageMessage text (can contain HTML).string-
overrideboolean-
positionWhich position the notification will appear when programmaticallystringtop-right, top, top-left, bottom-right, bottom, bottom-left
propsProps to be binded to the injected componentobject-
typeType (color) of the notification, optional.string-
variantColor of the control, optionalstring|objectprimary, info, success, warning, danger, and any other custom color

Events

Event namePropertiesDescription
close
update:active

Slots

NameDescriptionBindings
default

NotificationNotice component

html
<o-notification-notice></o-notification-notice>

Props

Prop nameDescriptionTypeValuesDefault
containerDOM element the toast will be created on. Note that this also changes the position of the toast from fixed to absolute. Meaning that the container should be fixed.string-
From config:
notification: {
  containerElement: undefined
}
durationVisibility duration in miliseconds.number-
From config:
notification: {
  duration: 1000
}
indefiniteShow the Notification indefinitely until it is dismissed when programmatically.boolean-false
messageMessage text (can contain HTML).string|array-
onCloseCallback function to call after close (programmatically close or user canceled)func-Default function (see source code)
overrideboolean-
positionWhich position the notification will appear when programmatically.stringtop-right, top, top-left, bottom-right, bottom, bottom-left'top'
programmaticobject-
promisePromise-
propsNotificationobject-
queueIf should queue with others notices (snackbar/toast/notification).boolean-
From config:
notification: {
  noticeQueue: undefined
}
typeType (color) of the notification, optional.string-

Events

Event namePropertiesDescription
close
update:active

Slots

NameDescriptionBindings
default

Sass variables

Current theme ➜ Oruga Base

SASS VariableDefault
$notification-background-color$primary
$notification-border-radius4px
$notification-padding1.75em 1.75em
$notification-margin-bottom1.5rem
$notification-animantionappend-animate 0.3s linear
$notification-color$white
$notification-close-border-radius$base-rounded-border-radius
$notification-close-right0.5rem
$notification-close-top0.5rem
$notification-close-size20px
$notification-close-color$white
$notification-close-background-colorhsla(0, 0%, 4%, 0.2)
$notification-icon-margin-right1rem
$notification-notices-padding2em
$notification-notices-zindex1000

See ➜ 📄 Full scss file

Current theme ➜ Oruga Full

SASS VariableDefault
$notification-background-color$primary
$notification-border-radius4px
$notification-padding1.75em 1.75em
$notification-margin-bottom1.5rem
$notification-animantionappend-animate 0.3s linear
$notification-color$white
$notification-close-border-radius$base-rounded-border-radius
$notification-close-right0.5rem
$notification-close-top0.5rem
$notification-close-size20px
$notification-close-color$white
$notification-close-background-colorhsla(0, 0%, 4%, 0.2)
$notification-icon-margin-right1rem
$notification-notices-padding2em
$notification-notices-zindex1000

See ➜ 📄 Full scss file

Current theme ➜ Bulma

SASS VariableDefault
$notification-margin-bottom1.5rem
$notification-notices-padding2em
$notification-notices-zindex1000

See ➜ 📄 Full scss file

Current theme ➜ Bootstrap

SASS VariableDefault
$notification-close-btn-position1rem
$notification-notices-padding2em
$notification-notices-zindex$zindex-toast
$notification-notices-max-width600px
$notification-notices-space1.5rem
$notification-icon-margin-right0.5rem

See ➜ 📄 Full scss file

Released under the MIT License.