Preparing search index...

    Function download

    • Downloads an SVG string as a file to the user's device.

      Parameters

      • svgString: string

        The SVG markup as a string to be downloaded.

      • Optionalfilename: string = 'label.svg'

        The filename for the downloaded file.

      Returns void

      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')