Skip to content

p-cauty/css-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

css-toggle

A minimalist CSS-only toggle for your websites.

image

image

Installation

Just copy the toggle.css file into your project and add the following line of HTML into your <head> tag:

<link rel="stylesheet" href="./toggle.css" />

Usage

Just add these two elements anywhere in your HTML:

<input type="checkbox" id="your_unique_id" class="check" />
<label for="your_unique_id" class="toggle"></label>

You can add an infinite number of toggles as long as they all have differents id/for attributes.

Example

You can see a working example right here : https://p-cauty.github.io/css-toggle/

Use the value in your backend

Just add a name attribute to your input tags and handle them as regular checkboxes in your backend.

About

A minimalist CSS-only toggle for your websites

Resources

License

Stars

Watchers

Forks

Packages

No packages published