Keep part of a clip with an ink range over a filmstrip.
FreeWeb and MobileMotion
Preview
npx shadcn add @fetaui/clip-trimmerPlayground
0:02.4
6.6s of 12.0s
Default, drag a handle, press Play or Export
0:02.4
6.6s of 12.0s
Full length
0:00.0
12.0s of 12.0s
Icons animation
Motion
Installation
Terminal· bash
npx shadcn add @fetaui/clip-trimmer
Accessibility
- Handles are sliders with readable times.
- Time is always shown as text.
Motion
- The edge follows the pointer and snaps to whole seconds within 5 px.
- Play loops inside the range. Export fills the range.
- The active handle widens from 14 to 16.
- With reduced motion, playback runs once.
Responsive behavior
- 480 px on Web, 358 px on Mobile, with the same 52 px handles.
Performance
- Playback runs on requestAnimationFrame only while playing.
- Drag listeners attach to the handle on press and are removed on release.
Note for AI
Give your coding assistant the Markdown reference instead of screenshots.
- Import ClipTrimmer. Props: src, alt, duration, defaultStart, defaultEnd, onChange, onExport, animated.
- src is a still of the clip and the filmstrip slices it. There is no video element.
- onExport(range, report) renders and reports 0 to 1. A rejection shows Export failed. Without it progress is simulated, as in the demo.
- Handles snap to whole seconds and keep a clip of at least 1 s.
Related
SliderComponentPick a value or a range by dragging. Line for forms, Bold for a headline value, Field for dense inspectors, all with one or two thumbs.ProgressComponentShows how far a task has come, with states for done, paused, failed and unknown length, plus nine recipes.Focal Point PickerComponentSets the point every crop keeps.Photo StraightenComponentLevels a tilted horizon with a degree ruler.