1.0.2 • Published 11 months ago

react-media-modal-viewer v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

React Media Modal Viewer

A simple and customizable media modal viewer for React applications that supports images, videos, and other file types. Easily display your media in a beautiful, interactive modal viewer with just a few lines of code.

Demo Gif

Installation

Install the package via npm or yarn:

# Using npm
npm install react-media-modal-viewer

# Using yarn
yarn add react-media-modal-viewer

Sample Code

import React from "react";
import MediaModalViewer from "react-media-modal-viewer";
import Dummy1 from "./assets/images/Dummy1.jpg";
import Dummy2 from "./assets/images/Dummy2.jpg";
import Dummy3 from "./assets/images/Dummy3.jpg";

function App() {
  const media = [
    { image: Dummy1 },
    { image: Dummy3 },
    { image: Dummy2 },
    { image: Dummy1 },
    { image: Dummy2 },
  ];

  return (
    <MediaModalViewer
      featuredMedia={media}
      mediaContainerStyles={{
        width: "30%",
        height: "100%",
      }}
    />
  );
}

export default App;

Options

Propertytyperequired?Description
featuredMedia{ image: string; }[]YesAn array of media objects containing the image URL or path to be displayed.
mediaContainerStylesBoxPropsNoCSS styles to be applied to the media container. Customize the size, positioning, and appearance of your media.
fileType"image" or "video" or "application"NoSpecifies the type of media being displayed.

Contributing

Feel free to open issues or pull requests if you have any improvements or suggestions.

License

MIT

Authors