Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1010 Bytes

README.md

File metadata and controls

32 lines (23 loc) · 1010 Bytes

Radio

lion-radio component is a sub-element to be used in lion-radio-group elements. Its purpose is to provide a way for users to check a single option amongst a set of choices.

Features

  • Get or set the checked state (boolean) - choiceChecked()
  • Get or set the value of the choice - choiceValue()
  • Pre-select an option by setting the checked boolean attribute

How to use

Installation

npm i --save @lion/radio;
import '@lion/radio/lion-radio.js';

Example

<lion-radio name="dinos[]" label="allosaurus" .choiceValue=${'allosaurus'}></lion-radio>
<lion-radio name="dinos[]" label="brontosaurus" .choiceValue=${'brontosaurus'}></lion-radio>
<lion-radio name="dinos[]" label="diplodocus" .choiceValue=${'diplodocus'} checked></lion-radio>
  • Use this component inside a lion-radio-group
  • Make sure that it has a name attribute with appended [] for multiple choices.