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-video-trimmer-rail

v1.0.1

Published

React UI for selecting video trim start/end times on a thumbnail rail (does not export or render trimmed video output)

Readme

react-video-trimmer-rail

A React component for selecting a video time range (start and end in seconds) on a draggable thumbnail rail.

Important

This package does not render or export a trimmed video file.

It only returns startSec and endSec via onConfirm. Actual trimming (e.g. with FFmpeg, MediaRecorder, or a backend service) must be implemented in your application.

The video preview and thumbnail generation exist only for range-selection UX.


Install

npm install react-video-trimmer-rail

Peer dependencies:

  • react >= 17
  • react-dom >= 17

Styles (after publish):

import 'react-video-trimmer-rail/style.css'

Quick start

import VideoTrimmer from 'react-video-trimmer-rail'
import 'react-video-trimmer-rail/style.css'

function App() {
  const [open, setOpen] = useState(true)

  if (!open) return null

  return (
    <VideoTrimmer
      videoUrl={URL.createObjectURL(file)}
      maxDurationSec={30}
      onConfirm={(startSec, endSec) => {
        console.log('trim range:', startSec, endSec)
        setOpen(false)
        // Trim the video here with FFmpeg or your own API
      }}
      onCancel={() => setOpen(false)}
      labels={{
        back: 'Back',
        confirm: 'Confirm',
        trimStart: 'Start',
        trimEnd: 'End',
      }}
    />
  )
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | videoUrl | string | required | Video source (blob URL, public URL, etc.) | | maxDurationSec | number | 30 | Maximum selectable clip length (seconds) | | minClipSec | number | 1 | Minimum clip length (seconds) | | thumbCount | number | 10 | Number of frames on the thumbnail rail | | labels | object | English | Button and aria text — keys: back, confirm, trimStart, trimEnd | | showPreview | boolean | true | Full-screen preview; if false, video stays hidden (thumbnails only) | | className | string | '' | Extra class on the root element | | style | object | — | Inline styles on the root element | | onConfirm | (startSec, endSec) => void | — | Called when the range is confirmed | | onCancel | () => void | — | Called when the user cancels | | renderHeader | function | — | Custom header; receives { labels, thumbsLoading, duration, startTrim, endTrim, onConfirm, onCancel } |

labels (optional)

{
  back?: string
  confirm?: string
  trimStart?: string
  trimEnd?: string
}

Helper export

import { bindVideoTrimLoop } from 'react-video-trimmer-rail'

// Loop playback between start and end on a <video> element
const unbind = bindVideoTrimLoop(videoElement, startSec, endSec)
unbind() // cleanup

Styling

CSS variables on the root:

.video-trimmer-rail {
  --vtr-selection-color: #ffd60a;
  --vtr-handle-color: #ffd60a;
}

Or use renderHeader for custom buttons (e.g. Material UI, icons).

License

MIT