lion/packages/option
Thomas Allmer 396deb2e3b feat: finalize validation and adopt it everywhere
Co-authored-by: Alex Ghiu <alex.ghiu@ing.com>
Co-authored-by: Gerjan van Geest <Gerjan.van.Geest@ing.com>
Co-authored-by: Thijs Louisse <Thijs.Louisse@ing.com>
Co-authored-by: Joren Broekema <joren.broekema@ing.com>
Co-authored-by: Erik Kroes <erik.kroes@ing.com>
2019-11-18 15:30:08 +01:00
..
src feat: update to latest overlay system 2019-10-10 17:14:49 +02:00
stories chore: add storybook addon for a11y and fix violations 2019-11-13 11:01:37 +01:00
test feat: update to latest overlay system 2019-10-10 17:14:49 +02:00
CHANGELOG.md chore: release new versions 2019-11-15 14:52:39 +00:00
index.js feat: add lion-select-rich 2019-07-25 17:21:36 +02:00
lion-option.js feat: add lion-select-rich 2019-07-25 17:21:36 +02:00
package.json chore: release new versions 2019-11-15 14:52:39 +00:00
README.md feat: finalize validation and adopt it everywhere 2019-11-18 15:30:08 +01:00

LionOption

lion-option is a selectable within a lion-select-rich

Features

  • has checked state
  • has a modelValue
  • can be disabled
  • fully accessible

How to use

Installation

npm i --save @lion/select-rich
import '@lion/select-rich/lion-select-rich.js';
import '@lion/select-rich/lion-options.js';
import '@lion/option/lion-option.js';

// validator import example
import { Required } from '@lion/validate';

Example

<lion-select-rich
  name="favoriteColor"
  label="Favorite color"
  .validators=${[new Required()]}
>
  <lion-options slot="input">
    <lion-option .choiceValue=${'red'}>Red</lion-option>
    <lion-option .choiceValue=${'hotpink'} checked>Hotpink</lion-option>
  </lion-options>
</lion-select-rich>

You can also set the full modelValue for each option.

<lion-option .modelValue=${{ value: 'red', checked: false }}>Red</lion-option>

For more details please see lion-select-rich.