Merouane Boucenna
Merouane Boucenna

Reputation: 181

Icon over the button of v-switch vuetify

I am using vuetify and I just wanna add an icon over the button of v-switch, I searched in slots and found nothing

<v-switch label="Dark mode" flat inset></v-switch>

I wanna do like this picture

enter image description here

Upvotes: 4

Views: 5423

Answers (2)

PhiRequiem
PhiRequiem

Reputation: 49

You can use v-checkbox, with off-icon and on-icon. As example:

<v-checkbox class="pt-3"
    v-model="$vuetify.theme.dark"
    color="purple"
    off-icon="mdi-theme-light-dark"
    on-icon="mdi-theme-light-dark"
  ></v-checkbox>

Reference at https://vuetifyjs.com/en/api/v-checkbox/#props

Upvotes: 4

Jamaluddin Rumi
Jamaluddin Rumi

Reputation: 214

far you can do is append-icon and/or prepend-icon props

you can check the detail at https://vuetifyjs.com/en/api/v-switch/#props

Upvotes: 1

Related Questions