# Wedge
[Full-page experience](/experience/wedge/) · [Open playground](/playground/#/examples/drawing/wedge)

Close a circular sweep back to its center to make a filled sector.

## Try it

Click inside the violet wedge to turn it green.

## What to learn

- Use radius and radian angles to draw a center-closed sector.
- Click the sector interior to switch its fill color.

## Integration boundaries

- Wedge paints an arc plus two radial edges, unlike the open Arc primitive.
- A full-circle wedge omits a radial stroke seam.

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

- [Wedge](/reference/components/wedge/)

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

### wedge.example.tsx

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

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

  return [
    <Rectangle
      style={{ left: 0, top: 0, width: 720, height: 420, fill: "#f7f0df" }}
    />,
    <Wedge
      style={{
        cx: 360,
        cy: 210,
        radius: 132,
        startAngle: -Math.PI / 2,
        endAngle: Math.PI / 3,
        fill: active.get() ? "#22c55e" : "#a855f7",
        stroke: "#17211d",
        strokeWidth: 6,
        cursor: "pointer",
      }}
      onClick={() => active.update((value) => !value)}
    />,
  ];
}

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

```

## Documentation version

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