radio

radio-group

Radio selector group.

Attribute NameTypeDefaultDescriptionMinimum Version
onChangeEventHandletrigger on change of selected item, event.detail = {value: Selected radio value}
nameStringcomponent name, used for form submission of obtained data

radio

Radio item

Attribute NameTypeDefaultDescriptionMinimum Version
valueStringcomponent value, value carried in change event when selected
checkedBooleanfalseselected or not currently
disabledBooleanfalsedisable or not
colorColorradio color

Screenshot

radio

Sample Code

copy
<radio-group class="radio-group" onChange="radioChange">
  <label class="radio" a:for="{{items}}">
    <radio value="{{item.name}}" checked="{{item.checked}}"/>{{item.value}}
  </label>
</radio-group>
copy
Page({
  data: {
    items: [
      {name: 'angular', value: 'AngularJS'},
      {name: 'react', value: 'React', checked: true},
      {name: 'polymer', value: 'Polymer'},
      {name: 'vue', value: 'Vue.js'},
      {name: 'ember', value: 'Ember.js'},
      {name: 'backbone', value: 'Backbone.js'},
    ]
  },
  radioChange: function(e) {
    console.log('you are selecting the framework:', e.detail.value)
  }
})