angular add bootstrap

angular

Bootstrap is a popular CSS framework that provides a set of styles and layout modules for building responsive and mobile-first websites and applications.

To add Bootstrap to an Angular project, you can follow these steps:

  1. Install Bootstrap: You can install Bootstrap in your Angular project using npm:
npm install bootstrap
  1. Import Bootstrap in your application: To use Bootstrap in your application, you will need to import the Bootstrap CSS styles. You can do this by adding the following line to the styles array in your application’s angular.json file:
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.css",
"src/styles.css"
]
  1. Use Bootstrap components: You can now use Bootstrap components in your Angular templates by using the corresponding class names. For example, to create a button with the Bootstrap “primary” style, you can use the btn-primary class:

<button class="btn btn-primary">Click me</button>

Alternatively, you can also use the ng-bootstrap library, which provides a set of Angular components that are built on top of Bootstrap. This allows you to use Bootstrap styles and layout modules in your Angular templates without having to use class names directly.