Popularity
0.5
Stable
Activity
10.0
Stable
0
2
0

Programming language: JavaScript
License: MIT License
Tags: UI Components     Toggle     Form Components    

ui-switch alternatives and similar libraries

Based on the "Toggle" category.
Alternatively, view ui-switch alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of ui-switch or a related project?

Add another 'Toggle' Library

README

ui-switch - A React component

๐Ÿ‘‰ Demos: Codepen | Codesandbox ๐Ÿ‘ˆ


I wanted a solid, beautiful Switch component, with absolutly minimal footprint.

I did not want to install a full components-lib, even if I would be using only a single component, I wanted it to be really lightweight but also highly customizable, and CSS variables are perfect for this, since they are much better than pre-compiled variabled, since they are computed on-the-fly, the CSS itself if kept to a minimum, when wanted to create different design versions of the Switch component.

Install:

npm i @yaireo/ui-switch

Usage

import Switch from '@yaireo/ui-switch'
import '@yaireo/ui-switch/src/switch.scss'
// or the pre-compiled CSS:
// import '@yaireo/ui-switch/dist/switch.css'
// use in JSX:
<form>
  <Switch checked={checked} onChange={onSwitchChange}/>
  <Switch textRight>Label on the right</Switch>
  <Switch disabled checked>Disabled</Switch>
  <Switch indeterminate>Indeterminate</Switch>
  <Switch style={{'--size':'12px', '--thumb-scale':2.2, 'thumb-color-on':'green'}}>Inline styles</Switch>
</form>

Compile source:

> npm install
> gulp


*Note that all licence references and agreements mentioned in the ui-switch README section above are relevant to that project's source code only.