# Star

```ts
import { Star } from "@pibbl/core";
```

`Star` uses [`StarProps`](/reference/types/elements-components/#starprops) and [`StarStyle`](/reference/types/styles/#starstyle). It requires integer `points >= 3`,
nonnegative `outerRadius` and `innerRadius`, and `innerRadius <= outerRadius`.
It rejects children and creates one concave outline rather than intersecting
triangles.

```tsx
<Star
  style={{
    cx: 82,
    cy: 72,
    points: 5,
    outerRadius: 58,
    innerRadius: 26,
    fill: "#f59e0b",
  }}
/>
```

Try the [Star live example](/playground/#/examples/drawing/star).

## API details from source

<span id="api-Star"></span>

Describes a star primitive for JSX or createElement authoring.

```ts
Star: PibblPrimitiveComponent<StarProps, PrimitiveInput<StarProps, StarStyle>>
```

Related API: [Star](/reference/components/star/), [PibblPrimitiveComponent](/reference/types/elements-components/#pibblprimitivecomponent), [StarProps](/reference/types/elements-components/#starprops), [PrimitiveInput](/reference/types/styles/#primitiveinput), [StarStyle](/reference/types/styles/#starstyle).

### Parameters

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

### Throws

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

### See also

[StarProps](/reference/types/elements-components/#starprops)

[StarStyle](/reference/types/styles/#starstyle)

[View source — packages/core/src/lib/components/star.ts:148](/source/packages/core/src/lib/components/star-ts/#L148)

## Implementation guidance for agents

Read the [Drawing, layout, and effects companion](/agents/topics/layout/) for ownership, adaptation, failure modes, and verification. [Agent start](/agents/) provides the version-selection workflow.

## Complete minimal example

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](/minimal/star.tsx)

```tsx
/** @jsxImportSource @pibbl/core */
import { pibbl, Star } from '@pibbl/core';

const canvas = document.createElement('canvas');
canvas.width = 320;
canvas.height = 240;
document.body.append(canvas);

const controller = pibbl(canvas, (
<Star
  style={{
    cx: 82,
    cy: 72,
    points: 5,
    outerRadius: 58,
    innerRadius: 26,
    fill: "#f59e0b",
  }}
/>
));

window.addEventListener('pagehide', () => controller.dispose(), { once: true });
```

## Complete minimal examples

- [Polygon marks](/minimal-examples/drawing/polygons/): Draw a rounded triangle, regular hexagon, and five-point star. [Plain source](/minimal/drawing/polygons.tsx)
## Interactive examples

- [Star](/examples/star/) · [Full page](/experience/star/)
## Documentation version

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