Downloads an SVG string as a file to the user's device.
The SVG markup as a string to be downloaded.
Optional
The filename for the downloaded file.
This function does not return a value.
May throw if blob creation fails.
import { download, EnergyLabel } from 'energy-label'const label = new EnergyLabel('arrow', { energyClass: 'A' })const svgString = label.toString()download(svgString)// Or with a custom filename:download(svgString, 'my-energy-label.svg') Copy
import { download, EnergyLabel } from 'energy-label'const label = new EnergyLabel('arrow', { energyClass: 'A' })const svgString = label.toString()download(svgString)// Or with a custom filename:download(svgString, 'my-energy-label.svg')
Downloads an SVG string as a file to the user's device.