{"bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"faf4394b34992a412889ba17c1c9758cea91257e","tarball":"https://registry.npmjs.org/@material/list/-/list-7.0.0-canary.2e60575da.0.tgz","fileCount":38,"integrity":"sha512-33zTGZTQVPufqtUlmz/4OkM8Cv8rnKWy3bx1zx8phcHxL0nlpRdQ7EDw7uOo1t7cKZyVCLwkbfpEVe7+KToV8A==","signatures":[{"sig":"MEUCIF7cJH1lZVQybfpPGhLsyWWB34SbrU6MGwA8ntdd0T8LAiEApU0P9XGgqt4rtuSJoHLvkiFzDQ4lOO9TWokOggf+C1M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":582547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexATNCRA9TVsSAnZWagAAUe0P/0gqce5Du/d4USpK/0pc\nWE9QO1yOdSvQ0hwyIxz28TZQuROkD27bxxux37SpjwM9CqXn9ZRlL0dHuMSM\nnU6QW83ICeBQmJKK75H5qrTgx/XPpDPnTfLxffc6Sj6WafHkM+UarFAOytjU\nOgQmyzUpQ7KW6k94Cq73C0Mbs97blCSIl1npB0+6pnTxF3iTLj1eIZohwO4Y\nfYpsRjJXrfCC47+aInQ6YwQ9Pf2tb461cORg3SWhZWLe1xddh1tLksdS8/Ah\nfXf1MK1Eq61yT1I2vdUzeDotfJeDohEhOdraY29vLWyQcWQZMDnCBTVQEafW\nQiNbHzifWgOi2afFTAuswigdgSN4BcIYrdoT5ni18B4vRlkz1SM+0YPxze3+\ne7jjJg4uu9YVVhhLGjmmaAtFTsmTFKBfe9JZBNYtlHE3a3ORtbuvmVCtkp7h\nkEYKhWl1stRm0n/f6TVreaI+NCWa/HtYacMw/g4UZv/DwFl9604RlqsPDuzf\nVD736HIB6YG21oqyLQp5LihxuPcu/id7kT9fyhElhRVRJ4Q6/V3YuAOYCQmq\nNRJrTEPNaKRMZz1WsHOTzjjpVO/oiKS5p3lVYG8293npvB4s/sivO5ts9E/r\nujWU7uLwbdqa3XqTkvwLI9a3wmT3NF9CHyLWKDWO9BU9H49NiqAMJeHkvtXr\nU4ar\r\n=K50e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.list.js","name":"@material/list","types":"dist/mdc.list.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Lists\"\nlayout: detail\nsection: components\nexcerpt: \"Lists are continuous, vertical indexes of text or images.\"\niconId: list\npath: /catalog/lists/\n-->\n\n# Lists\n\n[Lists](https://material.io/components/lists/) are continuous, vertical indexes of text or images.\n\nThere are three list types:\n1. [Single-line list](#single-line-list)\n1. [Two-line list](#two-line-list)\n1. [Three-line list](#three-line-list)\n\n![Composite image of the three list types](images/lists-types.png)\n\n## Using lists\n\n### Installation\n\n```\nnpm install @material/list\n```\n\n### Styles\n\n```scss\n@use \"@material/list\";\n\n@include list.core-styles;\n```\n\n### JavaScript\n\nMDC List includes an optional JavaScript component which can be used for keyboard interaction and accessibility.\n\n```js\nimport {MDCList} from '@material/list';\n\nconst list = new MDCList(document.querySelector('.mdc-list'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\nNote that the JS component does _not_ automatically instantiate ripples on list items. If you wish to include the\nfully-upgraded ripple effect on list items, you must instantiate `MDCRipple` on each item:\n\n```js\nimport {MDCRipple} from '@material/ripple';\n\nconst listItemRipples = list.listElements.map((listItemEl) => new MDCRipple(listItemEl));\n```\n\n### Making lists accessible\n\nThe MDCList JavaScript component implements the WAI-ARIA best practices for\n[listbox](https://www.w3.org/TR/wai-aria-practices-1.1/#Listbox). This includes overriding the default tab behavior\nwithin the list component.\n\nThe `tabindex` should be set to `0` for first list item element or selected list item element, remaining list item elements should not have `tabindex` set.\n\nUse `role=\"listbox\"` only for single selection list, without this role the `ul` element is implicitely `role=\"list\"`.\nDo not use `aria-orientation` attribute for standard list (i.e., `role=\"list\"`), use component's `vertical` property to set the orientation\nto vertical.\n\nSingle selection list supports `aria-selected` and `aria-current` attributes. List automatically detects the presence of these attributes\nand sets it to next selected list item based on which ARIA attribute you use (i.e., `aria-selected` or `aria-current`). Please see WAI-ARIA [aria-current](https://www.w3.org/TR/wai-aria-1.1/#aria-current) article for recommended usage and available attribute values.\n\nAs the user navigates through the list, any `button` and `a` elements within the list will receive `tabindex=\"-1\"` when\nthe list item is not focused. When the list item receives focus, the aforementioned elements will receive\n`tabIndex=\"0\"`. This allows for the user to tab through list item elements and then tab to the first element after the\nlist. The `Arrow`, `Home`, and `End` keys should be used for navigating internal list elements. If\n`singleSelection=true`, the list will allow the user to use the `Space` or `Enter` keys to select or deselect a list\nitem. The MDCList will perform the following actions for each key press. Since list interaction will toggle a radio\nbutton or checkbox within the list item, the list will not toggle `tabindex` for those elements.\n\nDisabled list item will be included in the keyboard navigation. Please see [Focusability of disabled controls](https://www.w3.org/TR/wai-aria-practices-1.1/#kbd_disabled_controls) section in ARIA practices article.\n\nKey | Action\n--- | ---\n`ArrowUp` | When the list is in a vertical orientation (default), it will cause the previous list item to receive focus.\n`ArrowDown` | When the list is in a vertical orientation (default), it will cause the next list item to receive focus.\n`ArrowLeft` | When the list is in a horizontal orientation, it will cause the previous list item to receive focus.\n`ArrowRight` | When the list is in a horizontal orientation, it will cause the next list item to receive focus.\n`Home` | Will cause the first list item in the list to receive focus.\n`End` | Will cause the last list item in the list to receive focus.\n`Space` | Will cause the currently focused list item to become selected/deselected if `singleSelection=true`.\n`Enter` | Will cause the currently focused list item to become selected/deselected if `singleSelection=true`.\n\n## Single-line list\n\nSingle-line list items contain a maximum of one line of text.\n\n### Single-line list example\n\n```html\n<ul class=\"mdc-list\">\n  <li class=\"mdc-list-item\" tabindex=\"0\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n  <li class=\"mdc-list-item\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n  <li class=\"mdc-list-item\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n</ul>\n```\n\n## Two-line list\n\nTwo-line list items contain a maximum of two lines of text.\n\n### Two-line list example\n\nUse the `mdc-list--two-line` combined with some extra markup around the\ntext to style a two-line list.\n\n```html\n<ul class=\"mdc-list mdc-list--two-line\">\n  <li class=\"mdc-list-item\" tabindex=\"0\">\n    <span class=\"mdc-list-item__text\">\n      <span class=\"mdc-list-item__primary-text\">Two-line item</span>\n      <span class=\"mdc-list-item__secondary-text\">Secondary text</span>\n    </span>\n  </li>\n  <li class=\"mdc-list-item\">\n    <span class=\"mdc-list-item__text\">\n      <span class=\"mdc-list-item__primary-text\">Two-line item</span>\n      <span class=\"mdc-list-item__secondary-text\">Secondary text</span>\n    </span>\n  </li>\n  <li class=\"mdc-list-item\">\n    <span class=\"mdc-list-item__text\">\n      <span class=\"mdc-list-item__primary-text\">Two-line item</span>\n      <span class=\"mdc-list-item__secondary-text\">Secondary text</span>\n    </span>\n  </li>\n</ul>\n```\n\n**Note: Make sure there are no white-space characters before primary and secondary text content.**\n\n### Three-line list\n\nThree-line list items contains a maximum of three lines of text.\n\nMDC Web does not currently support three-line lists.\n\n## Other Variants\n\n### List Groups\n\nMultiple related lists can be grouped together using the `mdc-list-group` class on a containing element.\n\n```html\n<div class=\"mdc-list-group\">\n  <h3 class=\"mdc-list-group__subheader\">List 1</h3>\n  <ul class=\"mdc-list\">\n    <li class=\"mdc-list-item\" tabindex=\"0\">\n      <span class=\"mdc-list-item__text\">line item</span>\n    </li>\n    <li class=\"mdc-list-item\">\n      <span class=\"mdc-list-item__text\">line item</span>\n    </li>\n    <li class=\"mdc-list-item\">\n      <span class=\"mdc-list-item__text\">line item</span>\n    </li>\n  </ul>\n  <h3 class=\"mdc-list-group__subheader\">List 2</h3>\n  <ul class=\"mdc-list\">\n    <li class=\"mdc-list-item\">\n      <span class=\"mdc-list-item__text\">line item</span>\n    </li>\n    <li class=\"mdc-list-item\">\n      <span class=\"mdc-list-item__text\">line item</span>\n    </li>\n    <li class=\"mdc-list-item\">\n      <span class=\"mdc-list-item__text\">line item</span>\n    </li>\n  </ul>\n</div>\n```\n\n### List Dividers\n\nMDC List contains an `mdc-list-divider` class which can be used as full-width or inset subdivisions either within lists themselves, or standalone between related groups of content.\n\n```html\n<ul class=\"mdc-list\">\n  <li class=\"mdc-list-item\" tabindex=\"0\">\n    <span class=\"mdc-list-item__text\">Item 1 - Division 1</span>\n  </li>\n  <li class=\"mdc-list-item\">\n    <span class=\"mdc-list-item__text\">Item 2 - Division 1</span>\n  </li>\n  <li role=\"separator\" class=\"mdc-list-divider\"></li>\n  <li class=\"mdc-list-item\">\n    <span class=\"mdc-list-item__text\">Item 1 - Division 2</span>\n  </li>\n  <li class=\"mdc-list-item\">\n    <span class=\"mdc-list-item__text\">Item 2 - Division 2</span>\n  </li>\n</ul>\n```\n\n**Note: The role=\"separator\" attribute on the list divider. It is important to include this so that assistive technology can be made aware that this is a presentational element and is not meant to be included as an item in a list. Note that separator is indeed a valid role for li elements.**\n\nOR\n\n```html\n<ul class=\"mdc-list\">\n  <li class=\"mdc-list-item\" tabindex=\"0\">\n    <span class=\"mdc-list-item__text\">Item 1 - List 1</span>\n  </li>\n  <li class=\"mdc-list-item\">\n    <span class=\"mdc-list-item__text\">Item 2 - List 1</span>\n  </li>\n</ul>\n<hr class=\"mdc-list-divider\">\n<ul class=\"mdc-list\">\n  <li class=\"mdc-list-item\">\n    <span class=\"mdc-list-item__text\">Item 1 - List 2</span>\n  </li>\n  <li class=\"mdc-list-item\">\n    <span class=\"mdc-list-item__text\">Item 2 - List 2</span>\n  </li>\n</ul>\n```\n\n### Single Selection List\n\nMDC List can handle selecting/deselecting list elements based on click or keyboard actions. When enabled, the `space` and `enter` keys (or `click` event) will trigger a\nsingle list item to become selected and any other previously selected element to become deselected.\n\n```html\n<ul id=\"my-list\" class=\"mdc-list\" role=\"listbox\">\n  <li class=\"mdc-list-item\" role=\"option\" tabindex=\"0\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n  <li class=\"mdc-list-item\" role=\"option\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n  <li class=\"mdc-list-item\" role=\"option\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n</ul>\n```\n\n```js\nconst list = new MDCList(document.getElementById('my-list'));\nlist.singleSelection = true;\n```\n\n#### Pre-selected list item\n\nWhen rendering the list with a pre-selected list item, the list item that needs to be selected should contain\nthe `mdc-list-item--selected` or `mdc-list-item--activated` class before creating the list. Please see\n[Accessibility](#Accessibility) section for appropriate aria attributes.\n\n```html\n<ul id=\"my-list\" class=\"mdc-list\" role=\"listbox\">\n  <li class=\"mdc-list-item\" role=\"option\" aria-selected=\"false\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n  <li class=\"mdc-list-item mdc-list-item--selected\" role=\"option\" aria-selected=\"true\" tabindex=\"0\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n  <li class=\"mdc-list-item\" role=\"option\" aria-selected=\"false\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n</ul>\n```\n\n```js\nconst list = new MDCList(document.getElementById('my-list'));\nlist.singleSelection = true;\n```\n\n### List with radio group\n\nWhen rendering list radio group with pre-selected radio button the selected list item should contain `aria-checked` set to `true` and the native radio input element contains `checked` attribute, all other list items should have `aria-checked` set to `false`. The list root contains `role=\"radiogroup\"` whereas each list item within radio group contains `role=\"radio\"`.\n\n```html\n<ul class=\"mdc-list\" role=\"radiogroup\">\n  <li class=\"mdc-list-item\" role=\"radio\" aria-checked=\"false\">\n    <span class=\"mdc-list-item__graphic\">\n      <div class=\"mdc-radio\">\n        <input class=\"mdc-radio__native-control\"\n              type=\"radio\"\n              id=\"demo-list-radio-item-1\"\n              name=\"demo-list-radio-item-group\"\n              value=\"1\">\n        <div class=\"mdc-radio__background\">\n          <div class=\"mdc-radio__outer-circle\"></div>\n          <div class=\"mdc-radio__inner-circle\"></div>\n        </div>\n      </div>\n    </span>\n    <label class=\"mdc-list-item__text\" for=\"demo-list-radio-item-1\">Option 1</label>\n  </li>\n  <li class=\"mdc-list-item\" role=\"radio\" aria-checked=\"true\" tabindex=\"0\">\n    <span class=\"mdc-list-item__graphic\">\n      <div class=\"mdc-radio\">\n        <input class=\"mdc-radio__native-control\"\n              type=\"radio\"\n              id=\"demo-list-radio-item-2\"\n              name=\"demo-list-radio-item-group\"\n              value=\"2\"\n              checked>\n        <div class=\"mdc-radio__background\">\n          <div class=\"mdc-radio__outer-circle\"></div>\n          <div class=\"mdc-radio__inner-circle\"></div>\n        </div>\n      </div>\n    </span>\n    <label class=\"mdc-list-item__text\" for=\"demo-list-radio-item-2\">Option 2</label>\n  </li>\n  <li class=\"mdc-list-item\" role=\"radio\" aria-checked=\"false\">\n    <span class=\"mdc-list-item__graphic\">\n      <div class=\"mdc-radio\">\n        <input class=\"mdc-radio__native-control\"\n              type=\"radio\"\n              id=\"demo-list-radio-item-3\"\n              name=\"demo-list-radio-item-group\"\n              value=\"3\">\n        <div class=\"mdc-radio__background\">\n          <div class=\"mdc-radio__outer-circle\"></div>\n          <div class=\"mdc-radio__inner-circle\"></div>\n        </div>\n      </div>\n    </span>\n    <label class=\"mdc-list-item__text\" for=\"demo-list-radio-item-3\">Option 3</label>\n  </li>\n</ul>\n```\n\n### List with checkbox items\n\nWhen rendering list with checkbox items all pre-selected list items should contain `aria-checked` set to `true` and the native checkbox input element should contain `checked` attribute, all other list items should have `aria-checked` set to `false`. Each list item in checkbox list contains `role=\"checkbox\"` attribute and the list root should contain `role=\"group\"` and `aria-label` attributes.\n\n```html\n<ul class=\"mdc-list\" role=\"group\" aria-label=\"List with checkbox items\">\n  <li class=\"mdc-list-item\" role=\"checkbox\" aria-checked=\"false\">\n    <span class=\"mdc-list-item__graphic\">\n      <div class=\"mdc-checkbox\">\n        <input type=\"checkbox\"\n                class=\"mdc-checkbox__native-control\"\n                id=\"demo-list-checkbox-item-1\"  />\n        <div class=\"mdc-checkbox__background\">\n          <svg class=\"mdc-checkbox__checkmark\"\n                viewBox=\"0 0 24 24\">\n            <path class=\"mdc-checkbox__checkmark-path\"\n                  fill=\"none\"\n                  d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n          </svg>\n          <div class=\"mdc-checkbox__mixedmark\"></div>\n        </div>\n      </div>\n    </span>\n    <label class=\"mdc-list-item__text\" for=\"demo-list-checkbox-item-1\">Option 1</label>\n  </li>\n  <li class=\"mdc-list-item\" role=\"checkbox\" aria-checked=\"true\" tabindex=\"0\">\n    <span class=\"mdc-list-item__graphic\">\n        <div class=\"mdc-checkbox\">\n            <input type=\"checkbox\"\n                    class=\"mdc-checkbox__native-control\"\n                    id=\"demo-list-checkbox-item-2\"\n                    checked />\n            <div class=\"mdc-checkbox__background\">\n              <svg class=\"mdc-checkbox__checkmark\"\n                    viewBox=\"0 0 24 24\">\n                <path class=\"mdc-checkbox__checkmark-path\"\n                      fill=\"none\"\n                      d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n              </svg>\n              <div class=\"mdc-checkbox__mixedmark\"></div>\n            </div>\n          </div>\n    </span>\n    <label class=\"mdc-list-item__text\" for=\"demo-list-checkbox-item-2\">Option 2</label>\n  </li>\n  <li class=\"mdc-list-item\" role=\"checkbox\" aria-checked=\"false\">\n    <span class=\"mdc-list-item__graphic\">\n        <div class=\"mdc-checkbox\">\n            <input type=\"checkbox\"\n                    class=\"mdc-checkbox__native-control\"\n                    id=\"demo-list-checkbox-item-3\" />\n            <div class=\"mdc-checkbox__background\">\n              <svg class=\"mdc-checkbox__checkmark\"\n                    viewBox=\"0 0 24 24\">\n                <path class=\"mdc-checkbox__checkmark-path\"\n                      fill=\"none\"\n                      d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n              </svg>\n              <div class=\"mdc-checkbox__mixedmark\"></div>\n            </div>\n          </div>\n    </span>\n    <label class=\"mdc-list-item__text\" for=\"demo-list-checkbox-item-3\">Option 3</label>\n  </li>\n</ul>\n```\n\nThe `selectedIndex` (that proxies foundation's `setSelectedState()`) accepts list of indexes in array format for list with checkbox items to set the selection state. It overwrites the current state with new selected state.\n\n## Style Customization\n\n### CSS Classes\n\nCSS Class | Description\n--- | ---\n`mdc-list` | Mandatory, for the list element.\n`mdc-list--dense` | Optional, styles the density of the list, making it appear more compact.\n`mdc-list--avatar-list` | Optional, configures the leading tiles of each row to display images instead of icons. This will make the graphics of the list items larger.\n`mdc-list--two-line` | Optional, modifier to style list with two lines (primary and secondary lines).\n`mdc-list-item` | Mandatory, for the list item element.\n`mdc-list-item__text` |\tMandatory. Wrapper for list item text content (displayed as middle column of the list item).\n`mdc-list-item__primary-text` | Optional, primary text for the list item. Should be the child of `mdc-list-item__text`.\n`mdc-list-item__secondary-text` | Optional, secondary text for the list item. Displayed below the primary text. Should be the child of `mdc-list-item__text`.\n`mdc-list-item--disabled` | Optional, styles the row in the disabled state.\n`mdc-list-item--selected` | Optional, styles the row in the selected* state.\n`mdc-list-item--activated` | Optional, styles the row in the activated* state.\n`mdc-list-item__graphic` | Optional, the first tile in the row (in LTR languages, the first column of the list item). Typically an icon or image.\n`mdc-list-item__meta`\t| Optional, the last tile in the row (in LTR languages, the last column of the list item). Typically small text, icon. or image.\n`mdc-list-group` | Optional, wrapper around two or more mdc-list elements to be grouped together.\n`mdc-list-group__subheader` |\tOptional, heading text displayed above each list in a group.\n`mdc-list-divider` | Optional, for list divider element.\n`mdc-list-divider--padded` | Optional, leaves gaps on each side of divider to match padding of `list-item__meta`.\n`mdc-list-divider--inset` | Optional, increases the leading margin of the divider so that it does not intersect the avatar column.\n\n**Note: The `mdc-list-divider` class can be used between list items *OR* between two lists (see respective examples under [List Dividers](#list-dividers)).**\n\n**Note: In Material Design, the selected and activated states apply in different, mutually-exclusive situations:**\n* *Selected* state should be applied on the `.mdc-list-item` when it is likely to frequently change due to user choice. E.g., selecting one or more photos to share in Google Photos.\n* *Activated* state is more permanent than selected state, and will **NOT** change soon relative to the lifetime of the page. Common examples are navigation components such as the list within a navigation drawer.\n\n### Sass Mixins\n\nMixin | Description\n--- | ---\n`item-primary-text-ink-color($color)` | Sets the ink color of the primary text of the list item.\n`item-secondary-text-ink-color($color)` | Sets the ink color of the secondary text of the list item.\n`item-graphic-fill-color($color)` | Sets background ink color of the graphic element within list item.\n`item-graphic-ink-color($color)` | Sets ink color of the graphic element within list item.\n`item-meta-ink-color($color)` | Sets ink color of the meta element within list item.\n`single-line-shape-radius($radius, $rtl-reflexive, $density-scale)` | Sets the rounded shape to list item with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false. Set `$density-scale` only when custom density is applied, defaults to `$mdc-list-single-line-density-scale`.\n`divider-color($color)` | Sets divider ink color.\n`group-subheader-ink-color($color)` | Sets ink color of subheader text within list group.\n`item-selected-text-color($color)` | Sets the color of the text when the list item is selected/activated.\n`item-disabled-text-color($color)` | Sets the color of the text when the list item is disabled.\n`item-disabled-text-opacity($opacity)` | Sets the opacity of the text when the list item is disabled.\n`single-line-density($density-scale)` | Sets density scale to single line list variant. Supported density scales are `-4`, `-3`, `-2`, `-1` and  `0`.\n`single-line-height($height)` | Sets height to single line list variant.\n\n## `MDCList` Properties and Methods\n\nProperty | Value Type | Description\n--- | --- | ---\n`vertical` | `boolean` (write-only) | Proxies to the foundation's `setVerticalOrientation()` method.\n`listElements` | `Array<Element>` (read-only) | Returns all list item elements including disabled list items.\n`wrapFocus` | `boolean` (write-only) | Proxies to the foundation's `setWrapFocus()` method.\n`singleSelection` | `boolean` (write-only) | Proxies to the foundation's `setSingleSelection()` method.\n`selectedIndex` | `MDCListIndex` | Proxies to the foundation's `getSelectedIndex()` and `setSelectedIndex()` methods.\n\nMethod Signature | Description\n--- | ---\n`layout() => void` | Recalculates layout and orientation.\n`initializeListType() => void` | Initialize `selectedIndex` value based on pre-selected checkbox list items, single selection or radio.\n`setEnabled(itemIndex: number, isEnabled: boolean) => void` | Updates the list item at `itemIndex` to the desired `isEnabled` state.\n\n### Events\n\nEvent Name | `event.detail` | Description\n--- | --- | ---\n`MDCList:action` | `{index: number}` | Indicates that a list item with the specified index has been activated.\n\n## Usage within Web Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a List for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\n### Considerations for Advanced Approach\n\nThe `MDCListFoundation` expects the HTML to be setup a certain way before being used. This setup is a part of the `layout()` and `singleSelection()` functions within the `index.js`.\n\n#### Setup in `layout()`\n\nThe default component requires that every list item receives a `tabindex` value so that it can receive focus\n(`li` elements cannot receive focus at all without a `tabindex` value). Any element not already containing a\n`tabindex` attribute will receive `tabindex=-1`. The first list item should have `tabindex=\"0\"` so that the\nuser can find the first element using the `tab` key, but subsequent `tab` keys strokes will cause focus to\nskip over the entire list. If the list items contain sub-elements that are focusable (`button` and `a` elements),\nthese should also receive `tabIndex=\"-1\"`.\n\n```html\n<ul id=\"my-list\" class=\"mdc-list\">\n  <li class=\"mdc-list-item\" tabindex=\"0\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n    <button tabindex=\"-1\"></button>\n  </li>\n  <li class=\"mdc-list-item\" tabindex=\"-1\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n  <li class=\"mdc-list-item\" tabindex=\"-1\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n</ul>\n```\n\n#### Setup in `singleSelection()`\n\nWhen implementing a component that will use the single selection variant, the HTML should be modified to include\nthe `mdc-list-item--selected` or `mdc-list-item--activated` class name,\nand the `tabindex` of the selected element should be `0`. The first list item should have the `tabindex` updated\nto `-1`. The foundation method `setSelectedIndex()` should be called with the initially selected element immediately\nafter the foundation is instantiated. Please see [Accessibility](#Accessibility) section for appropriate aria attributes.\n\n```html\n<ul id=\"my-list\" class=\"mdc-list\">\n  <li class=\"mdc-list-item\" tabindex=\"-1\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n    <button tabindex=\"-1\"></button>\n    </li>\n  <li class=\"mdc-list-item mdc-list-item--selected\" aria-selected=\"true\" tabindex=\"0\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n  <li class=\"mdc-list-item\" tabindex=\"-1\">\n    <span class=\"mdc-list-item__text\">Single-line item</span>\n  </li>\n</ul>\n```\n\n### `MDCListAdapter`\n\nMethod Signature | Description\n--- | ---\n`getListItemCount() => Number` | Returns the total number of list items (elements with `mdc-list-item` class) that are direct children of the `root_` element.\n`getFocusedElementIndex() => Number` | Returns the `index` value of the currently focused element.\n`getAttributeForElementIndex(index: number, attribute: string) => string | null` | Returns the attribute value of list item at given `index`.\n`setAttributeForElementIndex(index: Number, attr: String, value: String) => void` | Sets the `attr` attribute to `value` for the list item at `index`.\n`addClassForElementIndex(index: Number, className: String) => void` | Adds the `className` class to the list item at `index`.\n`removeClassForElementIndex(index: Number, className: String) => void` | Removes the `className` class to the list item at `index`.\n`focusItemAtIndex(index: Number) => void` | Focuses the list item at the `index` value specified.\n`setTabIndexForListItemChildren(index: Number, value: Number) => void` | Sets the `tabindex` attribute to `value` for each child button or anchor element in the list item at the `index` specified.\n`hasRadioAtIndex(index: number) => boolean` | Returns true if radio button is present at given list item index.\n`hasCheckboxAtIndex(index: number) => boolean` | Returns true if checkbox is present at given list item index.\n`isCheckboxCheckedAtIndex(index: number) => boolean` | Returns true if checkbox inside a list item is checked.\n`setCheckedCheckboxOrRadioAtIndex(index: number, isChecked: boolean) => void` | Sets the checked status of checkbox or radio at given list item index.\n`notifyAction(index: number) => void` | Notifies user action on list item including keyboard and mouse actions.\n`isFocusInsideList() => boolean` | Returns true if the current focused element is inside list root.\n`isRootFocused() => boolean` | Returns true if root element is focused.\n`listItemAtIndexHasClass(index: number, className: string) => boolean` | Returns true if list item at `index` has class `className`.\n\n### `MDCListFoundation`\n\nMethod Signature | Description\n--- | ---\n`setWrapFocus(value: Boolean) => void` | Sets the list to allow the up arrow on the first element to focus the last element of the list and vice versa.\n`setVerticalOrientation(value: Boolean) => void` | Sets the list to an orientation causing the keys used for navigation to change. `true` results in the Up/Down arrow keys being used. `false` results in the Left/Right arrow keys being used.\n`setSingleSelection(value: Boolean) => void` | Sets the list to be a selection list. Enables the `enter` and `space` keys for selecting/deselecting a list item.\n`getSelectedIndex() => MDCListIndex` | Gets the current selection state by returning selected index or list of indexes for checkbox based list. See [types.ts](./types.ts) for `MDCListIndex` type definition.\n`setSelectedIndex(index: MDCListIndex) => void` | Sets the selection state to given index or list of indexes if it is checkbox based list. See [types.ts](./types.ts) for `MDCListIndex` type definition.\n`setUseActivatedClass(useActivated: boolean) => void` | Sets the selection logic to apply/remove the `mdc-list-item--activated` class.\n`handleFocusIn(evt: Event) => void` | Handles the changing of `tabindex` to `0` for all button and anchor elements when a list item receives focus.\n`handleFocusOut(evt: Event) => void` | Handles the changing of `tabindex` to `-1` for all button and anchor elements when a list item loses focus.\n`handleKeydown(evt: Event) => void` | Handles determining if a focus action should occur when a key event is triggered.\n`handleClick(evt: Event) => void` | Handles toggling the selected/deselected state for a list item when clicked. This method is only used by the single selection list.\n`focusNextElement(index: number) => number` | Handles focusing the next element using the current `index`. Returns focused element index.\n`focusPrevElement(index: number) => number` | Handles focusing the previous element using the current `index`. Returns focused element index.\n`focusFirstElement() => number` | Handles focusing the first element in a list. Returns focused element index.\n`focusLastElement() => number` | Handles focusing the last element in a list. Returns focused element index.\n`setEnabled(itemIndex: number, isEnabled: Boolean) => void` | Updates the list item's disabled state.\n","gitHead":"a4b6f1d5a01445ae9c14845614630907beaad190","license":"MIT","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"homepage":"https://github.com/material-components/material-components-web#readme","keywords":["material components","material design","list"],"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-list"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web list component","directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.2e60575da.0","@material/rtl":"7.0.0-canary.2e60575da.0","@material/base":"7.0.0-canary.2e60575da.0","@material/shape":"7.0.0-canary.2e60575da.0","@material/theme":"7.0.0-canary.2e60575da.0","@material/ripple":"7.0.0-canary.2e60575da.0","@material/density":"7.0.0-canary.2e60575da.0","@material/typography":"7.0.0-canary.2e60575da.0","@material/feature-targeting":"7.0.0-canary.2e60575da.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/list_7.0.0-canary.2e60575da.0_1589904589144_0.044738273721754984","host":"s3://npm-registry-packages"},"_id":"@material/list@7.0.0-canary.2e60575da.0","version":"7.0.0-canary.2e60575da.0"}