Flutter docs
Default skin

Icon

Semantic vector graphics.

How to use

Icons come from @ant-design/icons@6.x. It is not a peer of this library — it arrives with the pinned runtime, which depends on it, so it is already installed and its version is fixed with the rest of the runtime. Import icon components from @ant-design/icons; they inherit the current text colour and therefore the active Skin.

Examples

Basic

Import outlined, filled, and two-tone icons and use spin for animation.

Two-tone icon and colorful icon

Set twoToneColor to a specific primary color.

Custom Icon

Create reusable icons from SVG components.

Use iconfont.cn

Use iconfont.cn resources through createFromIconfontCN.

Multiple resources from iconfont.cn

Compose multiple iconfont resources in array order.

API

Common icons accept standard SVG attributes plus spin, rotate, twoToneColor, component, and style. createFromIconfontCN creates icon components backed by one or more iconfont resources.

Common Icon

PropertyDescriptionTypeDefaultVersion
classNameThe className of Iconstring-—
rotateRotate by n degrees (not working in IE9)number-—
spinRotate icon with animationbooleanfalse—
styleThe style properties of icon, like fontSize and colorCSSProperties-—
twoToneColorOnly supports the two-tone icon. Specify the primary color, or primary and secondary colorsstring | \[string, string]-—

Custom Icon

PropertyDescriptionTypeDefaultVersion
componentThe component used for the root nodeComponentType<CustomIconComponentProps>-—
rotateRotate degrees (not working in IE9)number-—
spinRotate icon with animationbooleanfalse—
styleThe style properties of icon, like fontSize and colorCSSProperties-—

Custom Font Icon

PropertyDescriptionTypeDefaultVersion
extraCommonPropsDefine extra properties to the component{ \[key: string]: any }{}—
scriptUrlThe URL generated by iconfont.cn project. Support string[] after @ant-design/icons@4.1.0string | string\[]-—

Custom SVG Icon

PropertyDescriptionTypeDefaultVersion
classNameThe computed class name of the svg elementstring-—
fillDefine the color used to paint the svg elementstringcurrentColor—
heightThe height of the svg elementstring | number1em—
styleThe computed style of the svg elementCSSProperties-—
widthThe width of the svg elementstring | number1em—

Do

Choose icons by meaning and provide an accessible label for icon-only actions.

Don't

Use a decorative icon as the only explanation for an unfamiliar operation.