Interactive timeline editor built with React + TypeScript.
- Create and reorder flows (rows)
- Add, move, resize, edit, and delete events in each flow
- Prevent overlapping events inside the same flow
- Configure timeline max duration and zoom scale
- Export/import timeline JSON data
- Persist timeline state in
localStorage - Undo and redo changes
- Clear all flows and events at once
- React 19 + TypeScript
- Vite
- Tailwind CSS
- Zustand (
persistmiddleware), along withzundofor Undo/Redo tracking @dnd-kitfor drag and sort interactions
src/store/timelineStore.ts- global state/actions and persistencesrc/types/timeline.ts- core data types (Flow,TimelineEvent)src/components/- UI components (controls, timeline, rows, events)src/hooks/useDraggableEvent.ts- event drag/resize behaviorsrc/utils/- overlap and drag math helpers
All timeline positioning uses milliseconds:
startMs: event start time in msendMs: event end time in ms
interface TimelineEvent {
id: string;
flowId: string;
title: string;
startMs: number;
endMs: number;
color: string;
}- Node.js 18+
- npm
npm installnpm run devOpen the URL shown by Vite (typically http://localhost:5173).
npm run dev # start local dev server
npm run build # type-check and build production assets
npm run preview # preview production build locally
npm run lint # run ESLint- Add a flow.
- Add an event to a flow using
startMs/endMs. - Drag the event body to move it.
- Drag left/right event handles to resize.
- Use Export/Import to save/load timeline JSON.
State is stored under the key timeline-storage in browser localStorage.