API Reference
Complete reference for the @scumble/react component layer. Everything below is imported from one place — Path2D, PathOpName, and the image types are re-exports from the @scumble/graphics core:
tsx
import { Canvas, Rect, LinearGradient, vec, createAnimation } from "@scumble/react";New here? Start with Getting Started, then circle back for the details.
Containers
| Export | Description |
|---|---|
Canvas | The GPU drawing surface — the root node every scene renders into, with an optional logical viewPort. |
Group | Grouping node: cascading transforms, paint inheritance, and clipping for a subtree. |
Animation
| Export | Description |
|---|---|
createAnimation | Mint a declarative native animation track spec with an imperative playback controller attached. |
AnimationController | The imperative surface: pause / play / seekTo / cancel / onFinish / handle. |
ControlledAnimationSpec | The createAnimation() return type — a track spec plus its controller, usable directly as animate. |
Shapes
| Export | Description |
|---|---|
Circle | A circle from center + radius. |
Ellipse | An axis-aligned ellipse from center + two radii. |
Line | A straight line between two points — always stroked. |
Rect | An axis-aligned rectangle. |
RRect | A rectangle with corner radii. |
Polyline | An open polyline through vertices — stroked by default. |
Polygon | A closed polygon through vertices — filled by default. |
Points | A point set with Skia drawPoints semantics: dots, segments, or an open polyline. |
Path | An SVG d string or Path2D, with fill rule and path trim. |
Image | Draw a bitmap with fit and sampling control. |
Paragraph | Width-constrained rich text, laid out natively (CoreText / HarfBuzz, BiDi-aware). |
TextSpan | One styled run of text inside a <Paragraph>. |
Images
| Export | Description |
|---|---|
useImage | Resolve a source uri into a stable ImageHandle. |
createImageHandle | The non-hook handle factory — same uri, same reference. |
Shaders
Declarative children of a shape (or <Paint>): directly under a shape they fill it, inside <Paint style="stroke"> they stroke it.
| Export | Description |
|---|---|
LinearGradient | A linear gradient between two points. |
RadialGradient | A radial gradient from a center + radius. |
SweepGradient | An angular sweep around a center. |
TwoPointConicalGradient | A two-circle (focal) conical gradient. |
ImageShader | Fill or stroke a shape with a bitmap texture. |
Paint & Filters
| Export | Description |
|---|---|
Paint | Declarative override for a shape's fill or stroke paint. |
Blur | Image filter: blur the shape's rendered layer. |
DropShadow | Image filter: a blurred colored copy behind the shape. |
ColorMatrix | Color filter: a per-pixel 4×5 color matrix. |
ColorBlend | Color filter: blend a constant color onto the source. |
MaskBlur | Mask filter: feather the shape's alpha mask. |
Clipping
| Export | Description |
|---|---|
ClipRect | Clip a Group's subtree to a rectangle. |
ClipRRect | Clip a Group's subtree to a rounded rectangle. |
ClipPath | Clip a Group's subtree to an arbitrary path. |
Utilities
| Export | Description |
|---|---|
vec | Build an {x, y} point for shader/vertex props. |
Path2D | Command-style path builder, with lazy boolean compositions via Path2D.op(). |
PathOpName | The four boolean path-op names: "difference" | "intersect" | "union" | "xor". |
Fit | How a bitmap is inscribed into its destination rect (CSS object-fit family). |
TileMode | How an image shader tiles outside its fitted rect. |
ImageSamplingOptions | Texel sampling knobs for <Image> (filter / mipmap / cubic). |
ImageFilterMode, ImageMipmapMode, ImageCubicResampler | The sub-types of ImageSamplingOptions. |