Member-only story

Vuetify — Badges and Banners

John Au-Yeung
3 min readOct 28, 2020

--

Photo by LSE Library on Unsplash

Vuetify is a popular UI framework for Vue apps.

In this article, we’ll look at how to work with the Vuetify framework.

Badges

The v-badge component lets us add an avatar-like icon or text onto the component to highlight information to the user.

They appear as superscripts or subscripts.

For example, we can write:

<template>
<v-container>
<v-row class="text-center">
<v-col col="12">
<v-toolbar>
<v-tabs dark background-color="primary" grow>
<v-tab>
<v-badge color="pink" dot>One</v-badge>
</v-tab>
<v-tab>
<v-badge color="green" content="6">Two</v-badge>
</v-tab>
<v-tab>
<v-badge color="deep-purple accent-4" icon="mdi-vuetify">Three</v-badge>
</v-tab>
</v-tabs>
</v-toolbar>
</v-col>
</v-row>
</v-container>
</template>
<script>
export default {
name: "HelloWorld",
data: () => ({
alert: false,
}),
};
</script>

We add badges to tab links with the v-tab component.

The color can be changed with the color prop.

--

--

No responses yet