@mocanvas/mocanvas · interface

TLUiSliderProps

interface TLUiSliderProps

The chrome's slider — opacity, and anything else an app puts in the style panel.

Two callbacks rather than one: onValueChange fires continuously while dragging, onHistoryMark once when the drag begins. The document mark has to be taken before the first change, or the whole drag lands in the undo stack as one entry per pixel.


Methods · 1

onValueChange(value: number): void

Properties · 8

className?: string
disabled?: boolean
label: string
onHistoryMark?(id: string): void

Called once per interaction, before the first onValueChange.

steps: number

Number of steps. The slider runs 0..steps.

style?: CSSProperties
title?: string
value: number | null

Current value, in steps. null when the selection disagrees.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.