4.1.1 • Published 2 years ago

ios-switch-material-ui v4.1.1

Weekly downloads
73
License
MIT
Repository
github
Last release
2 years ago

ios-switch-material-ui Weekly downloads

A material-ui component which implements a iOS like switch


Demo

You can access the storybook for this component here.

Props

The component accepts the props defined bellow in the table.

Props accepted by IosSwitchMaterialUi

NameTypeRequiredDefaultDescription
aspectRationumberno2The width/height raport
colorKnobOnLeftstringno#eeeeeeThe color of the knob when it is on the left
colorKnobOnRightstringno#5269d8The color of the knob when it is on the right
colorSwitchstringno#e2e2e2The color of the switch
defaultKnobOnLeftbooleannofalseThe initial position of the knob
disabledbooleannofalseThe component is disabled
knobOnLeftbooleannofalseIf true, the knob is on the left, othwise on the right
knobSizenumberno18The size of the knob
onChange(knobOnLeft: boolean) => voidnoundefinedThe callback function called when the knob changes its position

Versions

IosSwitchMaterialUi usesMaterial-uiReact
1.0.x3.6.016.6.3
1.1.x3.9.216.8.1
1.2.x3.9.316.8.6
2.0.x4.0.216.8.6
2.1.x4.2.016.8.6
3.0.x4.2.116.8.6
3.1.x4.3.216.9.0
3.2.x4.9.016.9.0
3.3.x4.9.716.9.0
3.4.x4.10.216.9.0
3.5.x4.11.016.9.0
3.6.x4.11.316.9.0 or 17.0.0
3.7.x4.12.316.9.0 or 17.0.0
4.0.x5.10.1718.0.0

About versioning schema used for IosSwitchMaterialUi

  • Major - it will be increased if the major version of the dependat package changes or there are breaking changes in the code of IosSwitchMaterialUi
  • Minor - it will be increased if no major version of the dependat package changes, but there are changes of the minor or patch versions of it
  • Patch - it will be increased if there are no changes of the dependat packages, but there are non breaking changes in the code of IosSwitchMaterialUi

Example

The base component which allows to create read-only or creatable select components for selecting only one or more values:

import * as React from 'react';
import IosSwitchMaterialUi from 'ios-switch-material-ui';

class App extends React.Component {
  render() {
    return (
      <div className="App">
        <IosSwitchMaterialUi
          colorKnobOnLeft="red"
          colorKnobOnRight="blue"
          colorSwitch="aqua"
          onChange={this.handleChange}
        />
      </div>
    );
  }

  handleChange = (knobOnLeft: boolean) => {
    console.log(knobOnLeft);
  };
}

export default App;

Changelog

1.0.0

  • ios-switch-material-ui is made publicly available

1.1.0

  • Updated packages

1.2.0

  • Updated packages

2.0.0

  • Updated packages

2.1.0

  • Updated packages

3.0.0

  • Made the component to be controlled and uncontrolled
  • Added a storybook
  • Updated packages

3.0.1

  • Updated typescript definition of the component

3.0.2

  • Removed usage of lodash

3.0.3

  • Fixed bug related to not changing the position of the knob in controlled mode

3.1.0

  • Updated packages

3.2.0

  • Updated packages

3.3.0

  • Updated packages
  • Moved from npm to yarn

3.4.0

  • Updated packages

3.5.0

  • Updated packages

3.5.1

  • Fixed crash produced by "export * from"

3.6.0

  • Accepting React 17 as peerDependencies
  • Fixed security warnings

3.7.0

  • Updated the packages

4.0.0

  • Supports minimum React 18
4.1.0

2 years ago

4.1.1

2 years ago

4.0.0

3 years ago

3.7.0

4 years ago

3.5.1

5 years ago

3.5.0

5 years ago

3.4.0

5 years ago

3.3.0

5 years ago

3.2.0

5 years ago

3.1.0

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago