Skip to content
This repository was archived by the owner on Aug 14, 2023. It is now read-only.

Latest commit

 

History

History
30 lines (22 loc) · 690 Bytes

File metadata and controls

30 lines (22 loc) · 690 Bytes

Slide

Demo

Slide in from the edge of the screen. The direction property controls which edge of the screen the transition starts from.

Example

import React from 'react';
import { Slide } from 'react-essential-tools';

export default function SimpleSlide() {
  const [checked, setChecked] = React.useState(false);

  const handleChange = (): void => {
    setChecked((prev) => !prev);
  };

  return (
    <>
      <button type="button" onClick={handleChange}>{checked ? 'out' : 'in'}</button>

      <Slide in={checked}>
        <div>Slide</div>
      </Slide>
    </>
  );
}