EasingCurve
A static visualisation of a cubic-bézier easing curve, drawn as an SVG bézier
inside a unit box — time runs left→right, progress runs bottom→top. The solid
stroke inherits currentColor (set the SVG's text colour via className);
the optional dotted diagonal is the linear baseline the curve bends away from.
Sizing is entirely className-driven, so the same primitive serves a tiny
preview and a full row. The DS home for easing SVGs — the app never draws raw
<svg>.
Usage
import { EasingCurve, EasingCurvePoints, EasingCurveProps } from "@desk/ui/components/easing-curve";Best practices
Render easing previews through
EasingCurve, never a hand-rolled<svg>— it's the design-system home for curve visualisations (consistent unit box, baseline, stroke).Colour the curve with a
text-*class (it strokescurrentColor) and size it purely viaclassName— the same primitive scales from a tiny preview to a full row.Always pass a meaningful
title— it becomes the SVG<title>, the curve's only accessible name.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| points | EasingCurvePoints | The easing's four cubic-bézier control coordinates, | |
| title | string | Accessible label for the curve, rendered as the SVG | |
| showReference | boolean | true | Draw the dotted diagonal (linear |
Also exports
- type
EasingCurvePoints - interface
EasingCurveProps