Package Exports
- @lion/select-rich
- @lion/select-rich/define
- @lion/select-rich/define-option
- @lion/select-rich/define-options
- @lion/select-rich/define-select-invoker
- @lion/select-rich/define-select-rich
- @lion/select-rich/docs/overview.md
- @lion/select-rich/docs/use-cases.md
Readme
Select Rich >> Overview ||10
This web component is a 'rich' version of the native <select>
element.
It allows providing fully customized options and a fully customized invoker button and is meant to be used whenever the native <select>
doesn't provide enough
styling,theming or user interaction opportunities.
Its implementation is based on the following Design pattern: https://www.w3.org/TR/wai-aria-practices/examples/listbox/listbox-collapsible.html
import { LitElement, html } from '@mdjs/mdjs-preview';
import '@lion/listbox/define';
import '@lion/select-rich/define';
export const main = () => html`
<lion-select-rich name="favoriteColor" label="Favorite color">
<lion-option .choiceValue=${'red'}>Red</lion-option>
<lion-option .choiceValue=${'hotpink'}>Hotpink</lion-option>
<lion-option .choiceValue=${'blue'}>Blue</lion-option>
</lion-select-rich>
`;
Features
- Fully accessible
- Flexible API
- Fully customizable option elements
- Fully customizable invoker element
- Mimics native select interaction mode (windows/linux and mac)
Installation
npm i --save @lion/select-rich
import { LionSelectRich, LionOptions, LionOption } from '@lion/select-rich';
// or
import '@lion/select-rich/define';
import '@lion/listbox/define';
No need to npm install
@lion/option
separately, it comes with the rich select as a dependency