nettofarah / react-flexible-switch Goto Github PK
View Code? Open in Web Editor NEW:on: Easy and Flexible React Switches
Home Page: http://nettofarah.github.io/react-flexible-switch
:on: Easy and Flexible React Switches
Home Page: http://nettofarah.github.io/react-flexible-switch
I love the UI options and customizability with this component. It would be great if it could follow the React standards for input/form elements though: https://facebook.github.io/react/docs/forms.html
Basically either having the ability to pass in a value and make in a controlled component, or use a defaultValue and then be able to do something like this.refs.switch.value
to get the value of the component.
Because of class names, when using with bootstrap, labels get color:#fff
and become invisible.
To avoid this you should use bem style classes for example:
.switch
.switch--active
.switch__label
.switch__cirlce
or something else.
When using this component with server side rendering, this error occured:
ReferenceError: window is not defined
This is when you check about touch device:
this.isTouchDevice = window['ontouchstart'] !== undefined;
Currently, i just add this:
if (window !== undefined)
this.isTouchDevice = window['ontouchstart'] !== undefined;
else
this.isTouchDevice = false;
Not sure this is the good solution, but if it can help...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.