lion/docs/components/select-rich/overview.md
Pavlik Kiselev 11bbc5fff5
feat: migrated the navigation metadata from inline MD title decorations to frontmatter
* feat: migrated the navigation metadata from inline MD title decorations to frontmatter

* fix: fixed frontmatter metadate for api-table MDs

* fix: fixed frontmatter eslint issue
2025-03-19 10:08:22 +01:00

55 lines
1.5 KiB
Markdown

---
parts:
- Select Rich
- Overview
title: 'Select Rich: Overview'
eleventyNavigation:
key: 'Select Rich: Overview'
order: 10
parent: Select Rich
title: Overview
---
# Select Rich: Overview
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>
```js script
import { LitElement, html } from '@mdjs/mdjs-preview';
import '@lion/ui/define/lion-select-rich.js';
import '@lion/ui/define/lion-option.js';
```
```html preview-story
<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
```bash
npm i --save @lion/ui
```
```js
import { LionSelectRich } from '@lion/ui/select-rich.js';
import { LionOptions, LionOption } from '@lion/ui/listbox.js';
// or
import '@lion/ui/define/lion-select-rich.js';
import '@lion/ui/define/lion-option.js';
```