Examples
Status colors
The following example demonstrates the various status variants of an icon. Keep in mind that these icons are displayed out of a typical context, and that you should not rely on color alone to convey status to users.
Sizing an icon within the icon container
Providing both size and iconSize properties allows the icon container to maintain a consistent size, even if the icon changes in size.
In progress
Passing the isInProgress
property will swap the icon to a progress icon. By default this progress icon will be a Spinner
but may be customized or overriden using the progressIcon
property.
Props
Icon
Name | Type | Default | Description |
---|---|---|---|
children | React.ReactNode | Icon content | |
className | string | Additional classes applied to the icon container | |
defaultProgressArialabel | string | 'Loading...' | Aria-label for the default progress icon |
iconSize | | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'headingSm' | 'headingMd' | 'headingLg' | 'headingXl' | 'heading_2xl' | 'heading_3xl' | 'bodySm' | 'bodyDefault' | 'bodyLg' | Size of icon. Overrides the icon size set by the size property. | |
isInline | boolean | false | Indicates the icon is inline and should inherit the text font size and color. Overriden by size and iconSize properties. |
isInProgress | boolean | false | Indicates the icon is in progress. Setting this property to true will swap the icon with the progressIcon. |
progressIcon | React.ReactNode | Icon when isInProgress is set to true. Defaults to a 1em spinner. | |
progressIconSize | | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'headingSm' | 'headingMd' | 'headingLg' | 'headingXl' | 'heading_2xl' | 'heading_3xl' | 'bodySm' | 'bodyDefault' | 'bodyLg' | Size of progress icon. Overrides the icon size set by the size property. | |
shouldMirrorRTL | boolean | false | Flag indicating whether the icon passed as children should be mirrored for right to left (RTL) languages. This will not mirror the icon passed to progressIcon. |
size | | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'headingSm' | 'headingMd' | 'headingLg' | 'headingXl' | 'heading_2xl' | 'heading_3xl' | 'bodySm' | 'bodyDefault' | 'bodyLg' | Size of the icon component container and icon. | |
status | 'custom' | 'info' | 'success' | 'warning' | 'danger' | Status color of the icon |
CSS variables
Expand or collapse column | Selector | Variable | Value |
---|