JSPM

  • Created
  • Published
  • Downloads 33594
  • Score
    100M100P100Q175653F
  • License BSD-3-Clause

Manages a set of svg icons

Package Exports

  • @polymer/iron-iconset-svg
  • @polymer/iron-iconset-svg/iron-iconset-svg
  • @polymer/iron-iconset-svg/iron-iconset-svg.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@polymer/iron-iconset-svg) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build status

Demo and API docs

<iron-iconset-svg>

The iron-iconset-svg element allows users to define their own icon sets that contain svg icons. The svg icon elements should be children of the iron-iconset-svg element. Multiple icons should be given distinct id's.

Using svg elements to create icons has a few advantages over traditional bitmap graphics like jpg or png. Icons that use svg are vector based so they are resolution independent and should look good on any device. They are stylable via css. Icons can be themed, colorized, and even animated.

Example:

<iron-iconset-svg name="my-svg-icons" size="24">
  <svg>
    <defs>
      <g id="shape">
        <rect x="12" y="0" width="12" height="24" />
        <circle cx="12" cy="12" r="12" />
      </g>
    </defs>
  </svg>
</iron-iconset-svg>

This will automatically register the icon set "my-svg-icons" to the iconset database. To use these icons from within another element, make a iron-iconset element and call the byId method to retrieve a given iconset. To apply a particular icon inside an element use the applyIcon method. For example:

iconset.applyIcon(iconNode, 'car');