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 EnergyLabel, { download } from 'energy-label'

      const element = document.getElementById('energy-label')

      const label = new EnergyLabel('arrow', { efficiencyRating: 'A' })
      const svgString = label.toString()

      download(svgString)
      // Or with a custom filename:
      download(svgString, 'my-energy-label.svg')