ember-radio-bar

0.0.4 • Public • Published

ember-radio-bar

Build Status npm version Download Total Ember Observer Score Greenkeeper badge dependencies Status devDependencies Status

Installation

ember install ember-radio-bar

Usage

With options array

{{radio-bar selected
  (array
    (hash value="rocket"    label="Rocket"    icon="rocket")
    (hash value="magic"     label="Magic"     icon="magic")
    (hash value="thumbs-up" label="Thumbs up" icon="thumbs-up")
    (hash value="globe"     label="Globe"     icon="globe")
    (hash value="heart"     label="Heart"     icon="heart")
  )
  update=(action (mut selected))
  iconComponent=(component "fa-icon")
}}

With options array and custom template

{{#radio-bar selected
  (array
    (hash value="rocket"    label="Rocket"    icon="rocket")
    (hash value="magic"     label="Magic"     icon="magic")
    (hash value="thumbs-up" label="Thumbs up" icon="thumbs-up")
    (hash value="globe"     label="Globe"     icon="globe")
    (hash value="heart"     label="Heart"     icon="heart")
  )
  update=(action (mut selected))
  iconComponent=(component "fa-icon")
  as |option|
}}
  {{fa-icon option.icon}}
  {{option.label}}
{{/radio-bar}}

Pure template usage

{{#radio-bar selected
  update=(action (mut selected))
  iconComponent=(component "fa-icon")
  as |bar|
}}
  {{bar.button "rocket"    label="Rocket"    icon="rocket"}}
  {{bar.button "magic"     label="Magic"     icon="magic"}}
  {{bar.button "thumbs-up" label="Thumbs up" icon="thumbs-up"}}
  {{bar.button "globe"     label="Globe"     icon="globe"}}
  {{bar.button "heart"     label="Heart"     icon="heart"}}
{{/radio-bar}}

Pure template usage with custom template

{{#radio-bar selected
  (array
    (hash value="rocket"    label="Rocket"    icon="rocket")
    (hash value="magic"     label="Magic"     icon="magic")
    (hash value="thumbs-up" label="Thumbs up" icon="thumbs-up")
    (hash value="globe"     label="Globe"     icon="globe")
    (hash value="heart"     label="Heart"     icon="heart")
  )
  update=(action (mut selected))
  iconComponent=(component "fa-icon")
  as |option|
}}
  {{fa-icon option.icon}}
  {{option.label}}
{{/radio-bar}}

Readme

Keywords

Package Sidebar

Install

npm i ember-radio-bar

Weekly Downloads

4

Version

0.0.4

License

MIT

Unpacked Size

10.9 kB

Total Files

25

Last publish

Collaborators

  • buschtoens