lion/packages/option
CircleCI 37fd54a421 chore: release new versions
- @lion/button@0.3.46
 - @lion/calendar@0.4.2
 - @lion/checkbox-group@0.3.8
 - @lion/checkbox@0.2.10
 - @lion/choice-input@0.4.8
 - @lion/dialog@0.2.2
 - @lion/field@0.6.7
 - @lion/fieldset@0.5.2
 - @lion/form-system@0.2.8
 - @lion/form@0.3.8
 - @lion/input-amount@0.3.8
 - @lion/input-date@0.3.8
 - @lion/input-datepicker@0.5.2
 - @lion/input-email@0.3.8
 - @lion/input-iban@0.3.8
 - @lion/input@0.3.8
 - @lion/option@0.3.8
 - @lion/popup@0.4.2
 - @lion/radio-group@0.3.8
 - @lion/radio@0.2.10
 - @lion/select-rich@0.7.2
 - @lion/select@0.3.8
 - @lion/switch@0.3.9
 - @lion/textarea@0.3.8
 - @lion/tooltip@0.4.2
 - @lion/validate@0.5.2
2019-12-03 17:46:30 +00: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-12-03 17:46:30 +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-12-03 17:46:30 +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.