Skip to main content

Canvas

Function Canvas 

Source
pub fn Canvas(_: CanvasProps) -> Element
Expand description

Pixels the widget vocabulary cannot produce: charts, sparklines, signature pads, rings.

The list is a value, not a callback, because drawing code cannot cross the boundary into an ahead-of-time compiled Renderer. Two equal lists are one attribute comparison, so a frame that redraws the same chart sends nothing. Size comes from the Modifier chain, and coordinates are dp from the widget’s top-left corner.

Colour goes through Paint, so Paint::Role(ColorRole::Primary) draws in whatever the active design system calls primary.

§Props

For details, see the props struct definition.