euvl / vue-js-toggle-button

:fish_cake: Vue.js 2 toggle / switch button - simple, pretty, customizable
http://vue-js-toggle-button.yev.io/
MIT License
934 stars 133 forks source link

Images /Icons as labels #163

Open petr-hybler opened 3 years ago

petr-hybler commented 3 years ago

hey, could please add this possibility to add icons instead of plain strings pls?

thank you

bradr5 commented 2 years ago

Although it's not documented, looking through the code it appears you can use slots for the labels by setting the labels prop to true.

<toggle-button
  :labels="true"
>
  <template v-slot:checked>
    <my-checked-icon />
  </template>
  <template v-slot:unchecked>
    <my-unchecked-icon />
  </template>
</toggle-button>