Circle
Full-page experience · Open playground
Draw a round mark from an explicit center and radius.
Try it
Section titled “Try it”Click the coral circle to change its fill.
What to learn
Section titled “What to learn”- Set a circle center, radius, fill, and outline in one local style object.
- Use the filled interior as an intentional click target.
Integration boundaries
Section titled “Integration boundaries”- Circle radius percentages resolve against the smaller available axis.
- Fill geometry is used for clicks while the dark outline remains a stroke.
This is a Pibbl Canvas example. Its mount owns its runtime resources; call its controller’s dispose method when removing it. The preview starts automatically unless reduced motion is enabled; Stop disposes the mount. Preserve the source’s logical canvas size and aspect ratio. Native HTML is not captured by Canvas filters.
Related APIs
Section titled “Related APIs”Complete source
Section titled “Complete source”Host setup for this source: use a canvas with width 720 and height 420, compile with jsx: "react-jsx" and jsxImportSource: "@pibbl/core", import its default mount, and call const controller = mount(canvas) after attaching the canvas. Call controller.dispose() before removing it.
circle.example.tsx
Section titled “circle.example.tsx”import { Circle, Rectangle, useSignal } from "@pibbl/core";
export function CircleStudy() { const active = useSignal(false);
return [ <Rectangle style={{ left: 0, top: 0, width: 720, height: 420, fill: "#f7f0df" }} />, <Circle style={{ cx: 360, cy: 210, radius: 110, fill: active.get() ? "#74d3ae" : "#ff6b57", stroke: "#17211d", strokeWidth: 6, cursor: "pointer", }} onClick={() => active.update((value) => !value)} />, ];}Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision a1dcf8e. ALPHA — NOT FOR PRODUCTION USE.