@ajmaln/react-timeline-editor
TypeScript icon, indicating that this package has built-in type declarations

0.2.6 • Public • Published

React Timeline Editor

npm version npm downloads

React Timeline Editor is a react component used to quickly build a timeline animation editor.

example

Getting Started

npm install @ajmaln/react-timeline-editor
import { Timeline, TimelineEffect, TimelineRow } from '@ajmaln/react-timeline-editor';
import React from 'react';

const mockData: TimelineRow[] = [{
    id: "0",
    actions: [
      {
        id: "action00",
        start: 0,
        end: 2,
        effectId: "effect0",
      },
    ],
  },
  {
    id: "1",
    actions: [
      {
        id: "action10",
        start: 1.5,
        end: 5,
        effectId: "effect1",
      }
    ],
}]

const mockEffect: Record<string, TimelineEffect> = {
  effect0: {
    id: "effect0",
    name: "效果0",
  },
  effect1: {
    id: "effect1",
    name: "效果1",
  },
};

const TimelineEditor = () => {
  return (
      <Timeline
        editorData={mockData}
        effects={mockEffect}
      />
  );
};

Documention

Checkout the Docs for a demonstration of some basic and advanced features.

Package Sidebar

Install

npm i @ajmaln/react-timeline-editor

Weekly Downloads

7

Version

0.2.6

License

MIT

Unpacked Size

255 kB

Total Files

33

Last publish

Collaborators

  • ajmaln