diff --git a/docs/3.api/4.advanced/2.kit.md b/docs/3.api/4.advanced/2.kit.md index 62d147b051..075a7dd9f4 100644 --- a/docs/3.api/4.advanced/2.kit.md +++ b/docs/3.api/4.advanced/2.kit.md @@ -14,7 +14,29 @@ description: Nuxt Kit provides composable utilities to help interacting with Nux [source code](https://github.com/nuxt/nuxt/blob/main/packages/kit/src/module) -- `installModule(module, inlineOptions)` +#### `installModule(module, inlineOptions)` + +Install specified Nuxt module programmatically. This is helpful when your module depends on other modules. You can pass the module options as an object to `inlineOptions` and they will be passed to the module's `setup` function. + +```ts +import { defineNuxtModule, installModule } from '@nuxt/kit' + +export default defineNuxtModule({ + async setup (options, nuxt) { + // will install @nuxtjs/fontaine with Roboto font and Impact fallback + await installModule('@nuxtjs/fontaine', { + // module configuration + fonts: [ + { + family: 'Roboto', + fallbacks: ['Impact'], + fallbackName: 'fallback-a', + } + ] + }) + } +}) +``` ### Programmatic Usage