weatherstar / Switch
Licence: mit
🐰 A simple and powerful switch for checkbox.
Stars: ✭ 492
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Switch
Bootstrap Switch
Turn checkboxes and radio buttons in toggle switches.
Stars: ✭ 5,132 (+943.09%)
Mutual labels: switch, checkbox
Flutter smart select
SmartSelect allows you to easily convert your usual form select or dropdown into dynamic page, popup dialog, or sliding bottom sheet with various choices input such as radio, checkbox, switch, chips, or even custom input. Supports single and multiple choice.
Stars: ✭ 179 (-63.62%)
Mutual labels: switch, checkbox
React Icheck
🔘 iCheck components built with React. Highly customizable checkbox, radio buttons and radio group.
Stars: ✭ 175 (-64.43%)
Mutual labels: switch, checkbox
Aiflatswitch
Nicely animated flat design switch alternative to UISwitch
Stars: ✭ 904 (+83.74%)
Mutual labels: switch, checkbox
GDCheckbox
Customizable CheckBox / RadioButton component for iOS
Stars: ✭ 23 (-95.33%)
Mutual labels: checkbox, switch
Easy Toggle State
A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time.
Stars: ✭ 261 (-46.95%)
Mutual labels: switch, checkbox
Reactnative Animation Challenges
A series of animation challenges in React Native.
Stars: ✭ 352 (-28.46%)
Mutual labels: switch
Kmansonoff
Firmware for ESP8266 based itead Sonoff switches for use with HomeAssistant / mqtt
Stars: ✭ 282 (-42.68%)
Mutual labels: switch
Rekado
Payload launcher and serial number checker for Nintendo Switch
Stars: ✭ 455 (-7.52%)
Mutual labels: switch
Switchthemeinjector
Create custom themes for the nintendo switch !
Stars: ✭ 436 (-11.38%)
Mutual labels: switch
Switch Desktop
⚡️ Keyboard-driven commands to navigate your apps faster
Stars: ✭ 320 (-34.96%)
Mutual labels: switch
Edizon cheatsconfigsandscripts
The official EdiZon Editor Config and Editor Script repository.
Stars: ✭ 271 (-44.92%)
Mutual labels: switch
Switch
🐰 A simple and powerful iOS style switch for checkbox.
Installation
Standalone:
<link rel="stylesheet" href="dist/switch.css" />
<script src="dist/switch.js"></script>
npm:
$ npm install weatherstar-switch --save-dev
Usage
<input type="checkbox" class="checkbox-switch" />
standalone version
var el = document.querySelector('.checkbox-switch');
var mySwitch = new Switch(el, options);
work with module bundle
require('weatherstar-switch/dist/switch.css');
var Switch = require('weatherstar-switch');
var el = document.querySelector('.checkbox-switch');
var mySwitch = new Switch(el, options);
Settings and Defaults
defaults = {
size : 'default'
, checked : undefined
, onText : 'Y'
, offText : 'N'
, onSwitchColor : '#64BD63'
, offSwitchColor : '#fff'
, onJackColor : '#fff'
, offJackColor : '#fff'
, showText : false
, disabled : false
, onInit : function(){}
, beforeChange : function(){}
, onChange : function(){}
, beforeRemove : function(){}
, onRemove : function(){}
, beforeDestroy : function(){}
, onDestroy : function(){}
};
-
size
: size of switch element, can bedefault
|small
|large
-
checked
: state of switch and checbox, ifundefined
the switch state according to the checkbox -
onText
: text in the jack when switch ON -
offText
: text in the jack when switch OFF -
onSwitchColor
: color of checked switch element -
offSwitchColor
: color of unchecked switch element -
onJackColor
: color of checked jack element -
offJackColor
: color of unchecked jack element -
showText
: show or hide text in the jack of switch -
disabled
: enable or disable click events and changing the state of the switch -
onInit
: called when switch init finish -
beforeChange
: called before original checkbox'schecked
change -
onChange
: called when original checkbox'schecked
change -
beforeRemove
: called beforeremove switch element from DOM
-
onRemove
: called whenremove switch element from DOM
done -
beforeDestroy
: called beforeremove all events on switch element
-
onDestroy
: called whenremove all events on switch element
done
Predefined Classes
switch-danger
switch-primary
switch-black
switch-success
switch-warning
switch-info
switch-transparent
API
.getChecked()
Get switch element checked status.
.on()
Set switch ON.
.off()
Set switch OFF.
.toggle()
Toggle switch.
.disable()
Disable events bind to switch.
.enable()
Enable events bind to switch.
.destroy()
Remove all events bind to switch.
.remove()
Remove switch form DOM and show the checkbox.
License
MIT © zhiyul
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].