Inline Notification
Event Handling#
The custom event that is emitted on close button click is called dismiss
.
It can be used to remove the component.
Action Button
A custom interaction, e.g., to retry the previous action like submitting a form, can be provided by setting the optional
actionLabel
, actionIcon
and actionLoading
properties.
The custom event that is emitted on action button click is called action
.
prev nextVanilla JS Angular React Vue Open in Stackblitz<!doctype html>
< html lang = "en" class = "auto" >
< head >
< title > </ title >
</ head >
< body class = "bg-base" >
< p-inline-notification
heading = "Some heading"
heading-tag = "h4"
description = "Some description."
action-label = "Retry"
action-icon = "reset"
> </ p-inline-notification >
< button type = "button" > Reset `actionLoading` </ button >
< script >
const button = document .querySelector( 'p-button' );
const inlineNotification = document .querySelector( 'p-inline-notification' );
button.addEventListener( 'click' , () => (inlineNotification.actionLoading = false ));
inlineNotification.addEventListener( 'action' , () => (inlineNotification.actionLoading = true ));
</ script >
</ body >
</ html >