asafefe.dev
Lab

Lab/06

Bézier Easing Editor

Reshape the curve by dragging the two handles. The ball previews the exact motion, and the cubic-bezier is ready to copy.

  • Tool
  • Motion
Drag the red handles

Installation

Add Bezier Editor to your project with the shadcn CLI. The files land in components/lab, ready to edit.

$ pnpm dlx shadcn@latest add @soultel/lab-bezier-easing

Or by URL: https://asafefe.dev/r/lab-bezier-easing.json

Brings along

  • lucide-react
  • utils

Usage

example.tsx5 lines
import { BezierEditor } from "@/components/lab/bezier-easing"

export function Example() {
  return <BezierEditor onChange={(value) => console.log(value)} />
}

Props

PropTypeDefaultDescription
defaultValue[number, number, number, number][0.34, 1.56, 0.64, 1]Starting curve.
onChange(value: string, points) => void-Called with the cubic-bezier() string on every change.
presetsBezierPreset[]BEZIER_PRESETSQuick picks. [] hides them.
durationnumber1400Preview run length in ms.