npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@herii/react-gallery

v1.1.8

Published

A simple react component to add a gallery to your project.

Downloads

2

Readme

@herii/react-gallery

preview

A Component to add a Gallery to your React Projet

This is a very simple but powerful react component that allows you to add a gallery with different cool features.

💫 DEMO 🚀 💫

You can see a demo here on codesandbox.io

🚀 Features

  • Add blur to a specific image of the gallery
  • Add a parallax effect
  • Add Content to the gallery (On top of an image of your gallery)
  • You get two arrows to control the selected image.
  • The images are preloaded for a fast and smooth transition between each image in the gallery

💽 Installation

You can use npm or yarn to add our package to your project.

yarn add @herii/react-gallery

npm install @herii/react-gallery

And of course Dillinger itself is open source with a [public repository][dill] on GitHub.

💻 How to use

Import Gallery from our

import {Gallery} from '@herii/react-gallery'

Now you are ready to use our component inside your app:

<Gallery items={[{
                img: "https://cdn.pixabay.com/photo/2022/05/31/17/14/bird-7233900_1280.jpg",
                blur: true,
                children: <div className='flex-center'>
                    <div>
                    <h1>Birds are cool</h1>
                    <p style={{color: 'white'}}>So as this gallery component is</p>
                    </div>
                </div>
            }, 
            {
                img: "https://cdn.pixabay.com/photo/2016/11/23/18/27/hummingbird-1854225_1280.jpg",
                parallax: true,
            }]
        } type="default" />

Properties

The Component's properties are listed below.

type (string)

The type of transition effect that the gallery will run when moving from an image to another.

|value | description| |---|---| |default| The default transition moves the gallery from left to right /right to left| |fade-blur| fade in / fade out with a blurry effect|

width

The width of the container of the images (The images use 100% of the width of the container)

|type | default| |---|---| |string|'100vw'|

height

The height of the container of the images (The images use 100% of the height of the container)

|type | default| |---|---| |string|'100vh'|

disableControls

Don't like the arrows? You can hide them by setting this option to true.

|type | default| |---|---| |boolean|false|

loop

If you set this option to true then the gallery will move its items automatically.

|type | default| |---|---| |boolean|false|

interval

The interval at which the gallery will move its items (In milliseconds)

|type | default| |---|---| |int|5000|

Items

The only parameter you can pass right now is the items which is an array of objects

[
    {
        // Object #1
    },
    {
        // Object #2...
    }
]

Each Object can have the following properties:

| Property | Type(s) | Example | Default | Description | |---|---|---|---|---| | img | string | https://cdn.pixabay.com/photo/2022/05/31/17/14/bird-7233900_1280.jpg | null | The IMG URL or any object that can be passed to URL() in a background image: background-image: url(img) | | blur | boolean | true | false | Add a blur on top of the image | | parallax | boolean | true | false | Add a parallax effect to the image when scrolling the container | | children | JSX | <>This is a React Fragment</> | null | JSX that will be added on top of the image, by default you don't have styles here but you can add your own styles to the JSX elements to center the elements|

Example of an object with all properties

{
    img: "https://cdn.pixabay.com/photo/2022/05/31/17/14/bird-7233900_1280.jpg",
    blur: true,
    parallax: true,
    children: <>Hello</>
}

Support

I created this project it to use it in my own projects as a reusable component and I support it and update it as much as I require to.

If you find any issue/glitch/bug you can create an issue by clicking here and I'll review it and fix it as soon as possible.

If you want to support further development of this package / new features / etc, You can do it by donating me whathever amount you desire.