In vuetify 2 it works with <v-btn fab></btn>
. How works it with vuetify 3?
It would appear Vuetify 3 doesn't specifically support fab
buttons. But thankfully the Vuetify docs do have a FAB button, namely the scroll up button. And we can lookup its source.
From that we can make some minor changes to get to our FAB button:
<VLayoutItem model-value position="bottom" class="text-end" size="88">
<div class="ma-4">
<VBtn icon="mdi-plus" size="large" color="primary" elevation="8" />
</div>
</VLayoutItem>
class="text-end"
–
Umbrella You don't need to use VLayoutItem
like other answers suggest, positioning ability is baked right into VBtn via the position
and location
props.
<v-btn
position="fixed"
location="bottom right"
icon="mdi-plus"
size="large"
color="primary"
elevation="8
/>
mx-3
, my-5
to the v-btn
. –
Disenfranchise Starting from March 2024, Vuetify 3 now supports Floating Action Buttons.
To use this feature you have to update Vuetify to v3.5.7.
For a lighter footprint this component isn't imported by default.
First of all, import VFab
into your Vuetify configuration.
import { VFab } from 'vuetify/labs/VFab'
export default createVuetify({
components: {
VFab,
},
})
Then use <v-fab>
as you like, for example:
<v-fab
class="ms-4"
icon="mdi-plus"
location="bottom start"
size="small"
absolute
offset
/>
Here you can find the documentation for the Vuetify 3 FAB component:
https://vuetifyjs.com/en/components/floating-action-buttons
The accepted answer is missing pointer-events-none
and pointer-events-initial
classes.
These classes are necessary to enable clicking below the container.
Here is the code from the accepted aswer with the correction (classes added):
<VLayoutItem model-value position="bottom" class="text-end pointer-events-none" size="88">
<div class="ma-4 pointer-events-initial">
<VBtn icon="mdi-plus" size="large" color="primary" elevation="8" />
</div>
</VLayoutItem>
And here is the scoped style:
<style scoped>
.pointer-events-none {
pointer-events: none;
}
.pointer-events-initial {
pointer-events: initial;
}
</style>
<v-app>
for vuetify to work properly and avoid receiving this error from other child components as well –
Diez New update, vuetify 3 now has a FAB component https://vuetifyjs.com/en/components/floating-action-buttons/
<v-fab icon="$vuetify" location="top end" absolute offset></v-fab>
It looks like they've changed the syntax in v3+ to:
<v-btn icon="mdi-plus"></v-btn>
Documentation here.
v-speed-dial
has its targeted release @ Q3 2023 –
Chaisson © 2022 - 2025 — McMap. All rights reserved.
v-speed-dial
. However, I fail to find some more documentation about it. Maybe you could raise an issue about this on GitHub? – Evalynevan.fab{ position: fixed; right: 20px; top:20px; }
– Tobacco