# @npm-polymer/paper-listbox

> Implements an accessible material design listbox

Latest version **2.0.0** (published 2017-06-03) · http://polymer.github.io/LICENSE.txt license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @npm-polymer/paper-listbox
pnpm add @npm-polymer/paper-listbox
yarn add @npm-polymer/paper-listbox
bun add @npm-polymer/paper-listbox
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-06-03 |
| First published | 2017-06-03 |
| Weekly downloads | 0 |
| License | http://polymer.github.io/LICENSE.txt |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Maintainers | npm-polymer |
| Keywords | web-components, polymer, listbox |

## Links

- npm: https://www.npmjs.com/package/@npm-polymer/paper-listbox
- Repository: https://github.com/PolymerElements/paper-listbox
- Issues: https://github.com/PolymerElements/paper-listbox/issues
- npm.io page: https://npm.io/package/@npm-polymer/paper-listbox

## Dependencies (4)

- [@npm-polymer/polymer](https://npm.io/package/@npm-polymer/polymer.md) 2.0.1
- [@npm-polymer/paper-styles](https://npm.io/package/@npm-polymer/paper-styles.md) 1.3.1
- [@npm-polymer/iron-behaviors](https://npm.io/package/@npm-polymer/iron-behaviors.md) 1.0.18
- [@npm-polymer/iron-menu-behavior](https://npm.io/package/@npm-polymer/iron-menu-behavior.md) 1.3.1

## Recent versions

- 2.0.0 (latest) — 2017-06-03

## README

[![Build status](https://travis-ci.org/PolymerElements/paper-listbox.svg?branch=master)](https://travis-ci.org/PolymerElements/paper-listbox)

_[Demo and API docs](https://elements.polymer-project.org/elements/paper-listbox)_


## &lt;paper-listbox&gt;

Material design: [Menus](https://www.google.com/design/spec/components/menus.html)

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

```html
<paper-listbox>
  <paper-item>Item 1</paper-item>
  <paper-item>Item 2</paper-item>
</paper-listbox>
```

An initial selection can be specified with the `selected` attribute.

```html
<paper-listbox selected="0">
  <paper-item>Item 1</paper-item>
  <paper-item>Item 2</paper-item>
</paper-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.

```html
<paper-listbox multi>
  <paper-item>Item 1</paper-item>
  <paper-item>Item 2</paper-item>
</paper-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.

---
_Source: https://npm.io/package/@npm-polymer/paper-listbox · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
