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

reactbox

v0.5.4

Published

Powerful React.js-based lightbox

Downloads

103

Readme

Reactbox - React.js lightbox

Every ecosystem needs its own lightbox, right? So does React.js.

Main features:

  • Nice minimal UI.
  • Based on React.js and Flux idioms.
  • Can be used in a non-react environment.
  • Lots of item types.
  • 3 item layout supported (see demo).
  • No dependencies.
  • Clean API - provides a simple one-function API, plus a React component.
  • Responsive and mobile friendly.
  • Supports swiping.
  • Sharing features.
  • Deeplinking support.
  • Supports carousel mode.

Supported item types

  • Images.
  • Youtube or Vimeo videos.
  • Iframe content.
  • AJAX content.
  • HTML content.

All these item types come with a number of lightbox layout options.

Installation

You can install Reactbox from npm with one command:

npm install --save reactbox

or

yarn add reactbox

Usage

import reactbox from 'reactbox'

reactbox(items)

This will open Reactbox in your application, passing it items as an option.

Options available

carousel

Default: true

If the thumbnail carousel below the mainbox will be displayed. Carousel is only displayed on if the screen is 768+ px wide.

Example:

reactbox({
  items: [...],
  carousel: false
})

share

Defines the list of the sharing services displayed.

Default:

{
  facebook: {
    url: "//www.facebook.com/share.php?v=4&src=bm&u=%url%",
    name: 'Facebook'
  },
  twitter: {
    url: "//twitter.com/home?status=%url%"
    name: 'Twitter'
  },
  googleplus: {
    url: "//plus.google.com/share?url=%url%",
    name: 'Google Plus'
  },
  reddit: {
    url: "//reddit.com/submit?url=%url%",
    name: 'Reddit'
  },
  digg: {
    url: "//digg.com/submit?phase=2&url=%url%",
    name: 'Digg'
  }
  stumbleupon: {
    url: "http://www.stumbleupon.com/submit?url=%url%&title=%title%",
    name: "Stumbleupon"
  }
  delicious: {
    url: "//delicious.com/post?url=%url%",
    name: 'Delicious'
  }
  pinterest: {
    url: "https://www.pinterest.com/pin/create/button/?url=%url%&media=%image_url%&description=%description%&title=%title%",
    name: 'Pinterest'
  }
  vk: {
    url: "http://vk.com/share.php?url=%url%",
    name: 'VK'
  }

Example:

// Will only show Facebook for sharing
reactbox({
  items: [...],
  share: {
    facebook: {
      url: "//www.facebook.com/share.php?v=4&src=bm&u=%url%",
      name: 'Facebook'
    }
  }
})

theme

Color theme used. Valid values are null, "black" or "white".

Default: "black"

items

An array of the items you want to show in a lightbox. See below for the docs on the item description format.

Default: null

Example:

reactbox({
  items: [{url: 'http:/example.com/img/image.jpg'}]
})

Item properties:

url

default: null

The URL of the object (image, video, ajax request, iframe).

type

default: image

The type of the item. Valid types are:

  • image
  • video
  • ajax
  • html
  • iframe
thumbnail

default: null

Thumbnail URL for the carousel. When no thumbnail is provided - the item does not show in a carousel (but is still shown in a lightbox).

description

default: null

Item description object:

{
  style: 'none', // one of the 'none', 'mini', 'right', 'bottom'
  title: 'some title', // description title
  text: 'Some text' // description text
}
download

default: null

Item download URL. Enables the download link at the top of the lightbox window.

alt

default: null

Item alt description to be added as alt tag to the thumbnails and main lightbox image.