1.0.9 • Published 4 years ago
@iyaroslav/play-pause-button v1.0.9
play-pause-button
YouTube like responsive play/pause button
Made with create-react-library
Install
yarn add @iyaroslav/play-pause-button
# or
npm install --save @iyaroslav/play-pause-button
Intro
Usage
import React, { Component } from 'react'
import PlayButton from '@iyaroslav/play-pause-button'
import '@iyaroslav/play-pause-button/dist/index.css'
class Example extends Component {
const buttonRef = useRef(null)
// buttonRef.play()
// buttonRef.pause()
// buttonRef.toggle()
// buttonRef.isPaused()
render() {
return <PlayButton
ref={buttonRef}
onPlay={() => {}}
onPause={() => {}}
onToggle={() => {}}
/>
}
}
License
MIT © iYaroslav