Authors:Yoshiroh Kamiyama
Developers:Yoshiroh Kamiyama

Introduction is a utility for creating an image icon, a css sprite icon, or a DOM Button. It calls iconUtils.createIcon() with given parameters to create an icon. Note that this module is not a widget, i.e., it does not inherit from dijit._WidgetBase.


Constructor Parameters

Parameter Type Default Description
icon String “” An icon to display. The value can be either a path for an image file or a class name of a DOM button.
iconPos String “” The position of an aggregated icon. IconPos is comma separated values like top,left,width,height (ex. “0,0,29,29”).
alt String “” An alt text for the icon image.
tag String “div” A name of html tag to create as this.domNode.


Declarative example

<div data-dojo-type=""
<div data-dojo-type=""
<div data-dojo-type=""

Programmatic example

], function(ready, Icon){
    var icon1 = new Icon({icon:"images/tab-icon-23h.png"},
    var icon2 = new Icon({icon:"images/tab-icons.png", iconPos:"29,116,29,29"},
    var icon3 = new Icon({icon:"mblDomButtonBlueCircleArrow"},
<div id="icon1"></div>
<div id="icon2"></div>
<div id="icon3"></div>
Error in the documentation? Can’t find what you are looking for? Let us know!