Gathering detailed insights and metrics for @nuxtjs/vuetify
Gathering detailed insights and metrics for @nuxtjs/vuetify
Gathering detailed insights and metrics for @nuxtjs/vuetify
Gathering detailed insights and metrics for @nuxtjs/vuetify
@nuxt/opencollective
[![npm version][npm-v-src]][npm-v-href] [![npm downloads][npm-d-src]][npm-d-href] [![status][github-actions-src]][github-actions-href]
@nuxtjs/eslint-module
ESLint module for Nuxt
@nuxtjs/proxy
proxy support for nuxt server
vite-plugin-vuetify
A Vite plugin for treeshaking Vuetify components and more
npm install @nuxtjs/vuetify
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
627 Stars
250 Commits
105 Forks
22 Watching
15 Branches
50 Contributors
Updated on 28 Oct 2024
Minified
Minified + Gzipped
TypeScript (68.28%)
Vue (19.13%)
JavaScript (11.84%)
Shell (0.63%)
SCSS (0.11%)
Cumulative downloads
Total Downloads
Last day
-1.2%
7,884
Compared to previous day
Last week
2.8%
38,212
Compared to previous week
Last month
1.9%
164,090
Compared to previous month
Last year
-34.4%
2,365,054
Compared to previous year
5
Looking for a Nuxt 3 solution? Try out:
@nuxtjs/vuetify
dependency to your project1yarn add --dev @nuxtjs/vuetify # or npm install --save-dev @nuxtjs/vuetify
@nuxtjs/vuetify
to the buildModules
section of nuxt.config.js
:warning: If you are using Nuxt < 2.9.0
, use modules
instead.
1{ 2 buildModules: [ 3 // Simple usage 4 '@nuxtjs/vuetify', 5 6 // With options 7 ['@nuxtjs/vuetify', { /* module options */ }] 8 ] 9}
1{ 2 buildModules: [ 3 '@nuxtjs/vuetify' 4 ], 5 vuetify: { 6 /* module options */ 7 } 8}
customVariables
Array
String
[]
Provide a way to customize Vuetify SASS variables.
Only works with tree-shaking.
Usage example :
1// assets/variables.scss 2 3// Variables you want to modify 4$btn-border-radius: 0px; 5 6// If you need to extend Vuetify SASS lists 7$material-light: ( cards: blue ); 8 9@import '~vuetify/src/styles/styles.sass';
1// nuxt.config.js 2export default { 3 vuetify: { 4 customVariables: ['~/assets/variables.scss'] 5 } 6}
The list of customizable variables can be found by looking at the files here.
defaultAssets
Object
or Boolean
1{ 2 font: { 3 family: 'Roboto' 4 }, 5 icons: 'mdi' 6}
By default, automatically handle Roboto font & Material Design Icons.
These assets are handled automatically by default to provide a zero-configuration which let you play directly with Vuetify.
defaultAssets.font.family
automatically adds the specified font (default Roboto) stylesheet from official google fonts to load the font with font-display: swap
.
If you have nuxt-webfontloader in your modules
, it will use it automatically.
defaultAssets.font.size
allows you to specify the root font size in your application.
:warning: If you choose a custom font family (i.e. not Roboto), it will automatically override Vuetify SASS variables ($body-font-family
& font-size-root
), but you will need tree-shaking to be enabled to have them correctly applied.
defaultAssets.icons
automatically adds the icons stylesheet from a CDN to load all the icons (not optimized for production).
Here are the accepted values for this option :
Value | Icons |
---|---|
'mdi' (default) | Material Designs Icons (CDN) |
'md' | Material Icons (CDN) |
'fa' | Font Awesome 5 (CDN) |
'fa4' | Font Awesome 4 (CDN) |
false | Disable auto add of the icons stylesheet |
This option (if not set to
false
) will automatically overrideicons.iconfont
Vuetify option so that Vuetify components use these icons.
Please refer to Vuetify Icons documentation for more information about icons, notably for using only bunch of SVG icons instead of including all icons in your app.
You can also set the whole defaultAssets
option to false
to prevent any automatic add of these two assets.
You can read more about adding your own assets in the Offline applications section.
optionsPath
String
Location of the Vuetify options that will be passed to Vuetify.
This file will be compiled by webpack, which means you'll benefit fast hot reload when changing these options, but also be able to use TypeScript without being forced to use TypeScript runtime.
1// nuxt.config.js 2export default { 3 vuetify: { 4 optionsPath: './vuetify.options.js' 5 } 6}
Note that you can also use Directory Aliases like
'~/path/to/option.js'
All vuetify options are supported, it includes :
1// vuetify.options.js 2export default { 3 breakpoint: {}, 4 icons: {}, 5 lang: {}, 6 rtl: true, 7 theme: {} 8}
Notice that passing the Vuetify options directly to Module options is still supported, but it will trigger Nuxt entire rebuild if options are changed.
If you need to access Nuxt context within the options file, you need to export a function instead :
1// vuetify.options.js 2export default function ({ app }) { 3 return { 4 lang: { 5 t: (key, ...params) => app.i18n.t(key, params) 6 } 7 } 8}
treeShake
Object
or Boolean
process.env.NODE_ENV === 'production'
Uses vuetify-loader to enable automatic tree-shaking. Enabled only for production by default.
You can set object as a set of options to manually import Vuetify modules globally:
Key | Type | Value |
---|---|---|
components | string[] | array of name of Vuetify components to import globally |
directives | string[] | array of name of Vuetify directives to import globally |
loaderOptions | function | loader option which applies to VuetifyLoaderPlugin |
transitions | string[] | array of name of Vuetify transitions to import globally |
If you're using TypeScript, you'll need to add @nuxtjs/vuetify
in your compilerOptions
of your tsconfig.json
:
1{ 2 "compilerOptions": { 3 "types": [ 4 "@types/node", 5 "@nuxt/vue-app", 6 "@nuxtjs/vuetify" 7 ] 8 } 9}
You'll then be able to have autocompletion in Context (ctx.$vuetify
) and Vue instances (this.$vuetify
).
If you're building an application that will need to work offline (more likely a PWA), you will need to bundle your fonts and icons in your app instead of using online resources.
It means you must set defaultAssets
option to false
.
For fonts, you may leverage CSS @font-face rule with local path of your fonts. You may find the google webfonts helper site useful for generating @font-face rules and sourcing replacement files for the default CDNs.
For icons, you can either use the same way than above, or leverage tree-shaken SVG libraries like Material Design Icons SVG or Font Awesome 5 SVG.
You'll find a step by step guide to upgrade from 1.5.x to 2.x here
yarn install
or npm install
yarn dev
or npm run dev
Copyright (c) Nuxt Community
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
Found 5/17 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
48 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More