Introduction
Bootstrap makes a developer's life easy while developing the application with realistic UI. It is tough to set up the UI manually or ask another developer to set up the basic layout. However, by using Bootstrap, developers can set the application's basic layout Easly.
Bootstrap provides breakpoints, containers, grids, column structures, forms, content, and components. Obviously, to create a customized template or design, you need to write custom CSS code and JavaScript functions, but Bootstrap is fully flexible, and you can write your custom CSS and JS functions along with Bootstrap. Let's check out how we can add a bootstrap to the angular application.
Step 1. Create a new Angular Application using the below command.
In this article, I have used employee shift management for demo purposes. I have used the below command to create a new angular application.
Step 2. Add controls to the application page.
Add the controls or forms based on the requirements of your application. In this demo, I have used employee shift management, so I added a field called Employee name, type, shift, and shift date. Check out the sample code before adding the bootstrap classes and also preview for the same.
app.component.ts
app.component.html
Below is the preview without bootstrap. I only used table structure and form controls.
![Bootstrap]()
Step 3. Install Bootstrap.
Use the below command to install bootstrap and bootstrap icons.
![Install Bootstrap]()
Step 4. Add ng bootstrap.
Once the bootstrap is installed, add the ng-bootstrap. Below is the command to add ng-bootstrap. Here, we are using ng add instead of npm i. because it will install ng-bootstrap for the default application specified in your angular.json. If you have multiple projects and you want to target a specific application, you could specify the --project option.
![Ng bootstrap]()
Step 5. Import Bootstrap to style.scss file at the root level.
Once the bootstrap install and add are completed now need to add a reference of the bootstrap file to the app.module.ts file and also need to import CSS and JS file references to the styles.scss file.
app.module.ts
![Import CSS]()
styles.scss
![Style CSS]()
Step 6. Add bootstrap class to controls.
Just install Bootstrap and add references to the angular application. Before adding any new class, check the effect of Bootstrap with the below screen print.
![Angular application]()
Now, let’s add a bootstrap class and see how it works.
Step 7. Check the Screen reflects changes.
app.component.html
Desktop Browser
![Desktop Browser]()
Mobile View
![Mobile View]()
Summary
In this article, we have learned about bootstrap integration with angular applications. It made it easy to create applications with smooth UI with less effort. Bootstrap supports mobile responsiveness. So, no extra effort is required for the mobile view. If any customized design or component is required, then the bootstrap is so flexible that you can customize it. You can also design your component using Bootstrap.