vue.js logo

Install Vuetify in your Vue.js project


Step 1: Install Vuetify

You can install Vuetify via Vue CLI or npm/yarn.


Using Vue CLI: vue add vuetify


During the installation, you'll be prompted to select a preset. You can choose between a default setup or a custom one.


Using npm/yarn: npm install vuetify or yarn add vuetify


Step 2: Configure Vuetify

If you used the Vue CLI plugin, Vuetify is already configured. If you installed Vuetify using npm/yarn, you need to configure it manually.


1. Create a Vuetify Plugin: Create a file named `vuetify.js` in the `src/plugins` directory (create the directory if it doesn't exist).



 // src/main.js

 import Vue from 'vue';
 import Vuetify from 'vuetify/lib';

 Vue.use(Vuetify);

 export default new Vuetify({});

2. Update main.js: Import and use the Vuetify plugin in your main.js file.


 // src/main.js
  import Vue from 'vue';
  import App from './App.vue';
  import vuetify from './plugins/vuetify'; // path to vuetify export

  Vue.config.productionTip = false;

    new Vue({
      vuetify,
        render: h => h(App)
      }).$mount('#app');

Step 3: Add Vuetify Styles

Make sure you include Vuetify's CSS styles. This is usually done automatically if you used the Vue CLI plugin, but you might need to add it manually if you installed Vuetify with npm/yarn.


Add the following line to your `main.js`:

import 'vuetify/dist/vuetify.min.css';


That's it! You have successfully installed Vuetify in your Vue.js project.