All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.web-types.json Maven / Gradle / Ivy

The newest version!
{
  "$schema": "https://json.schemastore.org/web-types",
  "name": "@vaadin/notification",
  "version": "24.4.9",
  "description-markup": "markdown",
  "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 ``.",
          "attributes": [
            {
              "name": "overlay-class",
              "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": {
                "type": [
                  "string",
                  "null",
                  "undefined"
                ]
              }
            },
            {
              "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": {
                "type": [
                  "number"
                ]
              }
            },
            {
              "name": "opened",
              "description": "True if the notification is currently displayed.",
              "value": {
                "type": [
                  "boolean"
                ]
              }
            },
            {
              "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": {
                "type": [
                  "NotificationPosition"
                ]
              }
            },
            {
              "name": "theme",
              "description": "The theme variants to apply to the component.",
              "value": {
                "type": [
                  "string",
                  "null",
                  "undefined"
                ]
              }
            }
          ],
          "js": {
            "properties": [
              {
                "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": {
                  "type": [
                    "string",
                    "null",
                    "undefined"
                  ]
                }
              },
              {
                "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": {
                  "type": [
                    "number"
                  ]
                }
              },
              {
                "name": "opened",
                "description": "True if the notification is currently displayed.",
                "value": {
                  "type": [
                    "boolean"
                  ]
                }
              },
              {
                "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": {
                  "type": [
                    "NotificationPosition"
                  ]
                }
              },
              {
                "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": {
                  "type": [
                    "NotificationRenderer",
                    "undefined"
                  ]
                }
              }
            ],
            "events": [
              {
                "name": "opened-changed",
                "description": "Fired when the `opened` property changes."
              }
            ]
          }
        }
      ]
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy