# Function: toSvgDocument()

[**lifecycle-kit**](https://jonbogaty.com/lifecycle-kit/api/readme/index.md)

***

[lifecycle-kit](https://jonbogaty.com/lifecycle-kit/api/readme/index.md) / [forms](https://jonbogaty.com/lifecycle-kit/api/forms/readme/index.md) / toSvgDocument


# Function: toSvgDocument() {#function-tosvgdocument}


> **toSvgDocument**(`path`, `viewBox`): `string`

Defined in: [forms/render/svg.ts:103](https://github.com/jbcom/lifecycle-kit/blob/074e4e7b8038d3e2de9eb44c4b5b5aee0ef02b48/src/forms/render/svg.ts#L103)

A complete standalone SVG document.

The viewBox is derived from the path's own bounds by the caller rather than
assumed here, because a form's extent is a property of the form. Callers that
want a fixture usually want a fixed box so that a geometry change shows up as
a path diff rather than as a viewBox diff.


## Parameters {#parameters}



### path {#path}


[`Path`](https://jonbogaty.com/lifecycle-kit/api/forms/interfaces/path/index.md)


### viewBox {#viewbox}



#### height {#height}


`number`


#### minX {#minx}


`number`


#### minY {#miny}


`number`


#### width {#width}


`number`


## Returns {#returns}


`string`
