Angular widgets built from the ground up using only Bootstrap 4 CSS with APIs designed for the Angular ecosystem. No dependencies on 3rd party JavaScript.
Please check our demo site and the list of issues to see all the things we are working on. Feel free to make comments there.
- Demo
- Dependencies
- Installation
- Supported browsers
- Getting help
- You think you've found a bug?
- Contributing to the project
- Code of conduct
Please check all components we have in action at https://ng-bootstrap.github.io
The only two dependencies are Angular and Bootstrap 4 CSS. The supported versions are:
ng-bootstrap | Angular | Bootstrap CSS |
---|---|---|
1.x.x | 5.0.2 | 4.0.0 |
2.x.x | 6.0.0 | 4.0.0 |
3.x.x | 6.1.0 | 4.0.0 |
4.x.x | 7.0.0 | 4.0.0 |
5.x.x | 8.0.0 | 4.3.1 |
6.x.x | 9.0.0 | 4.4.1 |
We strongly recommend using Angular CLI for setting up a new project.
If you're using Angular ≥ 9.0.0 and ng-bootstrap ≥ 6.0.0, you have to install the @angular/localize
polyfill
ng add @angular/localize
See more details in the official documentation.
You also need to add Bootstrap CSS to your application using your preferred way (see Bootstrap instructions)
For example you could install Bootstrap from npm
npm install bootstrap
and add Bootstrap CSS or SCSS to your project
/* update your 'styles.css' with */
@import '~bootstrap/dist/css/bootstrap.css';
/* or your 'styles.scss' with */
@import "~bootstrap/scss/bootstrap";
Please note that you need only CSS and should not add other JavaScript dependencies like bootstrap.js
, jQuery
or popper.js
as ng-bootstrap's goal is to completely replace them.
Installing from npm is simply doing
npm install @ng-bootstrap/ng-bootstrap
Once installed you need to import our main module:
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
@NgModule({
...
imports: [NgbModule, ...],
...
})
export class YourAppModule {
}
Alternatively you could only import modules with components you need, ex. pagination and alert. The resulting bundle will be smaller in this case.
import {NgbPaginationModule, NgbAlertModule} from '@ng-bootstrap/ng-bootstrap';
@NgModule({
...
imports: [NgbPaginationModule, NgbAlertModule, ...],
...
})
export class YourAppModule {
}
We support the same browsers and versions supported by both Bootstrap 4 and Angular, whichever is more restrictive. See Angular browser support and Bootstrap browser support for more details.
Out code is automatically tested on all supported browsers.
Please, do not open issues for the general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on StackOverflow where maintainers are looking at questions tagged with ng-bootstrap
.
StackOverflow is a much better place to ask questions since:
- there are hundreds of people willing to help on StackOverflow
- questions and answers stay available for public viewing so your question / answer might help someone else
- SO voting system assures that the best answers are prominently visible.
To save your and our time we will be systematically closing all the issues that are requests for general support and redirecting people to StackOverflow.
We want to fix it ASAP! But before fixing a bug we need to reproduce and confirm it.
We ask you to respect two things:
- fill the GitHub issue template by providing the bug description and appropriate versions of Angular, ng-bootstrap and TypeScript
- provide a use-case that fails with a minimal reproduction scenario using StackBlitz (you can start by forking one from our demo page)
A minimal reproduction scenario allows us to quickly confirm a bug (or point out a coding problem) as well as confirm that we are fixing the right problem.
Please note that we will be insisting on a minimal reproduce scenario in order to save maintainers time and ultimately be able to fix more bugs. We'll mark the issue as non-actionable without it and close if not heard from the reporter.
Interestingly, from our experience users often find coding problems themselves while preparing a minimal StackBlitz. We understand that sometimes it might be hard to extract essentials bits of code from a larger code-base but we really need to isolate the problem before we can fix it.
Please check the DEVELOPER.md for documentation on running the project locally and CONTRIBUTING.md for contribution guidelines.
Please take a moment and read our Code of Conduct