1.1.0 • Published 3 years ago

react-portal-overlay v1.1.0

Weekly downloads
401
License
MIT
Repository
github
Last release
3 years ago

React Portal Overlay

NPM License

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

Installation

npm i react-portal-overlay

Usage

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

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

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

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