PolymerElements/paper-listbox

Name: paper-listbox

Owner: PolymerElements

Description: null

Created: 2015-10-14 00:31:15.0

Updated: 2018-04-12 22:08:36.0

Pushed: 2018-05-23 02:36:43.0

Homepage: https://www.webcomponents.org/element/PolymerElements/paper-listbox

Size: 97

Language: HTML

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build status

Demo and API docs

<paper-listbox>

Material design: Menus

<paper-listbox> implements an accessible listbox control with Material Design styling. The focused item is highlighted, and the selected item has bolded text.

er-listbox>
aper-item>Item 1</paper-item>
aper-item>Item 2</paper-item>
per-listbox>

An initial selection can be specified with the selected attribute.

er-listbox selected="0">
aper-item>Item 1</paper-item>
aper-item>Item 2</paper-item>
per-listbox>

Make a multi-select listbox with the multi attribute. Items in a multi-select listbox can be deselected, and multiple item can be selected.

er-listbox multi>
aper-item>Item 1</paper-item>
aper-item>Item 2</paper-item>
per-listbox>
Styling

The following custom properties and mixins are available for styling:

| Custom property | Description | Default | | — | — | — | | --paper-listbox-background-color | Menu background color | --primary-background-color | | --paper-listbox-color | Menu foreground color | --primary-text-color | | --paper-listbox | Mixin applied to the listbox | {} |

Accessibility

<paper-listbox> has role="listbox" by default. A multi-select listbox will also have aria-multiselectable set. It implements key bindings to navigate through the listbox with the up and down arrow keys, esc to exit the listbox, and enter to activate a listbox item. Typing the first letter of a listbox item will also focus it.

Notable breaking changes between 1.x and 2.x (hybrid):

IronSelectableBehavior and IronMultiSelectableBehavior, which are used by paper-listbox, introduce multiple breaking changes. Please see the README for those behaviors for more detail.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.