Dojo's Icon
widget renders an icon.
Basic Example
import Icon from '@dojo/widgets/icon';
import { w } from '@dojo/framework/widget-core/d';
w(Icon, { type: 'downIcon', });
By default the icon will be rendered with aria-hidden="true"
.
Custom aria attributes can be specified to override the default, and
text for screen readers can be provided via the altText
property.
Custom aria attributes Example
import Icon from '@dojo/widgets/icon';
import { w } from '@dojo/framework/widget-core/d';
w(Icon, {
type: 'downIcon',
aria: {
hidden: 'false',
label: 'label'
}
});
Example with altText
import Icon from '@dojo/widgets/icon';
import { w } from '@dojo/framework/widget-core/d';
w(Icon, {
type: 'downIcon',
altText: 'Go down'
});
The following CSS classes are used to style the Icon
widget and should be provided by custom themes:
root
: Applied to the top-level wrapper nodeicon
: Applied to the icon node
Icon Classes
downIcon
: Applied to the same level asicon
ifproperties.type
is'downIcon'
leftIcon
: Applied to the same level asicon
ifproperties.type
is'leftIcon'
rightIcon
: Applied to the same level asicon
ifproperties.type
is'rightIcon'
closeIcon
: Applied to the same level asicon
ifproperties.type
is'closeIcon'
plusIcon
: Applied to the same level asicon
ifproperties.type
is'plusIcon'
minusIcon
: Applied to the same level asicon
ifproperties.type
is'minusIcon'
checkIcon
: Applied to the same level asicon
ifproperties.type
is'checkIcon'
upIcon
: Applied to the same level asicon
ifproperties.type
is'upIcon'
upAltIcon
: Applied to the same level asicon
ifproperties.type
is'upAltIcon'
downAltIcon
: Applied to the same level asicon
ifproperties.type
is'downAltIcon'
searchIcon
: Applied to the same level asicon
ifproperties.type
is'searchIcon'
barsIcon
: Applied to the same level asicon
ifproperties.type
is'barsIcon'
settingsIcon
: Applied to the same level asicon
ifproperties.type
is'settingsIcon'
alertIcon
: Applied to the same level asicon
ifproperties.type
is'alertIcon'
helpIcon
: Applied to the same level asicon
ifproperties.type
is'helpIcon'
infoIcon
: Applied to the same level asicon
ifproperties.type
is'infoIcon'
phoneIcon
: Applied to the same level asicon
ifproperties.type
is'phoneIcon'
editIcon
: Applied to the same level asicon
ifproperties.type
is'editIcon'
dateIcon
: Applied to the same level asicon
ifproperties.type
is'dateIcon'
linkIcon
: Applied to the same level asicon
ifproperties.type
is'linkIcon'
locationIcon
: Applied to the same level asicon
ifproperties.type
is'locationIcon'
secureIcon
: Applied to the same level asicon
ifproperties.type
is'secureIcon'
mailIcon
: Applied to the same level asicon
ifproperties.type
is'mailIcon'