open-consul/ui/packages/consul-ui/app/components/toggle-button/index.hbs

16 lines
335 B
Handlebars

<input
...attributes
{{did-insert (set this 'input')}}
type="checkbox"
checked={{if checked 'checked' undefined}}
id={{concat 'toggle-button-' guid}}
onchange={{action 'change'}}
/>
<label
{{did-insert (set this 'label')}}
for={{concat 'toggle-button-' guid}}
>
{{yield (hash
click=(action 'click')
)}}
</label>