Installation
A detailed walkthrough for installing and configuring our JavaScript library to enhance your web development projects.
Install Bootstrap Theme Toggler 1
bash
npm i bs-theme-toggler
or
HTML
<script src="https://cdn.jsdelivr.net/npm/bs-theme-toggler@1.1.1/dist/bootstrap-theme-toggler.min.js"></script>
You can either download the production files.
Initialize Theme Toggler 2
JavaScript
import BootstrapThemeToggler from 'bs-theme-toggler';
BootstrapThemeToggler.run();
or
HTML
<script type="module">
import BootstrapThemeToggler from 'bs-theme-toggler';
BootstrapThemeToggler.run();
</script>
Without invoking this function, the library will not initialize.
For more details, visit examples page.
Set the Theme Toggler's location (optional) 3
JavaScript
BootstrapThemeToggler.run({
root: '#example-container'
});
💡
You can find additional configuration options.