notificationpackage.web-types.lit.json Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vaadin-webcomponents Show documentation
Show all versions of vaadin-webcomponents Show documentation
Mvnpm composite: Vaadin webcomponents
{
"$schema": "https://json.schemastore.org/web-types",
"name": "@vaadin/notification",
"version": "24.4.7",
"description-markup": "markdown",
"framework": "lit",
"framework-config": {
"enable-when": {
"node-packages": [
"lit"
]
}
},
"contributions": {
"html": {
"elements": [
{
"name": "vaadin-notification",
"description": "`` is a Web Component providing accessible and customizable notifications (toasts).\n\n### Rendering\n\nThe content of the notification can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `notification` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `notification`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n \n```\n```js\nconst notification = document.querySelector('#notification');\nnotification.renderer = function(root, notification) {\n root.textContent = \"Your work has been saved\";\n};\n```\n\nRenderer is called on the opening of the notification.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\n`` uses `` internal\nthemable component as the actual visible notification cards.\n\nThe following shadow DOM parts of the `` are available for styling:\n\nPart name | Description\n----------------|----------------\n`overlay` | The notification container\n`content` | The content of the notification\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\nNote: the `theme` attribute value set on `` is\npropagated to the internal ``.",
"extension": true,
"attributes": [
{
"name": "?opened",
"description": "True if the notification is currently displayed.",
"value": {
"kind": "expression"
}
},
{
"name": ".overlayClass",
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
"value": {
"kind": "expression"
}
},
{
"name": ".duration",
"description": "The duration in milliseconds to show the notification.\nSet to `0` or a negative number to disable the notification auto-closing.",
"value": {
"kind": "expression"
}
},
{
"name": ".position",
"description": "Alignment of the notification in the viewport\nValid values are `top-stretch|top-start|top-center|top-end|middle|bottom-start|bottom-center|bottom-end|bottom-stretch`",
"value": {
"kind": "expression"
}
},
{
"name": ".renderer",
"description": "Custom function for rendering the content of the notification.\nReceives two arguments:\n\n- `root` The `` DOM element. Append\n your content to it.\n- `notification` The reference to the `` element.",
"value": {
"kind": "expression"
}
},
{
"name": "@opened-changed",
"description": "Fired when the `opened` property changes.",
"value": {
"kind": "expression"
}
}
]
}
]
}
}
}