Icon Button
This is a Labs component. The API may change in future releases. Import from vuetify/labs/VIconBtn.
The VIconBtn component is an improved icon button with additional features like active states, custom variants, and enhanced sizing.
<template>
<v-icon-btn icon="mdi-heart" />
</template>
<script setup>
import { VIconBtn } from 'vuetify/labs/VIconBtn'
</script>
Controls the active state for toggle buttons.
Icon displayed when the button is active.
Color applied when the button is active.
Variant applied when the button is active.
Variant applied when the button is not active.
size
string | number
default:"default"
Size of the button. Options: x-small, small, default, large, x-large, or a number.
loading
boolean | string
default:"false"
Displays a loading indicator. Pass a color string to customize.
Makes the button read-only.
Hides the ripple overlay effect.
Color applied to the icon.
Rotation angle for the icon in degrees.
text
string | number | boolean
Text displayed instead of or with the icon.
Button variant. Options: flat, elevated, tonal, outlined, text, plain.
Emitted when the active state changes (for toggle buttons).
Default content displayed in the button.
Customize the loading indicator.
Examples
Toggle Button
<template>
<v-icon-btn
v-model:active="favorite"
icon="mdi-heart-outline"
active-icon="mdi-heart"
active-color="red"
/>
</template>
<script setup>
import { ref } from 'vue'
import { VIconBtn } from 'vuetify/labs/VIconBtn'
const favorite = ref(false)
</script>
Different Sizes
<template>
<div class="d-flex ga-2">
<v-icon-btn icon="mdi-plus" size="x-small" />
<v-icon-btn icon="mdi-plus" size="small" />
<v-icon-btn icon="mdi-plus" size="default" />
<v-icon-btn icon="mdi-plus" size="large" />
<v-icon-btn icon="mdi-plus" size="x-large" />
</div>
</template>
Loading State
<template>
<v-icon-btn
icon="mdi-cloud-upload"
loading
color="primary"
/>
</template>
Variants
<template>
<div class="d-flex ga-2">
<v-icon-btn icon="mdi-delete" variant="flat" color="error" />
<v-icon-btn icon="mdi-delete" variant="elevated" color="error" />
<v-icon-btn icon="mdi-delete" variant="tonal" color="error" />
<v-icon-btn icon="mdi-delete" variant="outlined" color="error" />
<v-icon-btn icon="mdi-delete" variant="text" color="error" />
</div>
</template>
Rotated Icon
<template>
<v-icon-btn
icon="mdi-refresh"
:rotate="rotation"
@click="rotation += 90"
/>
</template>
<script setup>
import { ref } from 'vue'
import { VIconBtn } from 'vuetify/labs/VIconBtn'
const rotation = ref(0)
</script>
With Text
<template>
<v-icon-btn icon="mdi-account" text="JD" />
</template>
Disabled State
<template>
<v-icon-btn
icon="mdi-lock"
disabled
/>
</template>
Custom Loading Indicator
<template>
<v-icon-btn icon="mdi-refresh" :loading="loading">
<template #loader>
<v-progress-circular
indeterminate
color="primary"
size="20"
/>
</template>
</v-icon-btn>
</template>
<script setup>
import { ref } from 'vue'
import { VIconBtn } from 'vuetify/labs/VIconBtn'
const loading = ref(true)
</script>
Active Variant
<template>
<v-icon-btn
v-model:active="active"
icon="mdi-star-outline"
active-icon="mdi-star"
base-variant="outlined"
active-variant="flat"
active-color="warning"
/>
</template>
<script setup>
import { ref } from 'vue'
import { VIconBtn } from 'vuetify/labs/VIconBtn'
const active = ref(false)
</script>