Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 709 Bytes

README.md

File metadata and controls

23 lines (15 loc) · 709 Bytes

react-draggable-splitscreen

A React component for displaying overlapping elements with a draggable splitscreen-like effect. See examples here.

Install

npm install react-draggable-splitscreen

Usage

The component takes two props, leftSide and rightSide, both of which must be rendered React elements/components.

import * as React from 'react';
import Splitscreen from 'react-draggable-splitscreen';

const MyLeftSide = () => <img src="some/image" />;
const MyRightSide = () => <img src="some/other/image" />;

const MyElement = () => <Splitscreen leftSide={<MyLeftSide />} rightSide={<MyRightSide />} />