Dark Mode Switch screenshot

Dark Mode Switch

Author Avatar Theme by Coliff
Updated: 18 Aug 2024
565 Stars

Add a dark-mode theme toggle with a Bootstrap Custom Switch

Overview

The Dark Mode Switch is a lightweight and customizable dark mode toggle switch that can be added to any website using Bootstrap. It allows users to switch between light and dark themes and utilizes local storage to store the user’s preference. With a minified and gzipped size of only 383 Bytes, it offers a quick and efficient way to enable dark mode on a website.

Features

  • Dark Mode Switch: Add a stylish dark mode theme toggle to your website.
  • Local Storage: Utilizes local storage to remember the user’s preference for dark mode.
  • Lightweight: With a size of only 383 Bytes when minified and gzipped, it offers excellent performance.

Installation

To install the Dark Mode Switch, you can follow these steps:

  1. Download the latest release from the official GitHub repository.
  2. Clone the repository using the command git clone https://github.com/coliff/dark-mode-switch.git.
  3. Install the package using npm by running npm install dark-mode-switch.
  4. Alternatively, you can install it with yarn by running yarn add dark-mode-switch.

Summary

The Dark Mode Switch is a simple yet powerful tool for adding a dark mode toggle to any website. With its lightweight code and easy installation process, it provides a seamless way to enhance the user experience by providing a dark theme option. Utilizing local storage, it remembers the user’s preference, allowing for a consistent dark mode experience across visits.