Canvas
Canvas exposes the browser's drawing surface with a SwiftUI-style dedicated component wrapper.
Canvas exposes the browser's drawing surface with a SwiftUI-style dedicated component wrapper.
API
| Prop | Type | Required | Description |
|---|---|---|---|
draw | (context: globalThis.CanvasRenderingContext2D) => void | No | Drawing callback invoked with a 2d rendering context when available. |
Inherits additional props from Omit<IBaseElementComponent<'canvas'>, 'children'>.
Canvas exposes the browser's drawing surface with a SwiftUI-style dedicated component wrapper.
Status: adapted
SwiftUI Correspondence: Adapted from SwiftUI's Canvas.
Notes
- Rendering is delegated to the supplied
drawcallback. - The current implementation targets a 2D context.
Button
Button maps directly to SwiftUI's `Button` control: a label or icon triggers an action when activated. The React version keeps the same mental model while exposing standard HTML button behavior.
Card
Card is a container that presents content on a card. Card is a container with elevated styling, typically used to display related content.