The fast and simple lightbox package, support multiple type of file, with no dependency.
Github
npm install @duccanhole/lightbox
yarn add @duccanhole/lightbox
pnpm install @duccanhole/lightbox
Copy or download javascript file from index.js
and css
file from style/index.css
to your project
<head>
<link type="text/css" rel="stylesheet" href="/** link your css file here */" />
</head>
<body>
<script type="module">
import Lightbox from "/** link your js file here */"
const lightbox = new Lightbox()
lightbox.open({
type: 'image',
src: 'https://picsum.photos/800/800',
downloadUrl: 'https://picsum.photos/200/300'
})
</script>
</body>