# createStarPath

```ts
import { createStarPath, Path } from "@pibbl/core";
```

[`StarPathOptions`](/reference/types/elements-components/#starpathoptions) is accepted by `createStarPath(options): Path2D`, which validates integer points and
nonnegative inner/outer radii, then returns a fresh concave star outline. It is
pure and owns no render state, event target, or cache.

```tsx
<Path
  style={{
    d: createStarPath({ points: 5, outerRadius: 54, innerRadius: 24 }),
    fill: "#f59e0b",
  }}
/>
```

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

## API details from source

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

Creates a Canvas Path2D for star geometry from validated options.

```ts
createStarPath: (options: Readonly<StarPathOptions>) => Path2D
```

Related API: [createStarPath](/reference/functions/create-star-path/), [StarPathOptions](/reference/types/elements-components/#starpathoptions).

### Parameters

- **`options`** — Star center, inner and outer radii, point count, and rotation. See
[StarPathOptions](/reference/types/elements-components/#starpathoptions) .

### Returns

A native Canvas path containing the star.

### See also

[StarPathOptions](/reference/types/elements-components/#starpathoptions)

[View source — packages/core/src/lib/geometry/star.ts:130](/source/packages/core/src/lib/geometry/star-ts/#L130)

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

- [Polygon path factories](/minimal-examples/paths/polygon-factories/): Create rounded rectangles and polygons alongside regular and star shapes. [Plain source](/minimal/paths/polygon-factories.ts)
## Documentation version

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