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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-youtube-playlist-grid

v1.0.8

Published

A React component for displaying YouTube playlists in a grid with load more functionality.

Readme

React YouTube Playlist Grid

A modern, responsive React component for displaying YouTube playlists in a grid layout with "Load More" functionality.

License Version

Features

  • 📱 Responsive Grid: Automatically adjusts columns based on screen size.
  • 🎨 Modern Design: Built with Tailwind CSS classes (requires Tailwind in your project) or standard CSS.
  • Performance: Lazy loading support and optimized rendering.
  • 🔄 Load More: Built-in support for fetching more videos from a playlist.
  • 🎨 Theming: Easily customize colors (brand, buttons, play icons, titles) via simple hex codes.
  • Automatic Metadata: Fetches playlist title and description automatically if not provided.
  • 🛠 Flexible: Works with a direct YouTube API Key or a custom backend proxy.

Installation

npm install react-youtube-playlist-grid

Usage

1. Basic Usage (Client-Side)

If you have a public YouTube Data API Key, you can use it directly.

Import the styles:

import 'react-youtube-playlist-grid/dist/index.css';
import { PlaylistsExplorer } from 'react-youtube-playlist-grid';

// Define your initial playlist data
const myPlaylists = [
  {
    id: 'PL2Q8rFbm-4rtedayHej9mwufaLTfvu_Az',
    // title and description can be left empty; the component will fetch them
    config: { gridColumns: 4 }
  }
];

function App() {
  return (
    <div className="p-4">
      <PlaylistsExplorer
        playlists={myPlaylists}
        apiKey="YOUR_YOUTUBE_API_KEY"
        theme={{
            brandColor: '#7c3aed',
            buttonColor: '#1e293b',
            playlistTitleColor: '#000000'
        }}
      />
    </div>
  );
}

2. Custom Theming

You can customize the look and feel using the theme prop:

<PlaylistsExplorer
  playlists={myPlaylists}
  apiKey="..."
  theme={{
    brandColor: '#ff0000',        // Tabs active color
    brandHoverColor: '#cc0000',   // Tabs hover color
    buttonColor: '#000000',       // Load More button background
    buttonTextColor: '#ffffff',   // Load More button text
    playIconColor: '#ff0000',     // Thumbnail play icon color
    playlistTitleColor: '#1e293b' // Active playlist title color
  }}
/>

3. Advanced Usage (Custom Backend)

If you want to hide your API key or use a proxy, provide an onLoadMore callback instead of apiKey.

import { PlaylistsExplorer } from 'react-youtube-playlist-grid';

function App() {
  const handleLoadMore = async (playlistId, pageToken) => {
    // Call your own backend API
    const response = await fetch(`/api/videos?id=${playlistId}&token=${pageToken}`);
    const data = await response.json();
    return {
      videos: data.videos,
      nextPageToken: data.nextPageToken
    };
  };

  return (
    <PlaylistsExplorer
      playlists={myPlaylists}
      onLoadMore={handleLoadMore}
    />
  );
}

Props

| Prop | Type | Description | |------|------|-------------| | playlists | Playlist[] | Required. Array of playlist objects. | | apiKey | string | Optional. Your YouTube Data API Key for client-side fetching. | | onLoadMore | function | Optional. Custom async function to fetch more videos. | | theme | ThemeConfig | Optional. Customize the colors of the component. |

Styling

The component comes with bundled CSS. You must import the CSS file for it to look correct.

import 'react-youtube-playlist-grid/dist/index.css';

License

MIT