Skip to Content
Kokonut UI

MD-01Media

Clip Trimmer

A video trim timeline with a filmstrip, handles that snap to whole seconds and a playhead that loops the kept range.

Install with
lucide-react

PROAudio Player Card and more like it are in Kokonut UI Pro

Installation

Clip Trimmer is a free, open-source React component in the Kokonut UI Media collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/clip-trimmer.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/clip-trimmer

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/clip-trimmer.tsx.

npm install lucide-react

Usage

import ClipTrimmer from "@/components/kokonutui/clip-trimmer";

export default function Example() {
  return <ClipTrimmer />;
}

Props

src
stringDefault built-in

A wide image the demo pans across to stand in for footage. Swap the preview and filmstrip for your own video and frame grabs.

alt
stringDefault "A valley road at dusk"
duration
numberDefault 12

Clip length in seconds.

defaultRange
ClipRangeDefault { start: 2.4, end: 9 }
minLength
numberDefault 1

The shortest clip you can trim to, in seconds.

onRangeChange
(range: ClipRange) => void
className
string

Extra classes for the root element.

ClipRange

startrequired
number
endrequired
number

Dependencies

NeedsVersionComes from
lucide-react^0.556.0npm, installed by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.