Introduction
In this article we are going to learn how we can add Bootstrap 5 in Angular 11. We add bootstrap by two methods, the first is with simple CDN links, and the second is by using package manager. I hope you will find this article useful.
In this article we will cover:
- What is Bootstrap?
- Create Angular 11 Project
- Add Bootstrap Using CDN Links
- Add Bootstrap Using Package Manager
- Uninstall Bootstrap
What Is Bootstrap?
Bootstrap is a free and open-source CSS framework directed at responsive, mobile-first front-end web development. It contains CSS- and JavaScript-based design templates for typography, forms, buttons, navigation, and other interface components.
Create Angular 11 Project
In my pc there is already Angular ’s latest version had install. If you not have angular in your system you can install it in few steps. You can refer angular’s official website to learn how to install angular.

Run following command to create new Angular project. Here ng means Angular, new determine that create new project and BootstrapInAngular is project name.
- ng new BootstrapInAngular
After running this command you will ask some question about add routing and which style sheet you want to use in your project. You can choose as your requirement.

Add Bootstrap Using CDN Links
Step 1
Go to bootstrap official website getbootstrap.com .
Step 2
Click on download button.
Step 3
Scroll down and you can see CDN Via jsDelivr. Copy both css and js links.

Step 4
Open your index.html file and put both links.

Step 5
Now let’s see bootstrap is working or not. Open app.component.html file and add bootstrap components which you want. Here I add alert boxes for checking.
- <h1>Bootstrap In Angular Using CDN</h1>
- <br>
- <br>
- <div class="alert alert-primary" role="alert">
- A simple primary alert—check it out!
- </div>
- <div class="alert alert-secondary" role="alert">
- A simple secondary alert—check it out!
- </div>
- <div class="alert alert-success" role="alert">
- A simple success alert—check it out!
- </div>
- <div class="alert alert-danger" role="alert">
- A simple danger alert—check it out!
- </div>
- <div class="alert alert-warning" role="alert">
- A simple warning alert—check it out!
- </div>
- <div class="alert alert-info" role="alert">
- A simple info alert—check it out!
- </div>
- <div class="alert alert-light" role="alert">
- A simple light alert—check it out!
- </div>
- <div class="alert alert-dark" role="alert">
- A simple dark alert—check it out!
- </div>








EliseoPosted Jun 22, 2021, 11:30 AM
My good!!!! why on earth not change the angular.json file?
Michal SzymanskiPosted May 8, 2021, 7:48 PM
Great article, thanks! Btw, there is a very nice and free integration for Bootstrap 5 and Angular 11. Have look at MDB UI KIT https://mdbootstrap.com/docs/b5/angular/
NNN CCCPosted Apr 23, 2021, 7:33 PM
Great article. Also, instead of "You can see in your angular.json file that bootstrap is added", it should say "You can see in your package-lock.json (and even package.json) file that bootstrap is added"