# Ellipse
[Full-page experience](/experience/ellipse/) · [Open playground](/playground/#/examples/drawing/ellipse)

Stretch and rotate a curved mark with independent horizontal and vertical radii.

## Try it

Click the blue ellipse to turn it gold.

## What to learn

- Use radiusX, radiusY, and rotation to define ellipse geometry.
- Click the filled ellipse to swap its color without changing its bounds.

## Integration boundaries

- Ellipse rotation uses radians and is local to the primitive.
- The separate radii make an ellipse distinct from a circle.

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

- [Ellipse](/reference/components/ellipse/)

## 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.

### ellipse.example.tsx

```tsx
import { pibbl, useSignal, Ellipse, Rectangle, type PibblController } from "@pibbl/core";

function EllipseStudy() {
  const active = useSignal(false);

  return [
    <Rectangle
      style={{ left: 0, top: 0, width: 720, height: 420, fill: "#f7f0df" }}
    />,
    <Ellipse
      style={{
        cx: 360,
        cy: 210,
        radiusX: 154,
        radiusY: 78,
        rotation: -0.22,
        fill: active.get() ? "#f7c948" : "#1f4bd8",
        stroke: "#17211d",
        strokeWidth: 6,
        cursor: "pointer",
      }}
      onClick={() => active.update((value) => !value)}
    />,
  ];
}

export default function mount(canvas: HTMLCanvasElement): PibblController {
  return pibbl(canvas, <EllipseStudy />);
}

```

## Documentation version

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