1.1.1 • Published 6 months ago

@peacechen/react-portal-overlay v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

React Portal Overlay

NPM License

This is a fork of https://madeleineostoja.github.io/react-portal-overlay and published as a separate package on npmjs.com to unlock the peer dependencies.

A lightweight and performant fullscreen overlay component using React portals to render anywhere you need them to

Installation

npm i @peacechen/react-portal-overlay

Usage

See the API Docs for a full overview of props and options.

import React, { useState } from 'react';
import { Overlay } from '@peacechen/react-portal-overlay';

export default () => {
  const [open, setOpen] = useState(false);

  return (
    <Overlay open={open} onClose={() => setOpen(false)}>
      <h1>My overlay</h1>
    </Overlay>
  );
};