react-video-icons

Video ui svg icons in React component


Keywords
react, video, svg, react-component
License
MIT
Install
npm install react-video-icons@0.0.2

Documentation

React components for video interface with SVG.

PlayPause component

import PlayPause from 'react-video-icons/play-pause';

export default class MyButton extends React.Component {


  constructor(props) {
    super(props);

    this.state = this.__getInitialState();
  }


  __getInitialState() {
    return { isPlay: false }
  }


  _handleClick() {
    // Click actions should here
    this.setState({ isPlay: !(this.state.isPlay) });
  }


  render() {
    return(
      <button
        type="button"
        onClick={ () => this._handleClick() }
      >
        <PlayPause play={ this.state.isPlay } />
      </button>
    );
  }


}

Props

PlayPause.propTypes = {
  play: PropTypes.bool.isRequired,  // Flag to toggle icon between play or pause
  initialMode: PropTypes.string,    // play or pause
  width: PropTypes.number,          // SVG elements width
  height: PropTypes.number,         // SVG elements height
  fill: PropTypes.string,           // icon fill color
  stroke: PropTypes.string,         // icon stroke width
  strokeOpacity: PropTypes.string,  // icon stroke opacity
  style: PropTypes.object           // css styles for SVG element
}

Features

  • PlayPause
  • Next
  • VolumeControll
  • config
  • Size
  • ToggleFullscreen