Nuxt
Install and configure the BootstrapVueNext Nuxt module, including built-in automations and integrations.
Installation
In Addition to Setup
The Nuxt module handles component auto-registration and tree-shaking automatically, so you do not need the Automatic Registering of Components step from Getting Started.
You still need to set up BootstrapVueNext in your Nuxt app using BApp or the plugin approach so internal services are available.
Install the required packages:
pnpm add bootstrap bootstrap-vue-next @bootstrap-vue-next/nuxtbun add bootstrap bootstrap-vue-next @bootstrap-vue-next/nuxtyarn add bootstrap bootstrap-vue-next @bootstrap-vue-next/nuxtnpm i bootstrap bootstrap-vue-next @bootstrap-vue-next/nuxtThen configure nuxt.config.ts:
export default defineNuxtConfig({
modules: ['@bootstrap-vue-next/nuxt'],
css: ['bootstrap/dist/css/bootstrap.min.css'],
})Configuration options
Configure the module with the bootstrapVueNext key:
export default defineNuxtConfig({
modules: ['@bootstrap-vue-next/nuxt'],
bootstrapVueNext: {
composables: true,
directives: true,
css: true,
autoUseNuxtImage: true,
autoConfigureNuxtColorMode: true,
plugin: {
components: {
// Example override:
// BLink: {routerComponentName: 'RouterLink'},
},
},
},
})Integrations and automations
Automatic NuxtLink consumption
BLink defaults to NuxtLink in the Nuxt module, and NuxtLink is marked global so dynamic link resolution works consistently (including for components that consume BLink internally).
Override via bootstrapVueNext.plugin.components.BLink.routerComponentName if needed.
Automatic @nuxtjs/color-mode integration
When @nuxtjs/color-mode is detected:
- BootstrapVueNext avoids auto-importing its own
useColorModecomposable to prevent naming conflicts. - By default, BootstrapVueNext provides module defaults for
@nuxtjs/color-modewithdataValue: 'bs-theme'.
Disable defaults injection with:
export default defineNuxtConfig({
bootstrapVueNext: {
autoConfigureNuxtColorMode: false,
},
})Automatic NuxtImg consumption
When @nuxt/image is installed and autoUseNuxtImage is enabled, BImg automatically renders with NuxtImg. This also applies to components that use BImg internally (for example BCardImg).