Vuetify is a popular UI framework for Vue apps.
In this article, we’ll look at how to work with the Vuetify framework.
Footers
We can add a footer with the v-footer
component.
For instance, we can write:
<template>
<v-container>
<v-row>
<v-col col="12">
<v-card height="150">
<v-footer absolute class="font-weight-medium">
<v-col class="text-center" cols="12">
{{ new Date().getFullYear() }} —
<strong>ABC Company</strong>
</v-col>
</v-footer>
</v-card>
</v-col>
</v-row>
</v-container>
</template>
<script>
export default {
name: "HelloWorld",
data: () => ({}),
};
</script>
We have the v-footer
component with the absolute
prop to display the footer at the bottom of the v-card
.
Padless Footer
We add the padless
prop to remove all the default padding from the footer.
For example, we can write:
<template>
<v-container>
<v-row>
<v-col col="12">
<v-footer padless class="font-weight-medium">
<v-col class="text-center" cols="12">
{{ new Date().getFullYear() }} —
<strong>ABC Company</strong>
</v-col>
</v-footer>
</v-col>
</v-row>
</v-container>
</template>
<script>
export default {
name: "HelloWorld",
data: () => ({}),
};
</script>
Company Footer
We can create a footer with links:
<template>
<v-container>
<v-row>
<v-col col="12">
<v-footer color="primary lighten-1" padless>
<v-row justify="center" no-gutters>
<v-btn
v-for="link in links"
:key="link"
color="white"
text
rounded
class="my-2"
>{{ link }}</v-btn>
<v-col class="primary lighten-2 py-4 text-center white--text" cols="12">
{{ new Date().getFullYear() }} —
<strong>Vuetify</strong>
</v-col>
</v-row>
</v-footer>
</v-col>
</v-row>
</v-container>
</template>
<script>
export default {
name: "HelloWorld",
data: () => ({
links: ["Home", "About Us", "Contact Us"],
}),
};
</script>
We render the buttons with the v-btn
component.
And we add the v-col
to show another bar below it.
Indigo Footer
We can also make a footer with social media buttons.
For example, we can write:
<template>
<v-container>
<v-row>
<v-col col="12">
<v-footer dark padless>
<v-card flat tile class="indigo lighten-1 white--text text-center">
<v-card-text>
<v-btn v-for="icon in icons" :key="icon" class="mx-4 white--text" icon>
<v-icon size="24px">{{ icon }}</v-icon>
</v-btn>
</v-card-text>
<v-card-text
class="white--text pt-0"
>Phasellus feugiat arcu sapien, et iaculis ipsum elementum sit amet. Mauris cursus commodo interdum. Praesent ut risus eget metus luctus accumsan id ultrices nunc. Sed at orci sed massa consectetur dignissim a sit amet dui. Duis commodo vitae velit et faucibus. Morbi vehicula lacinia malesuada. Nulla placerat augue vel ipsum ultrices, cursus iaculis dui sollicitudin.</v-card-text>
<v-divider></v-divider>
<v-card-text class="white--text">
{{ new Date().getFullYear() }} —
<strong>Vuetify</strong>
</v-card-text>
</v-card>
</v-footer>
</v-col>
</v-row>
</v-container>
</template>
<script>
export default {
name: "HelloWorld",
data: () => ({
icons: ["mdi-facebook", "mdi-twitter", "mdi-linkedin", "mdi-instagram"],
}),
};
</script>
We have the v-card-text
components to show the icons and the text below it.
dark
makes the background dark.
padless
removes the padding.
Conclusion
We can create footers with various styles with Vuetify.