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

@labsix/react-hooks-vimeo

v0.0.8

Published

React Vimeo player component and hook.

Readme

@labsix/react-hooks-vimeo

Summary

About

This is my very first open source project. Recently, while working on a project, I found a need for a React Hook implementation for Vimeo's player. I was inspired by the u-wave/react-vimeo library and decided to create a similar one, but with the usage of React hooks, providing a flexible component and a hook for using the Vimeo player.

This project aims to make it simple for developers to include Vimeo's player in their React applications with a modern, hook-based approach.

Features

The library provides:

  • A React hook useVimeoPlayer that allows for easy integration with Vimeo's player API.
  • A reusable VimeoPlayer component that simplifies adding Vimeo players to your React app.

Installation

npm i @labsix/react-hooks-vimeo

If using react v18.0 please add --legacy-peer-deps

Usage

React Component

import VimeoPlayer from '@labsix/react-hooks-vimeo'

const YourComponent = () => <VimeoPlayer video='YOUR_VIMEO_VIDEO_ID_OR_URL' />

export default YourComponent

Hook

In order to use the useVimeoPlayer hook, you first need to import it from the library. Then, create a reference to the DOM element where you want to insert the Vimeo player, and finally, call the hook with the appropriate parameters.

Here's an example of how you can use the useVimeoPlayer hook:

import { useRef } from 'react'
import { useVimeoPlayer } from '@labsix/react-hooks-vimeo'

const YourComponent = () => {
  const vimeoPlayerRef = useRef(null)

  useVimeoPlayer('YOUR_VIMEO_VIDEO_ID_OR_URL', vimeoPlayerRef, {
    embedOptions: {
      muted: true,
      autoplay: true,
      // ...embed options
    },
    events: {
      onPlay: () => {
        /* ...events */
      },
    },
  })

  return <div ref={vimeoPlayerRef} />
}

export default YourComponent

In this example, replace 'YOUR_VIMEO_VIDEO_ID_OR_URL' with the actual Vimeo video ID or URL you wish to embed. Also, provide any configuration options and event handlers you need in the embedOptions and events objects, respectively.

The useVimeoPlayer hook initializes a Vimeo Player instance and embeds it into the DOM element that you specify via vimeoPlayerRef. It also sets up the event handlers and configuration options you pass in.

This hook will return an instance of the Vimeo Player, which you can use to programmatically control the video playback. However, in most cases, you do not need to handle this instance directly, as the hook takes care of embedding the player and setting up event handlers for you.

Props

Embed options

Below is the updated documentation for the props that the Vimeo Player hook accepts:

| Name | Type | Default | Description | | :----------- | :------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------------- | | video | number, string | | Vimeo video ID or URL to be played. | | paused | bool | null | If true, the video is paused. | | volume | number | null | The playback volume as a number between 0 and 1. | | start | number | null | The time (in seconds) at which the video should start playing. | | playbackRate | number | null | The playback rate of the video. | | autopause | bool | true | If true, the video will pause automatically when another video starts playing. | | autoplay | bool | false | If true, the video will start playing automatically. Note: This may not work on some devices. | | showByline | bool | true | If true, the video's byline will be displayed. | | controls | bool | true | If false, all elements in the player, such as the progress bar and sharing buttons, will be hidden. (Requires a Vimeo PRO / Business account). | | loop | bool | false | If true, the video will play again from the start once it reaches the end. | | showPortrait | bool | true | If true, the video's portrait will be displayed. | | showTitle | bool | true | If true, the video's title will be displayed. | | muted | bool | false | If true, the video will start in a muted state. | | background | bool | false | If true, the video will start in a background state with no controls. | | responsive | bool | false | If true, the player will resize according to its parent element (experimental feature). | | dnt | bool | false | If true, the player won't track any session data, including all cookies and analytics. | | speed | bool | false | If true, the playback rate controls will be enabled. (Requires a Vimeo PRO / Business account). | | keyboard | bool | true | If true, keyboard inputs will trigger player events. | | pip | bool | false | If true, the picture-in-picture button will be displayed in the control bar and the picture-in-picture API will be enabled. | | playsInline | bool | true | If true, the video will play inline on mobile devices. Set to false to go fullscreen on playback. | | transparent | bool | true | If false, the responsive player and transparent background will be disabled. | | quality | string | | Vimeo Plus, PRO, and Business members can default an embedded video to a specific quality on desktop. | | textTrack | string | | The default language for captions/subtitles. |

Event Props

Here is the documentation for the event props that the Vimeo Player hook supports:

| Name | Type | Description | | :---------------------- | :------- | :-------------------------------------------------------------------------- | | onPlay | Function | A callback that fires when the video starts to play. | | onPlaying | Function | A callback that fires continuously as the video is playing. | | onPause | Function | A callback that fires when the video is paused. | | onEnd | Function | A callback that fires when the video has ended. | | onTimeUpdate | Function | A callback that fires when the current playback position has changed. | | onProgress | Function | A callback that fires when the player is fetching the video. | | onSeeked | Function | A callback that fires when a seek operation has completed. | | onTextTrackChange | Function | A callback that fires when the text track (captions/subtitles) has changed. | | onCueChange | Function | A callback that fires when the currently-displayed cue changes. | | onCuePoint | Function | A callback that fires when the video playback reaches a cue point. | | onVolumeChange | Function | A callback that fires when the volume level has changed. | | onPlaybackRateChange | Function | A callback that fires when the playback rate has changed. | | onError | Function | A callback that fires when an error occurs. | | onLoaded | Function | A callback that fires when the video has loaded and is ready to play. | | onPlaybackTimeReporting | Function | A callback that fires per second to represent that the video is playing. |

Please note that each of these event handlers should be a function that takes an event object as its only parameter. The properties of the event object will depend on the specific event being handled.

License

This project is licensed under the terms of the MIT license.

Contributions

Contributions are more than welcome as this is an open-source project. Feel free to open issues, fork the project, submit pull requests, and get involved!

Stay tuned!

Thank you for checking out this project. There's a lot more to come, and I'm excited to share more about this project as it progresses.

Stay tuned for more updates! I hope this library will prove to be a valuable tool for you and your projects. Thank you for your interest in this project.