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

react-expandable-preview

v1.1.8

Published

"Google images inspired grid system with preview drop down"

Downloads

27

Readme

#React Expandable Preview

##Description

##Installation

To install react expandable preview simply type the following in your terminal:

npm install react-expandable-preview --save

##Usage Overview

<Expandable largeRowItemCount={4}>
  <Item
    previewComponent={
      <Preview title="The Cutest Cat Ever">
        <img src="https://placekitten.com/300/201" />
        <p>Place your custom Components inside the preview</p>
      </Preview>
    }
  >
    <img src="https://placekitten.com/300/201" />
  </Item>
  {... more <Item /> Components Here}
</Expandable>

##Components & Props

####1. Expandable:

  • Description: This component is the base component for the expandable preview. Wrap everything in this.
  • Props:
    • Custom Grid System:
      • react expandable preview contains a custom grid system to be as platform agnostic as possible. You can specify how many items you want per row based on the screen size by using the following props
        • smallRowItemCount:
          • Type: Number
          • Default: 1
          • Description: for screens less than or equal to 640px wide
        • mediumRowItemCount:
          • Type: Number
          • Default: 2
          • Description: for screens less than or equal to 1024px wide
        • largeRowItemCount
          • Type: Number
          • Default: 3
          • Description: for screens less than or equal to 1440px wide
        • xlargeRowItemCount
          • Type: Number
          • Default: 4
          • Description: for screens less than or equal to 1920px wide
        • xxlargeRowItemCount
          • Type: Number
          • Default: 5
          • Description: for screens greater than 1920px wide
    • Callbacks:
      • React Expandable Preview contains an event callback system that fires callbacks before, after or during* certain events. These callbacks can be accessed via props sent through the expandable component.
        • beforePreviewOpen(isOpen):
          • Type: function
          • Parameters:
            • isOpen:
              • Type: Boolean
              • Returns true if a preview is already open.
          • Description: This callback fires after a grid element is clicked but before the preview displays itself.
        • afterPreviewOpen:
          • Type: function
          • Parameters:
            • isOpen:
              • Type: Boolean
              • Returns true if a preview is already open.
          • Description: This callback fires after a preview has been displayed.
        • more callbacks coming soon...

####2. Item:

  • Description: This component is the individual item in the grid you want to display. Wrap your image or grid item in here.
  • Props:
    • previewComponent
      • Type: Component
      • Description: This prop accepts as a component which, in turn wraps the rest of your content to be displayed in a preview.

####3. Preview:

  • Description: This component is the preview item you want to display when clicking on its related item in the grid. Wrap this component around your preview data and pass it in as the previewComponent prop in the respective <Item /> component.
  • Props:
    • title:
      • Type: String
      • Description: Simple string title you want the preview to display when it expands.

####4. Todo / In Progress:

  • Animated open / close (90% complete)

  • Custom grid widths (75% complete)

  • Additional callback support. (30% complete)

  • Custom styling support. (30% complete)

  • Live Demo. (0% complete)