JSPM

  • Created
  • Published
  • Downloads 199499
  • Score
    100M100P100Q183828F
  • License MIT

Modern lightbox component for React

Package Exports

  • yet-another-react-lightbox
  • yet-another-react-lightbox/core
  • yet-another-react-lightbox/plugins
  • yet-another-react-lightbox/styles.css

Readme

Yet Another React Lightbox

Modern lightbox component for React.

Overview

NPM Version Bundle Size License MIT

Coming soon...

Documentation

Coming soon...

Installation

npm install yet-another-react-lightbox

or

yarn add yet-another-react-lightbox

Minimal Setup Example

import * as React from "react";
import { Lightbox } from "yet-another-react-lightbox";
import "yet-another-react-lightbox/styles.css";

const Page = () => {
    const [open, setOpen] = React.useState(false);

    return (
        <>
            <button type="button" onClick={() => setOpen(true)}>
                Open Lightbox
            </button>

            <Lightbox
                open={open}
                close={() => setOpen(false)}
                slides={[
                    { src: "/image1.jpg" }, 
                    { src: "/image2.jpg" }, 
                    { src: "/image3.jpg" },
                ]}
            />
        </>
    );
};

export default Page;

License

MIT © Igor Danchenko