Web fonts for Nuxt, without the setup
Write a
font-family declaration and Nuxt Fonts finds the font, serves it from your own origin, and generates fallback metrics to reduce layout shift.One declaration. Any provider.
Providers connect Nuxt Fonts to a font source. Each one looks up a family and fetches its files. Pick a built-in provider, mix several in one project, or write your own.
Fraunces
font-family: 'Fraunces' resolved by the google provider Bricolage Grotesque
font-family: 'Bricolage Grotesque' resolved by the bunny provider Satoshi
font-family: 'Satoshi' resolved by the fontshare provider localFont files in your own public/ directorygoogleGoogle FontsgoogleiconsMaterial Symbols and Google icon fontsbunnyBunny Fonts, a privacy-first Google Fonts mirrorfontshareFontshare by Indian Type FoundryfontsourceOpen-source families published to npmnpmAny font package on npmadobeAdobe Fonts, with your project id
What happens after the build starts
Nuxt Fonts runs over your CSS as it's processed, so there's nothing to import and no component to wrap your text in.
- 01
Resolve
Nuxt Fonts reads every
font-familyin your CSS, checkspublic/for a matching file, then asks each provider in turn.Provider lookups run through unifont.
- 02
Generate
Matching families get
@font-facerules injected into the same stylesheet that used them, with the right weights, styles and unicode ranges. - 03
Serve
Font files are downloaded at build time, hashed into your build assets and served from your own origin, so production makes no third-party requests.
- 04
Stabilise
A local system font is scaled to match the web font's metrics, so text barely moves when the real file arrives.
Fallback metrics come from fontaine.
Defaults worth keeping
Built on unjs
Nuxt Fonts is the Nuxt-shaped layer over a handful of unjs packages. Each of them is useful on its own.
Add it to your app in one command
Nuxt Fonts is MIT licensed and maintained by the Nuxt team.