Skip to content

Latest commit

 

History

History
107 lines (73 loc) · 5.62 KB

File metadata and controls

107 lines (73 loc) · 5.62 KB

GitHub license Latest release Bootstrap 5 JSDelivr Badge NPM Badge EOL Funding

Coverage Status Maintainability Rating Reliability Rating Security Rating Security

Bootstrap Darkmode Toggle

Bootstrap Darkmode Toggle is a plugin for bootstrap to add a light/dark mode switch in to your app.


Library Distributions

Version Bootstrap Support Last Release
v1 Bootstrap 5 Latest release

See EOL for each version in Security Policy Page.

Demo and documentation

Please read our documentation page for a completed usage explanation: https://palcarazm.github.io/bs-darkmode-toggle/



Installation

CDN

JSDelivr Badge

ECMAS Interface

<!-- Consider loading Bootstrap and Bootstrap 5 toggle dependencies -->
<script src="https://cdn.jsdelivr.net/npm/bs-darkmode-toggle@#version#/js/bs-darkmode-toggle.ecmas.min.js"></script>

jQuery Interface

<!-- Consider loading Bootstrap, jQuery and Bootstrap 5 toggle dependencies -->
<script src="https://cdn.jsdelivr.net/npm/bs-darkmode-toggle@#version#/js/bs-darkmode-toggle.jquery.min.js"></script>

Download

Latest release

NPM

NPM Badge

npm install bs-darkmode-toggle@#version#

Yarn

yarn add bs-darkmode-toggle@#version#

Usage

Initialize with HTML

Simply create a div with the data attribute data-plugin="bs-darkmode-toggle".

<div data-plugin="bs-darkmode-toggle"></div>

Initialize with JS

Simply select the element and invoke the Boostrap Darkmode Toggle API.

<div id="bs-darkmode-toggle"></div>
<script>
  document.getElementById('bs-darkmode-toggle').bsDarkmodeToggle();
</script>

Collaborators welcome!

GitHub Contributors

¿Do you like the project? Give us a ⭐ in GitHub.