All Projects → TeamWertarbyte → material-ui-toggle-icon

TeamWertarbyte / material-ui-toggle-icon

Licence: MIT license
An animated toggle icon for Material-UI.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to material-ui-toggle-icon

CompositeToggle
Composite toggle system for unity
Stars: ✭ 38 (+18.75%)
Mutual labels:  toggle
toggle-switch-control
Toggle switch control for WPF & Silverlight
Stars: ✭ 77 (+140.63%)
Mutual labels:  toggle
neu
Free icon set to the world
Stars: ✭ 26 (-18.75%)
Mutual labels:  icon
RevealLayout
揭示效果布局,可以指定2个子布局,以圆形揭示效果切换选中状态
Stars: ✭ 118 (+268.75%)
Mutual labels:  toggle
SettingsAppInSwiftUI
I have recreated a Settings App in iPhoneXR using SwiftUI concepts such as Form,Section,Toggle,Picker,Stack..etc
Stars: ✭ 37 (+15.63%)
Mutual labels:  toggle
MultiStateToggleButton
Android's ToggleButton offers only two states, MultiStateToggleButton fixes this by offering as many states depending on the number of drawable resources passed in.
Stars: ✭ 20 (-37.5%)
Mutual labels:  toggle
wp-showhide
Allows you to embed content within your blog post via WordPress ShortCode API and toggling the visibility of the cotent via a link.
Stars: ✭ 21 (-34.37%)
Mutual labels:  toggle
ts3admin.class
The ts3admin.class is a powerful api for communication with Teamspeak 3 Servers from your website! Your creativity knows no bounds!
Stars: ✭ 107 (+234.38%)
Mutual labels:  icon
css-toggle-component
Pure CSS Toggle Buttons as a Web component
Stars: ✭ 69 (+115.63%)
Mutual labels:  toggle
Expansionpanel
Android - Expansion panels contain creation flows and allow lightweight editing of an element.
Stars: ✭ 1,984 (+6100%)
Mutual labels:  toggle
shaf-toggle
Elegant, accessible toggle element. Upgrades existing <input type="checkbox" />
Stars: ✭ 28 (-12.5%)
Mutual labels:  toggle
WebRTC-Leak-Prevent-Toggle
Toggle WebRTC leak prevention in Chromium browsers.
Stars: ✭ 16 (-50%)
Mutual labels:  toggle
Nova-Dark-Theme
A dark theme for Laravel Nova
Stars: ✭ 72 (+125%)
Mutual labels:  toggle
Accordion.JS
Accordion.JS: Free jQuery Accordion plugin
Stars: ✭ 34 (+6.25%)
Mutual labels:  toggle
react-svg-icon-generator
Generate React Icon Component from SVG icons to show, resize and recolor them.
Stars: ✭ 65 (+103.13%)
Mutual labels:  icon
MultiToggleButton
Multiple state tap-to-toggle UIButton (like old camera flash button)
Stars: ✭ 81 (+153.13%)
Mutual labels:  toggle
nuxt-feature-toggle
The nuxt feature toggle module
Stars: ✭ 78 (+143.75%)
Mutual labels:  toggle
vue-icon-font
IconFont plugin for Vuejs
Stars: ✭ 25 (-21.87%)
Mutual labels:  icon
UltimateTabLayout
A library for tab layout use with viewpager. Very useful, small
Stars: ✭ 33 (+3.13%)
Mutual labels:  icon
Body Scroll Lock
Body scroll locking that just works with everything 😏
Stars: ✭ 3,357 (+10390.63%)
Mutual labels:  toggle

material-ui-toggle-icon

This project provides a toggle icon for Material-UI.

Demo

If you want to try the component yourself instead of watching a gif, head over to the styleguide for a live demo!

Installation

npm i --save material-ui-toggle-icon

Usage

The component takes two icons and a boolean that tells it whether to display the onIcon or the offIcon. When on is changed, the icon is switched with a transition.

import ToggleIcon from "material-ui-toggle-icon";
import IconButton from "@material-ui/core/IconButton";
import Visibility from "@material-ui/icons/Visibility";
import VisibilityOff from "@material-ui/icons/VisibilityOff";

export default class ToggleIconButton extends Component {
  state = { on: false };

  render() {
    <IconButton onClick={() => setState((state) => ({ on: !state.on }))}>
      <ToggleIcon
        on={state.on}
        onIcon={<Visibility />}
        offIcon={<VisibilityOff />}
      />
    </IconButton>;
  }
}

Properties

Name Type Default Description
offIcon* element The icon to be displayed if the on prop is set to false.
onIcon* element The icon to be displayed if the on prop is set to true.
on* bool Controls whether the onIcon or the offIcon is displayed.
style object Override the inline-styles of the root element.

* required property

License

The files included in this repository are licensed under the MIT license.

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].