Dual list selector

Dual list selector for lit-material: move items between available and chosen lists, with filters and full keyboard support.

  • 8.1 KB gzipped
  • @lit-material/dual-list 0.2.0
  • Renders on the server

Example

Install

npm install @lit-material/dual-list @lit-material/tokens
import "@lit-material/dual-list";

Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide

API

<lit-material-dual-list-selector>

Picks a subset of a list by moving items between "Available" and "Chosen": project members, permissions, scopes, regions. items lists everything; selected holds the chosen values.

Properties

PropertyAttributeTypeDefaultDescription
itemsitemsDualListItem[][]Every item, in display order.
selectedselectedstring[][]The chosen values.
availableLabelavailable-labelstring"Available"
chosenLabelchosen-labelstring"Chosen"
filterablefilterablebooleanfalseAdds a filter field above each list.
disableddisabledbooleanfalse

Events

EventDescription
changeAfter a move; detail: { selected }.

CSS parts

PartDescription
paneEach side (header, filter, list).
listEach listbox.
optionEach item.

CSS custom properties

PropertyDescription
--lit-material-dual-list-heightHeight of each list (default 16rem).

Source on GitHub npm