Learn Bootstrap integration

Optional files configure Unpoly to work with Bootstrap's CSS classes. With the integration loaded, navigation feedback, form validation and overlays use the classes and layout rules that Bootstrap expects.

Loading the integration

Load the files matching your Bootstrap version after Unpoly's own files. Builds for Bootstrap 3, 4 and 5 are available from a CDN:

Development Production
unpoly-bootstrap3.js unpoly-bootstrap3.min.js (0.5 KB gzipped)
unpoly-bootstrap3.css unpoly-bootstrap3.min.css (0.2 KB gzipped)
unpoly-bootstrap4.js unpoly-bootstrap4.min.js (0.5 KB gzipped)
unpoly-bootstrap4.css unpoly-bootstrap4.min.css (0.2 KB gzipped)
unpoly-bootstrap5.js unpoly-bootstrap5.min.js (0.5 KB gzipped)
unpoly-bootstrap5.css unpoly-bootstrap5.min.css (0.2 KB gzipped)

The same files ship with Unpoly's npm package:

import 'unpoly/unpoly.js'
import 'unpoly/unpoly.css'
import 'unpoly/unpoly-bootstrap5.js'  // mark-line
import 'unpoly/unpoly-bootstrap5.css' // mark-line

What the integration configures

The JavaScript file adjusts Unpoly's configuration to Bootstrap's conventions:

The stylesheet lets .container and .container-fluid elements fill Unpoly overlays without Bootstrap's page padding.