Skip to content

Bootstrap 5 Theme

The Bootstrap 5 theme makes DotSelect match the look and feel of Bootstrap 5 form controls. It uses Bootstrap's design tokens for colors, spacing, borders, and typography.

Usage

CDN

Include Bootstrap 5 CSS first, then the DotSelect Bootstrap theme:

html
<!-- Bootstrap 5 CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">

<!-- DotSelect Bootstrap 5 Theme -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dot-select@latest/dist/css/themes/bootstrap5.min.css">

<!-- DotSelect JS -->
<script src="https://cdn.jsdelivr.net/npm/dot-select@latest/dist/js/dot-select.min.js"></script>

npm

js
import 'bootstrap/dist/css/bootstrap.min.css';
import 'dot-select/dist/css/themes/bootstrap5.min.css';

SCSS

scss
// Import Bootstrap variables first
@import 'bootstrap/scss/variables';

// Then import the DotSelect Bootstrap 5 theme
@import 'dot-select/src/scss/themes/bootstrap5';

Integration with Bootstrap Forms

DotSelect inherits Bootstrap's form sizing and validation states:

Form Sizes

The theme respects Bootstrap's .form-select-sm and .form-select-lg classes:

Validation States

Bootstrap validation classes are supported:

Input Groups

Use DotSelect inside Bootstrap input groups:

Bootstrap Theme Variables

The Bootstrap 5 theme maps to Bootstrap's CSS custom properties:

DotSelect VariableBootstrap Equivalent
$ds-primary-colorvar(--bs-primary)
$ds-border-colorvar(--bs-border-color)
$ds-border-radiusvar(--bs-border-radius)
$ds-font-familyvar(--bs-body-font-family)
$ds-font-sizevar(--bs-body-font-size)
$ds-focus-ring-colorvar(--bs-focus-ring-color)

TIP

If you customize Bootstrap's SCSS variables, the DotSelect Bootstrap theme will automatically pick up those changes when compiled together.

MIT Licensed