Search...
icon
Sets or gets the dashboard icon button's icon.
Description
The icon
property defines the vector image used as the dashboard button's icon.
Setting icon
changes the dashboard button icon to the image indicated by the new value.
Getting the icon
property returns the location of the icon image file.
The following formats are supported:
- Vector images from the Media Manager:
wix:vector://v1/<vector_uri>/<filename>
- Vector images from the web:
http(s)://<vector image url>
- Vector XML string:
<svg>...</svg>
Type:
stringRead & Write
Was this helpful?
Get a dashboard icon button's icon
Copy Code
1let icon = $w('#myIconButton').icon; //wix:vector://v1/11062b_636dddbfd3be4d77adf4cd14fbe28a49.svg/
Set icon to an image from the Media Manager
Copy Code
1$w('#myButton').icon = "wix:vector://v1/11062b_636dddbfd3be4d77adf4cd14fbe28a49.svg/";
Set icon with a literal value
Copy Code
1$w('#myIconButton').icon = `${$w('#myOtherButton').icon}`
Set icon to an XML string
Copy Code
1$w('#myIconButton').icon = '<svg height="10" width="10"><polygon points="0,9 9,9 5,0" style="fill:lime;stroke:purple;stroke-width:1"/></svg>';