Fonts module for Nuxt
nuxt-fonts
dependency to your projectWith pnpm
pnpm add nuxt-fonts
Or, with yarn
yarn add nuxt-fonts
Or, with npm
npm install nuxt-fonts
nuxt-fonts
to the modules
section of nuxt.config.ts
export default defineNuxtConfig({
modules: [
// Simple usage
"nuxt-fonts",
// With options
[
"nuxt-fonts",
{
/* module options */
},
],
],
});
export default defineNuxtConfig({
modules: ["nuxt-fonts"],
fonts: {
/* module options */
},
});
inline
Boolean
nuxt.options.ssr
provider
google|local|bunny
'google'
families
Array
export default {
fonts: {
families: [
name: string
as?: string
provider?: Providers
subsets?: string | string[]
display?: FontDisplay
normal?: number | number[] | string | string[]
italic?: number | number[] | string | string[]
fallbacks?: string[]
text?: string
]
}
}
fallbacks
String[]
['BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', 'Noto Sans']
You can contribute to this module online with CodeSandBox:
Or locally:
pnpm install
pnpm dev:prepare
pnpm build
pnpm dev
Copyright (c) Nuxt