Customizable script for displaying images or inline content.
N.B. This is a beta version!
- Install package by command
npm install nice-popup
oryarn add nice-popup
- Import styles to your .css
@import '~nice-popup/dist/app.css';
.
import {NicePopup} from 'nice-popup';
new NicePopup({
showArrows: true,
mouseAdditionalButtons: true,
keyboard: true
});
Just add data-nice="gallery" attribute to your links.
<a data-nice="gallery" href="pic1.jpg">
<img src="pic1.jpg">
</a>
<a data-nice="gallery" href="pic2.jpg">
<img src="pic2.jpg">
</a>
Add data-nice="inline" to your link and set href attribute.
<a data-nice="inline" href="#hiddenContent">Open inline content</a>
<div id="hiddenContent" style="display: none;">Hidden text</div>
Props | Type | Default | Description |
---|---|---|---|
overlayColor | String | '#0f0f11' | Set overlay color |
showArrows | Boolean | true | Show right and left arrow |
arrowsPosition | String | 'top' | Set arrows position: top or side |
keyboard | Boolean | true | Allow to control by keyboard arrow keys and escape |
mouseAdditionalButtons | Boolean | true | Allow to control by mouse additional buttons |
draggable | Boolean | true | Allow to control by dragging |