viewbox

Allows SVG output images to scale beyond the specified width and height.

Syntax

viewbox={value}

Allowed values

ValueDescription
1Remove explicit width and height properties in the output image in favor of a single viewBox property.

Notes

  1. This is useful when you have an SVG that you want rendered using relative sizes as opposed to an explicit width and height (for example, in a flexible layout). Using viewbox allows the rendered SVG to scale to fit the dimensions of the parent element on the page.
  2. This parameter only works with format=svg. It is ignored when the format is set to anything else.

Examples

Click the link to view the transformed image using a demo Fastly IO service.

Example usageDescription
?format=svg&width=1000&viewbox=1Resize the image to 1000px wide and render as an SVG using viewbox