Sarah Hassan
Posted on October 17, 2021
Today I will list steps needed to download Bootstrap 5 using npm.
1- Install Bootstrap
.
npm install bootstrap
2- Use Bootstrap
:
You have 2 options to import Bootstrap's JS.
Option 1:
import all of Bootstrap’s plugins so you will not need @popperjs/core
package
import '../../node_modules/bootstrap/dist/js/bootstrap.bundle.min.js';
Option 2:
Import just plugins you need. Then you will need to install and import @popperjs/core
package before import bootstrap plugins
a- Install @popperjs/core
package.
npm i @popperjs/core
b- In your app.js file import bootstrap and @popperjs/core.
import '../../node_modules/@popperjs/core/dist/umd/popper.min.js';
import 'bootstrap/js/dist/dropdown';
c- Import Bootstrap's CSS.
@import "bootstrap/scss/bootstrap";
đź’– đź’Ş đź™… đźš©
Sarah Hassan
Posted on October 17, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.