UNPKG

@scoped-vaadin/virtual-list

Version:

Web Component for displaying a virtual/infinite list of items.

48 lines 2.48 kB
{ "$schema": "https://json.schemastore.org/web-types", "name": "@scoped-vaadin/virtual-list", "version": "24.8.7", "description-markup": "markdown", "framework": "lit", "framework-config": { "enable-when": { "node-packages": [ "lit" ] } }, "contributions": { "html": { "elements": [ { "name": "vaadin24-virtual-list", "description": "`<vaadin24-virtual-list>` is a Web Component for displaying a virtual/infinite list of items.\n\n```html\n<vaadin24-virtual-list></vaadin24-virtual-list>\n```\n```js\nconst list = document.querySelector('vaadin24-virtual-list');\nlist.items = items; // An array of data items\nlist.renderer = (root, list, {item, index}) => {\n root.textContent = `#${index}: ${item.name}`\n}\n```\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`overflow` | Set to `top`, `bottom`, both, or none.\n\nSee [Virtual List](https://vaadin.com/docs/latest/components/virtual-list) documentation.", "extension": true, "attributes": [ { "name": ".items", "description": "An array containing items determining how many instances to render.", "value": { "kind": "expression" } }, { "name": ".renderer", "description": "Custom function for rendering the content of every item.\nReceives three arguments:\n\n- `root` The render target element representing one item at a time.\n- `virtualList` The reference to the `<vaadin24-virtual-list>` element.\n- `model` The object with the properties related with the rendered\n item, contains:\n - `model.index` The index of the rendered item.\n - `model.item` The item.", "value": { "kind": "expression" } }, { "name": ".itemAccessibleNameGenerator", "description": "A function that generates accessible names for virtual list items.\nThe function gets the item as an argument and the\nreturn value should be a string representing that item. The\nresult gets applied to the corresponding virtual list child element\nas an `aria-label` attribute.", "value": { "kind": "expression" } } ] } ] } } }