# SvgPath

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

`SvgPath` uses [`SvgPathProps`](/reference/types/elements-components/#svgpathprops) and [`SvgPathStyle`](/reference/types/styles/#svgpathstyle). Its SVG path-data input is
parsed by the browser into the geometry used for paint and targeting. It
rejects children; browser `Path2D` parsing behavior remains authoritative.

```tsx
<SvgPath style={{ d: "M10 10h90v60H10z", fill: "#38bdf8" }} />
```

See the [SVG path live example](/playground/#/examples/drawing/svg-path).

## API details from source

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

Describes an SVG-data path primitive for JSX or createElement authoring.

```ts
SvgPath: PibblPrimitiveComponent<SvgPathProps, PrimitiveInput<SvgPathProps, SvgPathStyle>>
```

Related API: [SvgPath](/reference/components/svg-path/), [PibblPrimitiveComponent](/reference/types/elements-components/#pibblprimitivecomponent), [SvgPathProps](/reference/types/elements-components/#svgpathprops), [PrimitiveInput](/reference/types/styles/#primitiveinput), [SvgPathStyle](/reference/types/styles/#svgpathstyle).

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

[SvgPathProps](/reference/types/elements-components/#svgpathprops)

[SvgPathStyle](/reference/types/styles/#svgpathstyle)

[View source — packages/core/src/lib/components/svg-path.ts:47](/source/packages/core/src/lib/components/svg-path-ts/#L47)

## 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/svg-path.tsx)

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

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

const controller = pibbl(canvas, (
<SvgPath style={{ d: "M10 10h90v60H10z", fill: "#38bdf8" }} />
));

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

## Complete minimal examples

- [Lines and authored paths](/minimal-examples/drawing/strokes-paths/): Combine polyline, axis-aligned strokes, mutable geometry, and SVG path data. [Plain source](/minimal/drawing/strokes-paths.tsx)
## Interactive examples

- [SVG path](/examples/svg-path/) · [Full page](/experience/svg-path/)
## Documentation version

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