• Home
Name Date Size #Lines LOC

..--

.github/03-May-2024-3414

demo/03-May-2024-9473

test/03-May-2024-10058

.bower.jsonD03-May-20241.5 KiB4444

.gitignoreD03-May-202418 21

.travis.ymlD03-May-20241.8 KiB2322

CONTRIBUTING.mdD03-May-20243.4 KiB7839

README.mdD03-May-20242.1 KiB7139

bower.jsonD03-May-20241.2 KiB3635

hero.svgD03-May-20242.2 KiB3634

index.htmlD03-May-2024991 3114

paper-listbox.htmlD03-May-20243.1 KiB9730

README.md

1
2<!---
3
4This README is automatically generated from the comments in these files:
5paper-listbox.html
6
7Edit those files, and our readme bot will duplicate them over here!
8Edit this file, and the bot will squash your changes :)
9
10The bot does some handling of markdown. Please file a bug if it does the wrong
11thing! https://github.com/PolymerLabs/tedium/issues
12
13-->
14
15[![Build status](https://travis-ci.org/PolymerElements/paper-listbox.svg?branch=master)](https://travis-ci.org/PolymerElements/paper-listbox)
16
17_[Demo and API docs](https://elements.polymer-project.org/elements/paper-listbox)_
18
19
20##&lt;paper-listbox&gt;
21
22Material design: [Menus](https://www.google.com/design/spec/components/menus.html)
23
24`<paper-listbox>` implements an accessible listbox control with Material Design styling. The focused item
25is highlighted, and the selected item has bolded text.
26
27```html
28<paper-listbox>
29  <paper-item>Item 1</paper-item>
30  <paper-item>Item 2</paper-item>
31</paper-listbox>
32```
33
34An initial selection can be specified with the `selected` attribute.
35
36```html
37<paper-listbox selected="0">
38  <paper-item>Item 1</paper-item>
39  <paper-item>Item 2</paper-item>
40</paper-listbox>
41```
42
43Make a multi-select listbox with the `multi` attribute. Items in a multi-select listbox can be deselected,
44and multiple item can be selected.
45
46```html
47<paper-listbox multi>
48  <paper-item>Item 1</paper-item>
49  <paper-item>Item 2</paper-item>
50</paper-listbox>
51```
52
53### Styling
54
55The following custom properties and mixins are available for styling:
56
57| Custom property | Description | Default |
58| --- | --- | --- |
59| `--paper-listbox-background-color` | Menu background color | `--primary-background-color` |
60| `--paper-listbox-color` | Menu foreground color | `--primary-text-color` |
61| `--paper-listbox` | Mixin applied to the listbox | `{}` |
62
63### Accessibility
64
65`<paper-listbox>` has `role="listbox"` by default. A multi-select listbox will also have
66`aria-multiselectable` set. It implements key bindings to navigate through the listbox with the up and
67down arrow keys, esc to exit the listbox, and enter to activate a listbox item. Typing the first letter
68of a listbox item will also focus it.
69
70
71