AssetValue
Puck Assets is in early access. Request access.
The value of an asset field.
{
"src": "https://www.example.com/cdn/image/format=auto,width=1200/bike.png",
"originalSrc": "https://www.example.com/bike.png",
"transform": { "width": 1200 },
"id": "asset_123",
"mediaType": "image/png",
"alt": "A red bike",
"width": 2400,
"height": 1600
}Params
| Param | Example | Type | Status |
|---|---|---|---|
src | src: "https://www.example.com/bike.png" | String | Required |
originalSrc | originalSrc: "https://www.example.com/bike.png" | String | - |
transform | transform: { width: 1200 } | Object | - |
id | id: "asset_123" | String | - |
mediaType | mediaType: "image/png" | String | - |
alt | alt: "A red bike" | String | - |
width | width: 2400 | Number | - |
height | height: 1600 | Number | - |
src
The URL of the selected asset. Use this to render the asset or fetch it. Includes image transforms if applied.
originalSrc
The URL of the selected asset without its transform.
transform
The transform applied to the asset.
id
The id of the selected asset.
mediaType
The media type of the selected asset.
alt
The alt text of the selected asset. Editable by the user.
width
The width of the selected asset in pixels, if known.
height
The height of the selected asset in pixels, if known.