createRectanglePath
import { Clip, createRectanglePath, Rectangle } from "@pibbl/core";RectanglePathOptions is accepted by createRectanglePath(options): Path2D, which creates a fresh
rectangle from numeric width, height, optional position, and optional numeric
corner radii. Width and height remain signed, matching Canvas rectangle
semantics. It owns no render state.
<Clip style={{ d: createRectanglePath({ x: 0, y: 0, width: 180, height: 100, cornerRadius: 12, }), }}> <Rectangle style={{ width: 180, height: 100, fill: "#2563eb" }} /></Clip>Try the Rectangle live example.
API details from source
Section titled “API details from source”
Creates a Canvas Path2D for rectangle geometry from validated options.
createRectanglePath: (options: Readonly<RectanglePathOptions>) => Path2DRelated API: createRectanglePath, RectanglePathOptions.
Parameters
Section titled “Parameters”options— Rectangle bounds and corner options. See RectanglePathOptions.
Returns
Section titled “Returns”A native Canvas path containing the rectangle.
See also
Section titled “See also”View source — packages/core/src/lib/geometry/rectangle.ts:44
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Polygon path factories: Create rounded rectangles and polygons alongside regular and star shapes. Plain source
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 380919b. ALPHA — NOT FOR PRODUCTION USE.