This package has been deprecated

Author message:

This package has been superseded by @lion/radio-group.

@lion/radio

0.4.6 • Public • Published

Radio

🛠 Status: Pilot Phase

Lion Web Components are still in an early alpha stage; they should not be considered production ready yet.

The goal of our pilot phase is to gather feedback from a private group of users. Therefore, during this phase, we kindly ask you to:

  • not publicly promote or link us yet: (no tweets, blog posts or other forms of communication about Lion Web Components)
  • not publicly promote or link products derived from/based on Lion Web Components

As soon as Pilot Phase ends we will let you know (feel free to subscribe to this issue https://github.com/ing-bank/lion/issues/1)

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 the checked state (boolean) - checked boolean attribute
  • Pre-select an option by setting the checked boolean attribute
  • Get or set the value of the choice - choiceValue()

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.

Package Sidebar

Install

npm i @lion/radio

Weekly Downloads

70

Version

0.4.6

License

MIT

Unpacked Size

24 kB

Total Files

9

Last publish

Collaborators

  • tlouisse
  • narzac
  • d4kmor