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-ambilight

v1.1.0

Published

🌈 A lightweight React component for creating an Ambilight effect with YouTube videos.

Readme

🌈 Video Ambilight

A lightweight React component to create a stunning Ambilight effect for YouTube videos. This package is inspired by the visual effects seen in modern video presentations, adding an immersive ambient glow that synchronizes with your content.

✨ Features

  • Works seamlessly with YouTube videos using the YouTube IFrame API.
  • Supports synchronized playback between the video and the Ambilight effect.
  • Customizable and easy to integrate into any React project.

πŸ“¦ Installation

Install the package via npm:

npm install react-ambilight

or using Yarn:

yarn add react-ambilight

πŸ”§ Usage

Here's a quick example of how to use the component:

import React from 'react'
import { VideoAmbilight } from 'react-ambilight'
import 'react-ambilight/dist/style.css'

export default function App() {
  return (
    <div style={{ maxWidth: '800px', margin: '0 auto' }}>
      <VideoAmbilight videoId='dQw4w9WgXcQ' />
    </div>
  )
}

Customize the component by passing a className or classNames object with custom class names:

// tailwind example
import React from 'react'
import { VideoAmbilight } from 'react-ambilight'
import 'react-ambilight/dist/style.css'

export default function App() {
  return (
    <div className='max-w-4xl mx-auto'>
      <VideoAmbilight
        videoId='dQw4w9WgXcQ'
        classNames={{
          videoWrapper: 'relative',
          ambilightWrapper: 'absolute inset-0',
          aspectRatio: 'aspect-w-16 aspect-h-9',
          ambilight: 'bg-black opacity-50',
          ambilightVideo: 'hidden',
        }}
      />
    </div>
  )
}

Props

| Prop | Type | Description | Required | | ------------ | -------- | --------------------------------------- | -------- | | videoId | string | The YouTube video ID to display. | Yes | | className | string | Optional class name for styling. | No | | classNames | object | Optional object for custom class names. | No |

classNames Object

The classNames object can have the following properties:

| Property | Type | Description | | ------------------ | -------- | ---------------------------------------------- | | videoWrapper | string | Class name for the video wrapper. | | ambilightWrapper | string | Class name for the ambilight wrapper. | | aspectRatio | string | Class name for the aspect ratio container. | | ambilight | string | Class name for the ambilight effect container. | | ambilightVideo | string | Class name for the ambilight video container. |

πŸš€ Demo

Check out a live demo of the Ambilight effect: Live Demo

πŸ›  How It Works

The component leverages the YouTube IFrame API to create two synchronized players:

  1. Primary Player: Displays the video.
  2. Ambilight Player: Runs a low-quality version of the same video in the background to generate the glowing effect.

🧩 Contributing

Contributions are welcome! If you encounter any issues or have suggestions, feel free to open an issue or submit a pull request.

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature-name.
  3. Commit your changes: git commit -m 'Add feature-name'.
  4. Push to the branch: git push origin feature-name.
  5. Open a pull request.

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.

πŸ™Œ Acknowledgements

Inspired by the Ambilight effect seen during the Next.js Conf presentations.


πŸ’» Made with ❀️ by Bruno Silva