0.0.4 • Published 6 years ago
ember-radio-bar v0.0.4
ember-radio-bar
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}}