Toggle Dark Mode Theme With The Dedicated Bootstrap Switch

Dark Mode Switch is a popular UI design concept that has been adopted by most operating systems (like iOS, Windows, etc.) and mobile / web apps).

This JavaScript plugin uses the Bootstrap Keys component to create a toggle that allows the user to toggle between Dark Mode and Light Mode on your webpage. The plugin uses HTML5 local storage to save the current profile selected by the user.

How to make use of it:

1. Load the stylesheet dark-mode.css and JavaScript dark-mode.js in your Bootstrap undertaking.

<link rel="stylesheet" href="dark-mode.css">
<script src="dark-mode-switch.min.js"></script>

2. Create a Bootstrap swap to toggle between Dark Mode and Light Mode.

<div class="custom-control custom-switch">
  <input type="checkbox" class="custom-control-input" id="darkSwitch">
  <label class="custom-control-label" for="darkSwitch">Dark Mode</label>
</div>

3. Override the default CSS types when working the webpage within the Dark mode.

[data-theme="dark"] {
  background-color: #111 !important;
  color: #eee;
}

[data-theme="dark"] .bg-light {
  background-color: #333 !important;
}

[data-theme="dark"] .bg-white {
  background-color: #000 !important;
}

[data-theme="dark"] .bg-black {
  background-color: #eee !important;
}

Dark Mode Swap For Bootstrap, Dark Mode Switch Plugin/Github


See Demo And Download

Official Website(coliff): Click Here

This superior jQuery/javascript plugin is developed by coliff. For extra Advanced Usages, please go to the official website.

Related Posts

Confetti-Falling-Animation-Effect-party

Confetti Falling Animation Effect In JavaScript | party.js

Party.js is a JavaScript library to brighten user site experience with visual effects! Celebrate success with dom confetti! The library is written in TypeScript and compiled into…

jquery-cookie-consent

Simple jQuery Cookie Consent Plugin

jquery.cookie-consent is a simple jQuery plugin to request consent to use cookies. An easy-to-use and highly customizable cookie consent bar that informs your visitors of the use…

Timepicker-Plugin-for-jQuery

Timepicker JavaScript Plugin for jQuery Inspired by Google Calendar

jquery.timepicker is a lightweight jQuery timer plugin inspired by Google Calendar. It supports both mouse and keyboard navigation and weighs 5.5KB minified and compact. Features: Highly customizable…

angular-ngx-carousel-slider

A Lightweight, Touchable, and Responsive Angular Universal Carousel Library

ngxCarousel is a lightweight, tactile, and responsive library for creating an angular carousel. No dependencies, no more hammer. Must Read: Angular Responsive Image Slider With Lightbox Popup…

random-number-picker

Generate a Random Number Picker In Vanilla JavaScript

Random Number Picker is a Vanilla JS-based number picker that allows you to generate a random number within a specified range. Must Read: Generating Lottery Numbers Using…

Nepali-Date-Picker-jQuery-Plugin

Nepali Date Picker jQuery Plugin | nepaliDatePicker

Nepali Date Picker is a customizable, easy-to-use, and input-based date picker plugin mostly based on the Nepali calendar. Users can choose a Nepali date in the navigable…