Skip to content
On this page

Notification

Bold notification blocks to alert your users of something

Programmatically opening



Show code

Base

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

Class props


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id fermentum quam. Proin sagittis, nibh id hendrerit imperdiet, elit sapien laoreet elit
How does 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.


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

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

Style

📄 Full scss file

CSS VariableSASS VariableDefault
--oruga-notification-background-color$notification-background-color$primary
--oruga-notification-border-radius$notification-border-radius4px
--oruga-notification-padding$notification-padding1.75em 1.75em
--oruga-notification-margin-bottom$notification-margin-bottom1.5rem
--oruga-notification-animantion$notification-animantionappend-animate .3s linear
--oruga-notification-color$notification-color$white
--oruga-notification-close-border-radius$notification-close-border-radius$base-rounded-border-radius
--oruga-notification-close-right$notification-close-right.5rem
--oruga-notification-close-top$notification-close-top.5rem
--oruga-notification-close-size$notification-close-size20px
--oruga-notification-close-color$notification-close-color$white
--oruga-notification-close-background-color$notification-close-background-colorhsla(0,0%,4%,.2)
--oruga-notification-icon-margin-right$notification-icon-margin-right1rem
--oruga-notification-notices-padding$notification-notices-padding2em
--oruga-notification-notices-zindex$notification-notices-zindex1000

Released under the MIT License.