2.0.7 • Published 3 years ago

@todys/react-slide-toggle v2.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

@todys/react-slideToggle

In react, display the matched elements in the sliding action.

Installation

npm i @todys/react-slide-toggle
or
yarn add @todys/react-slide-toggle

Usage

import { SlideToggle } from '@todys/react-slide-toggle'

const [toggleState, setToggleState] = useState(false);
const clickEvent = () => {
  setToggleState(prev => !prev)
}

ReactDOM.render(
  <div>
    <button type="button" onClick={clickEvent}>
      click!
    </button>
    <SlideToggle 
      state={toggleState} 
      duration={0.5}
    >
      {/* Add the elements that will be slid here. */}
    </SlideToggle>
  </div>
)

example code link https://github.com/whdudtod1273/react-slideToggle/blob/main/src/example/index.js

Props

paramsvaluedefaultValuedescription
stateBooleanfalseBoolean value that determines whether elements are represented within the slideToggle component
durationNumber0.5A number determining how long the animation will run.
2.0.3

3 years ago

2.0.2

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.1

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago