Center text vertically in v-chip

Viewed 28

How can I center the text inside a v-chip component vertically? Since it's a vuetify component, I looked at the documentation but there's no such property for this.

<v-chip
   v-if="this.drawerNodeData.type == 'Telecom'"
   :color="telecom"
   text-color="white"
   class="chips"
>
   {{ this.drawerNodeData.type }}
</v-chip>

Here's how it looks

1 Answers

As you said styles for chips class are not yet implemented. In that case your code should work as per the requirement as by default chip text center aligned vertically and horizontally. Here is the demo :

new Vue({
  el: '#app',
  vuetify: new Vuetify()
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<script
src="https://cdn.jsdelivr.net/npm/vuetify@2.0.1/dist/vuetify.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vuetify@2.0.1/dist/vuetify.min.css"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"/>
<div id="app">
  <v-app id="inspire">
    <v-container>
      <v-chip color="primary" text-color="white">Default</v-chip>
    </v-container>  
  </v-app>
</div>

Related