All Projects → JNKKKK → Moretoggles.css

JNKKKK / Moretoggles.css

Licence: mit
A pure CSS library that provides you with a variety of nice-looking toggles

Projects that are alternatives of or similar to Moretoggles.css

Web Client
Generic Linked Data browser and UX component framework. Apache license.
Stars: ✭ 105 (-82.38%)
Mutual labels:  ui-components, stylesheets
React Native Ratings
Tap and Swipe Ratings component for React Native.
Stars: ✭ 571 (-4.19%)
Mutual labels:  ui-components
Snacky
Snacky is a small library to help you adding a Snackbar to your android project.
Stars: ✭ 482 (-19.13%)
Mutual labels:  ui-components
Circlebar
A fun, easy-to-use tab bar navigation controller for iOS.
Stars: ✭ 513 (-13.93%)
Mutual labels:  ui-components
Cfnotify
A customizable framework to create draggable views
Stars: ✭ 490 (-17.79%)
Mutual labels:  ui-components
Uiw
⚛️ @uiwjs A high quality UI Toolkit, A Component Library for React 16+.
Stars: ✭ 531 (-10.91%)
Mutual labels:  ui-components
Reactivesearch
Search UI components for React and Vue: powered by appbase.io / Elasticsearch
Stars: ✭ 4,531 (+660.23%)
Mutual labels:  ui-components
Golden Layout
A multi window layout manager for webapps
Stars: ✭ 5,448 (+814.09%)
Mutual labels:  ui-components
React Chat Elements
Reactjs chat elements chat UI, react chat components
Stars: ✭ 565 (-5.2%)
Mutual labels:  ui-components
Toastnotifications
Toast notifications for WPF allows you to create and display rich notifications in WPF applications. It's highly configurable with set of built-in options like positions, behaviours, themes and many others. It's extendable, it gives you possibility to create custom and interactive notifications in simply manner.
Stars: ✭ 507 (-14.93%)
Mutual labels:  ui-components
Merakiui
🚀 ☄️ Beautiful TailwindCSS components that support RTL languages.
Stars: ✭ 496 (-16.78%)
Mutual labels:  ui-components
Po Angular
Biblioteca de componentes Angular.
Stars: ✭ 497 (-16.61%)
Mutual labels:  ui-components
Incubator Weex Ui
🏄 A rich interaction, lightweight, high performance UI library based on Weex.
Stars: ✭ 4,793 (+704.19%)
Mutual labels:  ui-components
React Spectrum
A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
Stars: ✭ 5,876 (+885.91%)
Mutual labels:  ui-components
React Popover
A smart popover component for React
Stars: ✭ 577 (-3.19%)
Mutual labels:  ui-components
Angular Css
CSS on-demand for AngularJS [Looking for New Maintainers]
Stars: ✭ 481 (-19.3%)
Mutual labels:  stylesheets
Premailer.net
C# library that moves your stylesheets to inline style attributes, for maximum compatibility with E-mail clients.
Stars: ✭ 503 (-15.6%)
Mutual labels:  stylesheets
Flutter ecommerce template
This is an eCommerce minimalist template with a clean and beautiful design for Flutter.
Stars: ✭ 525 (-11.91%)
Mutual labels:  ui-components
Tailblocks
Ready-to-use Tailwind CSS blocks.
Stars: ✭ 6,660 (+1017.45%)
Mutual labels:  ui-components
Shineout
高性能React组件库
Stars: ✭ 577 (-3.19%)
Mutual labels:  ui-components

MoreToggles.css

Toggles 1.png

release badge jsDelivr hits badge license badge


MoreToggles.css is a pure CSS library that provides you with a variety of nice-looking toggles.

You only have to add a new ClassName to the wrapper div and MoreToggles.css will do the magic for you.

Check out all available styles here

Features

🔹 Pure CSS

🔹 13 different styles (more styles are coming)

🔹 Perfect scaling

Usage

Import the stylesheet into your document's <head>

<head>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/JNKKKK/[email protected]/output/moretoggles.min.css">
</head>

Wrap an extra div around your <input> and <label>. Pick a style here . Add the corresponding mt-* class to <div>.

<div class="mt-ios"> 
  <input id="1" type="checkbox" />
  <label for="1"></label>
</div>

Styles

MoreToggles.css currently has 13 different styles. And for each style, several color patterns are provided.

Check out all available styles here

List of all the available class names:

IOS Style mt-ios mt-ios-red mt-ios-blue

Android Style mt-android mt-android-indigo mt-android-violet mt-android-pink mt-android-orange

IO Switch Style mt-io mt-io-yellow mt-io-garden mt-io-navi mt-io-violet

Normal Style mt-normal mt-normal-garden mt-normal-navi mt-normal-violet mt-normal-juice

Transparent Style mt-transparent mt-transparent-navi mt-transparent-violet mt-transparent-blood mt-transparent-brown

Check Style mt-check mt-check-garden mt-check-matte mt-check-fruit mt-check-pink

Yes No Style mt-yesno mt-yesno-garden mt-yesno-matte mt-yesno-fruit mt-yesno-blush

Square Style mt-square mt-square-garden mt-square-tomato mt-square-matcha mt-square-pink

Square 3d Style mt-square3d mt-square3d-garden mt-square3d-tomato mt-square3d-matcha mt-square3d-blush

Emoji Style mt-emoji-mood mt-emoji-gender mt-emoji-pet mt-emoji-mute mt-emoji-like

Star Style mt-star mt-star-garden mt-star-tomato mt-star-pink mt-star-golden

Heart Style mt-heart mt-heart-blush mt-heart-indigo mt-heart-pink mt-heart-golden

Icon Switch Style mt-icon-music mt-icon-ring mt-icon-mic mt-icon-cam mt-icon-pin

Import Only a Single Style

If you care about the size of CSS files. Instead of import moretoggles.min.css, you can import the styles you want sepsrately.

In the /output folder, you can find all of the built CSS files. The naming convention is moretoggles.STYLE_NAME.min.css

Example for importing only Android Style

<head>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/JNKKKK/[email protected]/output/moretoggles.android.min.css">
</head>

Scaling

You can scale the toggles by assign a font-size attribute style="font-size:10px;" to the wrapper div. You can try different numbers and the toggle will scale smoothly.

<div class="mt-ios" style="font-size:10px;">
  <input id="3" type="checkbox" />
  <label for="3"></label>
</div>

Disabled Toggles

Just like regular checkbox, you can add disabled attribute to <input> tag.

<div class="mt-ios">
  <input id="4" type="checkbox" disabled/>
  <label for="4"></label>
</div>

Listening to the change event

Since the toggle is actually an <input> with type="checkbox", you can use addEventListener to listen to the onchange event.

<div class="mt-ios"> 
  <input id="5" type="checkbox" />
  <label for="5"></label>
</div>

<script>
  const toggle = document.getElementById('5');

  toggle.addEventListener('change', (event) => {
    if (event.target.checked) {
      alert('checked');
    } else {
      alert('not checked');
    }
  });
</script>

Notice

Nest the <input> directly inside the <label> is NOT supported, although it is valid HTML syntax.

Don't ☹️

<div class="mt-ios"> 
  <label>
    <input type="checkbox" />
  </label>
</div>

Do 😃

<div class="mt-ios"> 
  <input id="1" type="checkbox" />
  <label for="1"></label>
</div>

License

MoreToggles.css is licensed under the MIT license. (https://opensource.org/licenses/MIT)

Contributing

This project is still in very early stage. Your contribution is very welcome. Feel free to submit a pull request!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].