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

@vitecut/timeline

v0.0.4

Published

[English](https://github.com/heyanpeng/ViteCutTimeline/blob/master/packages/timeline/README.md) | **简体中文**

Readme

English | 简体中文

一个面向 Web 视频编辑器场景的 React 时间轴组件,采用 Canvas + DOM 混合渲染,支持拖拽、裁剪、分割、吸附、缩放与虚拟化渲染。

截图预览

特性

  • Canvas + DOM 混合渲染,兼顾交互精度与复杂时间轴性能
  • 完全受控的编辑模型:editorData / currentTime / playing / zoom 由外部驱动
  • 通过 ref 暴露命令式 API(setTimesetScrollLeftsetScrollTopsetPlayRatereRender
  • 完整事件回调:移动、裁剪、光标拖拽、点击、双击与选中流程可外部接管
  • 轨道/片段拖拽,支持跨轨道移动、吸附与可选“拖拽插入新轨道”
  • 左右裁剪(Trim),支持吸附到片段边缘与时间刻度
  • 可定制轨道系统:轨道面板头部、轨道控制区、轨道高度预设、classNames 注入
  • 支持自定义片段渲染与拖拽预览渲染(getActionRendergetActionDragRender
  • 支持动态时间轴时长策略(内容末尾 + 尾部留白)
  • 支持平滑缩放交互(按钮、滑杆、Ctrl/Cmd + 滚轮)与一键 Fit
  • 大数据量、多轨道场景下的可见区域虚拟化渲染

安装

npm install @vitecut/timeline

快速开始

import { useMemo, useState } from "react";
import { Timeline, type TimelineRow } from "@vitecut/timeline";
import "@vitecut/timeline/style.css";

const initialRows: TimelineRow[] = [
  {
    id: "main-video",
    actions: [
      {
        id: "clip-1",
        effectId: "video",
        start: 0,
        end: 12
      },
    ],
  },
];

export default function Example() {
  const [editorData, setEditorData] = useState<TimelineRow[]>(initialRows);
  const [playing, setPlaying] = useState(false);
  const [time, setTime] = useState(0);
  const [zoom, setZoom] = useState(1);
  const duration = useMemo(() => {
    const end = editorData
      .flatMap((row) => row.actions)
      .reduce((max, action) => Math.max(max, action.end), 0);
    return Math.max(30, end + 3);
  }, [editorData]);

  return (
    <Timeline
      editorData={editorData}
      duration={duration}
      playing={playing}
      currentTime={time}
      zoom={zoom}
      onZoomChange={setZoom}
      onEditorDataChange={setEditorData}
      onCursorDrag={setTime}
      onCursorDragEnd={setTime}
      onClickTimeArea={(nextTime) => {
        setPlaying(false);
        setTime(nextTime);
        return true;
      }}
      dragSnapToClipEdges
      trimSnapToClipEdges
      trimSnapToTimelineTicks
    />
  );
}

本地开发

npm install
npm run dev

贡献

欢迎提交 Issue 和 PR。

许可证

计划采用 MIT。
如果你计划公开分发,建议在仓库根目录添加 LICENSE 文件。