What is BootstrapVue?
BootstrapVue is a collection of Vue.js components that implement Bootstrap 4's design system without requiring jQuery. It provides over 50 Vue components, numerous directives, and an extensive icon library, enabling developers to build responsive, mobile-first interfaces using familiar Bootstrap patterns combined with Vue's declarative component architecture.
As modern web applications demand increasingly sophisticated user interfaces, BootstrapVue bridges the gap between Bootstrap's battle-tested design system and Vue's progressive reactivity model. This combination allows teams to leverage existing Bootstrap expertise while embracing modern component-based development practices.
For teams exploring modern JavaScript frameworks, BootstrapVue represents an excellent option for those already familiar with Bootstrap's design patterns. The framework enables rapid UI development while maintaining clean, maintainable code architecture.
Key Benefits
- No jQuery Required: Pure Vue implementations eliminate jQuery dependencies entirely
- Component Rich Library: 50+ components including modals, cards, forms, navigation, and tables
- Responsive by Default: All components built with Bootstrap's responsive grid system
- TypeScript Support: Full TypeScript definitions included for type-safe development
- Tree Shaking: Import only needed components for optimized bundle sizes
For teams building custom Vue.js applications, BootstrapVue accelerates development without sacrificing flexibility or performance. The framework's component architecture supports both rapid prototyping and production-ready applications with equal effectiveness.
BootstrapVue at a Glance
50+
Vue Components
1,500+
Icons Available
6
Responsive Breakpoints
0
jQuery Required
Prerequisites
Before getting started with BootstrapVue, ensure your development environment meets these requirements:
| Package | Required Version | Recommended Version |
|---|---|---|
| Vue.js | 2.6+ | 2.6.12 |
| Bootstrap | 4.3.1+ | 4.6.1 |
| Popper.js | 1.16+ | 1.16.1 |
Note: Popper.js is required for dropdowns, tooltips, and popovers to function correctly. Many modern build tools include Popper as a transitive dependency, but explicit installation ensures compatibility.
For local development, you'll need Node.js and npm or yarn installed. The framework works with any build tool that supports modern JavaScript modules, including webpack, Vite, and Rollup. Understanding modern JavaScript syntax will help you write cleaner, more efficient code throughout your BootstrapVue projects.
Installation and Setup
Installing with npm or yarn
The recommended approach for most projects involves installing BootstrapVue through a package manager, which provides the best experience for both development and production builds.
# Using npm
npm install vue bootstrap@4 bootstrap-vue
# Using yarn
yarn add vue bootstrap@4 bootstrap-vue
After installation, register BootstrapVue in your application's entry point:
import Vue from 'vue'
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
// Import CSS files - order is important
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
// Register plugins
Vue.use(BootstrapVue)
Vue.use(IconsPlugin) // Optional: for icon components
The IconsPlugin provides access to BootstrapVue's extensive icon library with over 1,500 icons. Installing it separately allows tree shaking to work more effectively, though it can be included with the main package if preferred.
For production deployments, ensure your build tool is configured to process the imported CSS files correctly. Most modern bundlers handle this automatically when using standard import syntax.
Vue CLI Setup
Vue CLI provides a streamlined way to create Vue.js projects with BootstrapVue integration. This approach is ideal for teams that prefer a standardized project structure with built-in tooling.
# Create a new Vue CLI project
npx @vue/cli create my-bootstrapvue-app
cd my-bootstrapvue-app
# Install BootstrapVue
npm install bootstrap-vue
Configure your main entry file to include BootstrapVue:
import Vue from 'vue'
import App from './App.vue'
import { BootstrapVue } from 'bootstrap-vue'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap-vue/dist/bootstrap-vue.min.css'
Vue.config.productionTip = false
Vue.use(BootstrapVue)
new Vue({
render: h => h(App)
}).$mount('#app')
The Vue CLI approach provides hot module replacement, optimized builds, and a well-structured project layout. This setup works well for applications of any size, from simple prototypes to enterprise-scale systems.
For custom Vue.js development projects, this foundation allows rapid iteration while maintaining code quality and consistency across the development team.
Nuxt.js Integration
For server-side rendering and static site generation, BootstrapVue provides a dedicated Nuxt.js module that simplifies configuration and optimizes the build process. This integration is particularly valuable for applications requiring SEO optimization or improved initial load performance.
npm install bootstrap-vue
# or
yarn add bootstrap-vue
Add the module to your nuxt.config.js:
module.exports = {
modules: [
'bootstrap-vue/nuxt'
],
bootstrapVue: {
bootstrapCSS: true,
bootstrapVueCSS: true
}
}
The Nuxt.js module handles several complex tasks automatically: component registration, tree shaking configuration, and asset URL transformations. This makes SSR integration significantly simpler compared to manual setup approaches.
Server-side rendering improves both perceived performance and search engine visibility, making Nuxt.js with BootstrapVue an excellent choice for content-driven applications and marketing websites. Learn more about advanced performance optimization strategies for your Vue.js applications.
Core Components
Layout and Grid System
BootstrapVue's layout system mirrors Bootstrap 4's responsive grid, providing b-container, b-row, and b-col components for structuring page content. The grid uses a 12-column layout with six responsive breakpoints for precise control across device sizes.
<b-container>
<b-row>
<b-col cols="12" md="6">
<b-card title="Column 1">
Full width on mobile, 6 columns on medium+ screens
</b-card>
</b-col>
<b-col cols="12" md="6">
<b-card title="Column 2">
Responsive breakpoints: xs (<576px), sm (≥576px), md (≥768px), lg (≥992px), xl (≥1200px)
</b-card>
</b-col>
</b-row>
</b-container>
The grid system supports offset columns, column ordering, and auto-layout columns, providing complete flexibility for complex responsive designs without custom CSS.
Navigation Components
Navigation in BootstrapVue combines several components for responsive navigation bars, tabs, and pill-based interfaces:
<b-navbar toggleable="lg" type="dark" variant="info">
<b-navbar-brand href="#">Brand</b-navbar-brand>
<b-collapse id="nav-collapse" is-nav>
<b-navbar-nav>
<b-nav-item href="#">Home</b-nav-item>
<b-nav-item href="#">Features</b-nav-item>
</b-navbar-nav>
</b-collapse>
</b-navbar>
Modal Components
The b-modal component provides a flexible dialog system supporting confirmations, forms, and custom content with accessible focus trapping and keyboard navigation:
<b-button v-b-modal.modal-1>Open Modal</b-button>
<b-modal id="modal-1" title="BootstrapVue Modal">
<p>Modal content with accessible focus trapping and keyboard support.</p>
<template v-slot:modal-footer>
<b-button @click="$bvModal.hide('modal-1')">Close</b-button>
<b-button variant="primary">Save</b-button>
</template>
</b-modal>
These foundational components form the building blocks of most BootstrapVue applications. Combined with proper web development practices, they enable rapid creation of professional interfaces.
Card Components
Cards in BootstrapVue provide a flexible content container with support for headers, footers, images, and various content combinations:
<b-card
title="Card Title"
sub-title="Card Subtitle"
img-src="https://picsum.photos/600/300/?image=25"
img-alt="Image"
img-top
tag="article"
style="max-width: 20rem;"
class="mb-2"
>
<b-card-text>
Flexible content container with header, footer, image, and body support.
</b-card-text>
<b-button href="#" variant="primary">Action</b-button>
</b-card>
Cards support numerous variations including deck layouts, column wraps, and groups. The slot system allows complete customization of header, footer, and body sections while maintaining consistent styling.
Form Handling
BootstrapVue provides comprehensive form components with seamless v-model binding for two-way data synchronization:
<template>
<b-form @submit="onSubmit" v-if="show">
<b-form-group label="Email:" label-for="email">
<b-form-input
id="email"
v-model="form.email"
type="email"
placeholder="Enter email"
required
></b-form-input>
</b-form-group>
<b-form-group label="Name:" label-for="name">
<b-form-input
id="name"
v-model="form.name"
placeholder="Enter name"
required
></b-form-input>
</b-form-group>
<b-button type="submit" variant="primary">Submit</b-button>
</b-form>
</template>
<script>
export default {
data() {
return {
form: { email: '', name: '' },
show: true
}
},
methods: {
onSubmit(event) {
event.preventDefault()
alert(JSON.stringify(this.form))
}
}
}
</script>
Form Validation
BootstrapVue leverages Bootstrap's validation styles while providing custom state management:
<b-form novalidate validated @submit="submitForm">
<b-form-group
label="Email"
:invalid-feedback="emailFeedback"
:valid-feedback="emailValidFeedback"
:state="emailState"
>
<b-form-input
v-model="email"
:state="emailState"
required
></b-form-input>
</b-form-group>
</b-form>
Form components support all standard input types including text, email, password, number, date, select, checkbox, and radio. The validation system integrates with HTML5 constraints while providing custom feedback messages and state indicators. Understanding TypeScript's advanced types can help you build more robust form validation logic in your Vue applications.
Icons Integration
BootstrapVue includes over 1,500 icons from Bootstrap's icon library. The icons plugin must be registered separately to enable tree shaking:
import { IconsPlugin } from 'bootstrap-vue'
Vue.use(IconsPlugin)
Use icons throughout your templates with customizable sizes, colors, and animations:
<b-icon icon="star-fill" variant="warning"></b-icon>
<b-icon icon="heart" variant="danger"></b-icon>
<b-icon icon="gear" variant="secondary"></b-icon>
<!-- Large animated icon -->
<b-icon icon="spinner" animation="spin" font-scale="3"></b-icon>
<!-- Pulse animation -->
<b-icon icon="circle" animation="pulse" variant="primary"></b-icon>
Icons support custom sizes via font-scale, color variants using Bootstrap's contextual color system, and multiple animation types for loading states and notifications. The library includes icons for common interface elements, brand logos, and accessibility indicators. Incorporating custom React hooks patterns in your Vue code can help you create reusable icon and UI component logic.
Performance Optimization
Tree Shaking
BootstrapVue's most powerful optimization feature is tree shaking, which allows importing only the components you actually use:
// Not recommended - imports everything
import { BootstrapVue } from 'bootstrap-vue'
// Recommended - import specific plugins for tree shaking
import {
LayoutPlugin,
ButtonPlugin,
FormPlugin,
CardPlugin,
ModalPlugin
} from 'bootstrap-vue'
Vue.use(LayoutPlugin)
Vue.use(ButtonPlugin)
Vue.use(FormPlugin)
Vue.use(CardPlugin)
Vue.use(ModalPlugin)
Build Variants
| Variant | Environment | Tree Shaking | Use Case |
|---|---|---|---|
| ESM Module | webpack 2+, rollup.js | Yes | Best for modern bundlers |
| ESM Bundle | webpack 2+, rollup.js | Yes | Single file ESM build |
| CommonJS | webpack 1, others | No | Legacy bundlers |
| UMD | Browser | No | CDN/no-build setups |
Best Practices
- Import Only What You Need: Use specific plugins instead of the full library
- Use Component Slots: Leverage Vue's slot system for flexible content placement
- Local Component Registration: For larger apps, register components locally to improve tree shaking
- Combine with Vue Composition API: For Vue 2 projects using the composition API plugin
When properly optimized, a minimal BootstrapVue setup adds less than 100KB to your bundle. This performance profile makes it suitable for applications where bundle size significantly impacts user experience and search rankings. Our SEO services team can help you optimize your entire site for better search visibility and performance.
Why Choose BootstrapVue?
When evaluating UI frameworks for Vue.js, BootstrapVue offers distinct advantages for teams with existing Bootstrap experience:
| Feature | BootstrapVue | Other Frameworks |
|---|---|---|
| Design Familiarity | Bootstrap 4 patterns | Custom design systems |
| jQuery Required | No | Often yes |
| Bundle Size | Tree-shakeable | Usually larger |
| Learning Curve | Low (Bootstrap knowledge) | Higher (new patterns) |
| Customization | Bootstrap CSS/SCSS | Framework-specific |
BootstrapVue preserves your Bootstrap investment while adding Vue-native reactivity. This makes it ideal for teams transitioning from jQuery-based Bootstrap to modern Vue.js applications without redesigning their entire interface. If you're comparing framework options, our guide on React vs Svelte provides additional insights into modern JavaScript framework selection.
For custom web application development, the framework provides a balanced approach between rapid development and maintainable code architecture.
Get Started Today
BootstrapVue provides an excellent balance of familiarity and Vue-native functionality for building responsive web applications. By combining Bootstrap 4's extensive component library with Vue's reactive architecture, it enables rapid development of polished interfaces without sacrificing customization options.
The framework's tree shaking capabilities ensure lean production bundles, while comprehensive documentation and active community support make it accessible for developers of all experience levels.
Next Steps:
- Initialize a new Vue CLI project with BootstrapVue
- Explore the official BootstrapVue documentation for detailed component references
- Practice with the interactive examples in your local environment
- Build your first responsive interface using the grid and component system
Whether you're building a new application or migrating an existing Bootstrap project, BootstrapVue provides the tools and components needed for professional results. Our web development team has extensive experience implementing BootstrapVue solutions for clients across various industries.