Salta ai contenuti
Magma Design System
Push notification<mds-push-notification>Generato da @maggioli-design-system/magma@2.3.0dist/documentation.json. Incapsulamento: shadow.
Questa pagina è generata dai pacchetti Magma, documentati solo in inglese.
I componenti Magma sono web component: elementi personalizzati che scrivi come i tag HTML, con qualsiasi framework o senza. Le proprietà li configurano, gli eventi dicono cosa è successo, i metodi sono funzioni da chiamare sull'elemento e gli slot accolgono il contenuto che metti al suo interno.
Proprietà
Imposta una proprietà come attributo HTML nel markup, oppure come proprietà da JavaScript. La colonna Attributo dà il nome dell'attributo, un trattino quando coincide con la proprietà; le proprietà senza attributo, come array e funzioni, si impostano solo da JavaScript. Per spegnere un attributo booleano, rimuovilo: non scrivere mai disabled="false".behavior - auto | manual | undefinedautoSpecifies if the component is visible or not. behavior = manual should hide when click outside should hide when all notifications are removed should show when change visible from component or call show method behavior = auto should hide when all notifications are removed should show when one or more notifications are added
visible - boolean | undefinedSpecifies if the component is visible or not.
Eventi
mdsPushNotificationChangeMdsPushNotificationEventDetailEmits when the component visibility changes
mdsPushNotificationHidevoidEmits when the component is hidden
mdsPushNotificationShowvoidEmits when the component is shown
Metodi
hidehide() => Promise<void>Hides the notification container.
removeNotificationremoveNotification(notification: HTMLMdsPushNotificationItemElement | HTMLMdsPushNotificationItemElement[]) => Promise<void>Removes the given notification item(s) from the stack.
showshow() => Promise<void>Shows the notification container.
Slot
Gli slot accolgono il contenuto che scrivi tra i tag del componente. Lo slot predefinito, quello senza nome, accetta solo testo, salvo dove la sua descrizione dice altrimenti.(predefinito)Add HTML elements or components, it is recommended to use mds-push-notification element.
Nessun nome slot