2023-06-01 16:48:11 +02:00
|
|
|
---
|
|
|
|
title: Svg.asRenderProps()
|
|
|
|
---
|
|
|
|
|
|
|
|
The `Svg.asRenderProps()` method will return the data stored in the
|
2024-01-21 11:16:40 -08:00
|
|
|
svg as a serializable JavaScript object. This method is typically
|
2023-06-01 16:48:11 +02:00
|
|
|
not invoked directly but rather called under the hood as a result of
|
2024-07-08 18:07:40 +03:00
|
|
|
calling [`Pattern.getRenderProps()`](/reference/api/pattern/getrenderprops).
|
2023-06-01 16:48:11 +02:00
|
|
|
|
|
|
|
## Signature
|
|
|
|
|
|
|
|
```js
|
|
|
|
Object svg.asRenderProps()
|
|
|
|
```
|
|
|
|
|
|
|
|
## Returned object properties
|
|
|
|
|
2024-01-24 20:21:08 -08:00
|
|
|
The returned JavaScript object has the following properties:
|
2023-06-01 16:48:11 +02:00
|
|
|
|
|
|
|
| Name | Description |
|
|
|
|
| ----:| ----------- |
|
2023-11-12 11:13:38 +01:00
|
|
|
| `attributes` | The result of [Path.attributes.asRenderProps()](/reference/api/attributes/asrenderprops) |
|
2023-06-01 16:48:11 +02:00
|
|
|
| `layout` | A plain object describing the layout of the SVG |
|
|
|
|
| `body` | A string holding the SVG body |
|
|
|
|
| `style` | A string holding the SVG style |
|
|
|
|
| `defs` | A string holding the SVG defs |
|
|
|
|
|