Scrollstable
Tether
Scroll-drawn path
An SVG path that draws itself as its section scrolls: timelines, connectors and routes.
- 01Sketch
- 02Prototype
- 03Review
- 04Ship
Customize
Patha non-scaling stroke, measured on screen
variantfit2.00 px
strokeWidthScroll windowfractions of the viewport height
0.90
start0.50
endUsage
import { Tether } from "zerogravity/tether"
<Tether
d="M 50 0 C 80 60, 20 90, 50 150"
viewBox="0 0 100 150"
/>Generated from the controls above. Only props that differ from their defaults are shown.
Props
| Property | Type | Default | Description |
|---|---|---|---|
variant | "pixel" | "classic" | "minimal" | "pixel" | Style. |
fit | "contain" | "stretch" | "contain" | Fit. |
strokeWidth | number | 2 | Stroke. Range 1 to 10 px. |
start | number | 0.9 | Starts at. Range 0.2 to 1.2. |
end | number | 0.5 | Ends at. Range -0.2 to 0.9. |
linecap | "round" | "butt" | "square" | "square" in pixel, "round" in classic | End caps of the drawn line. |
d | string | — | SVG path data in viewBox units. |
viewBox | string | "0 0 100 100" | Coordinate box of the path. |
progress | number | — | 0 to 1. Drives the path directly and turns scrolling off. |
stroke | string | "currentColor" | Colour of the drawn line. |
track | string | false | faint grey | The full-length path underneath. |
trackDash | string | — | Dash pattern of the track. |
scrollContainer | RefObject<HTMLElement> | the window | Scroll inside an element instead of the page. |
onProgress | (progress: number) => void | — | Called when the drawn amount changes. |
children | ReactNode | — | Laid over the path: steps, labels, markers. |
Dependencies
0 external runtime dependencies
Ships with nothing but React.