Skip to content

Circle

Read as Markdown

import { Circle } from "@pibbl/core";

Circle uses CircleProps and CircleStyle. radius is required; cx and cy default to zero. It rejects children. Its same geometry drives paint and coordinate targeting, and percentage radii use the smaller available axis.

<Circle
style={{ cx: 96, cy: 80, radius: 44, fill: "#fb7185", stroke: "#881337" }}
/>

Try the Circle live example.

Describes a circle primitive for JSX or createElement authoring.

Circle: PibblPrimitiveComponent<CircleProps, PrimitiveInput<CircleProps, CircleStyle>>

Related API: Circle, PibblPrimitiveComponent, CircleProps, PrimitiveInput, CircleStyle.

  • props — Authored component inputs, supplied through JSX or createElement. See the linked props and style types.

When called directly; Pibbl mounts this component through JSX or createElement.

CircleProps

CircleStyle

View source — packages/core/src/lib/components/circle.ts:103

Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.

Compile this TSX module with jsx: "react-jsx" and jsxImportSource: "@pibbl/core", then load it from a browser entry point after the document body exists. It creates and mounts one canvas; dispose the controller before removing or replacing that canvas. The interactive study linked below adds controls beyond this minimal use case.

Download source

/** @jsxImportSource @pibbl/core */
import { pibbl, Circle } from '@pibbl/core';
const canvas = document.createElement('canvas');
canvas.width = 320;
canvas.height = 240;
document.body.append(canvas);
const controller = pibbl(canvas, (
<Circle
style={{ cx: 96, cy: 80, radius: 44, fill: "#fb7185", stroke: "#881337" }}
/>
));
window.addEventListener('pagehide', () => controller.dispose(), { once: true });

Documentation built with @pibbl/core 0.0.2, revision 2dccb19. ALPHA — NOT FOR PRODUCTION USE.