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

@sayings/react-reels

v1.0.2

Published

Made with create-react-library

Downloads

94

Readme

@sayings/react-reels

A minimalistic Video Reels/Shorts (like Instagram Reels or Youtube Shorts) component for React (Compatiable for both Desktop and mobile screens)

NPM JavaScript Style Guide

Install

npm install --save @sayings/react-reels

Alt text

Alt text

Usage

import React from 'react'

import { Reels } from '@sayings/react-reels'
import '@sayings/react-reels/dist/index.css'

const App = () => {
  return (
    <Reels
      reels={reels}
      reelMetaInfo={reelMetaInfo}
      onMenuItemClicked={(event) => {
          console.log(event.value) 
          // other actions
      }}
      onLikeClicked={(reel) => {
          console.log(reel) // current Reel Data
          // other actions
      }}
      onDislikeClicked={(reel) => console.log(reel)}
      onCommentClicked={(reel) => console.log(reel)}
      onShareClicked={(reel) => console.log(reel)}
      onAvatarClicked={(reel) => console.log(reel)}
    />
  )
}

Props

| Name | Required | Default | Description | | -------------- | -------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | reels | yes | | Array of Objects Containing all the necessary information about each reel. | | reelMetaInfo | no | | Meta Details of the Reels Component such as Background colour, height, width etc. | | onMenuItemClicked | no | | Callback Function that is called when any of menu items is clicked (When Right Menu is used). | | onLikeClicked | no | | Callback Function that is called when like button is clicked (It automatically updates the count accordingly). | | onDislikeClicked | no | | Callback Function that is called when dislike button is clicked (It automatically updates the count accordingly). | | onCommentClicked | no | | Callback Function that is called when comment button is clicked. | | onShareClicked | no | |Callback Function that is called when share button is clicked. | | onAvatarClicked | no | | Callback Function that is called when Avatar is clicked.

Interfaces

  1. reels: Array of Objects of type ReelsType.
   type ReelsType = {
    id: number; // unique identifier
    reelInfo: {
        url: string; // Video url
        type: string; // Type of the video
        description?: string; // Description of the video
        postedBy?: {
            avatar: string; // Image Url of Avatar 
            name: string; // Name of the uploader
        };
        likes?: {
            count: number; // number of likes
        };
        dislikes?: {
            count: number; // number of dislikes
        };;
        comments?: {
            count: number; // number of comments
        };
        shares?: {
            count: number; // number of shares
        }; 
    }
    rightMenu?: { // Right Three dot menu
        options: Array<{ // each option
            id: number; // unique identifier
            label: string; // display label
            value: string; // actual value
        }>
    };
    bottomSection?: { // If Custom Component is used for Avatar, description etc instead of default
        component: JSX.Element; // Any HTML or JSX Element
    };
}
  1. reelMetaInfo: Its optional, just in case custom styling is required. Its an Object of type ReelMetaInfoType.
    type ReelMetaInfoType = {
        videoDimensions?: {
            height?: number; // height of the each reel container
            width?: number; // width of the each reel container
        },
        backGroundColor?: string; // background colour for desktop view
        borderRadius?: number; // border radius of each reel container
        likeActiveColor?: string; // like icon colour when clicked
        dislikeActiveColor?: string; // dislike icon color when clicked
    }

License

ISC © Trijit Goswami