Getting startedFoundationsUtilitiesComponentsReleasesSupportGetting startedFoundationsUtilitiesComponentsReleasesComponent StatusAccordion GroupAccordionCollapseBadgeButtonButton DropdownCardStatus CardContentData GridData Grid Table HeaderDate PickerDate Picker InputDate Range PickerDate Range Picker ButtonInputSelectText AreaCheckboxCheckbox GroupRadio ButtonRadio Button GroupComboboxIconIcon LibraryListList Parent ItemList ItemList HeaderHeaderMobile SubheaderFooterFooter ItemSidebarAlertToastToast GroupDialogModalPanelPopoverPaginationSpinnerTabsTab GroupTabTab Panel GroupTab PanelToggle

Component Icon

Icons are symbols used to represent words or actions visually. Used properly, they simplify a user experience by reducing cognitive load. The State of Michigan uses icons from IBM’s Carbon design system. See the iconography foundations page for more information.

Example

<som-icon name="gift" size="sm" />
<som-icon name="gift" size="md" />
<som-icon name="gift" size="lg" />
<som-icon name="gift" size="xl" />
<som-icon name="gift" size="lg" color="primary" />
<som-icon name="gift" size="lg" color="secondary" />
<som-icon name="gift" size="lg" color="danger" />

Accessibility

All icons ship with the required aria-label attribute, which is used to provide a descriptive label to any assistive technologies.

Props

AttrTypeDefaultDocs

color

string

This property represents the color of the icon. By default, the color will match the current font color. However, you can override this color by passing in the name of SASS variable (primary, secondary, success, danger, warning, light, dark, black, white, dark-gray, light-gray, body-copy).

display

string

'inline-block'

This property represents the CSS display property. In certain circumstances you may need to adjust the display property to properly align the icon.

name

string

The name of the icon

size

string

This property represents the size of the icon. By default, the size will be determined by the current font size. However, you can override this size using pre-built sizes (sm, md, lg, xl).

Healthy

Healthy content is accurate and represents our most up-to-date recommendations.

Get in touch

Do you have an idea, or want to help us improve this page? Reach out to us via email.

DTMB-DG-Support@michigan.gov

Need help? Visit our Support page to learn how to get assistance, troubleshoot issues, and connect with the team.

Anatomy

An icon on a 32x32px grid with 2px of padding

Icons are designed on a 32x32px grid with a 2px stroke and 2px of padding.

Sizes

Be sure icon sizes are consistent. When used inline with text, icons should match the text’s line height. By default, the size will be determined by the current font size. Icons can be resized by omitting the size prop and adjusting the font size.

Small, medium, large, and extra large icons, as described in the caption.

Icons come in four sizes:

  • Small: 16px
  • Medium: 24px
  • Large: 32px
  • Extra-large: 48px

Colors

Icons are always a single color with no gradients. By default, the color will match the current font color, but this can be overridden with the color prop. The icon’s color should reflect its role. See the colors foundations page for more on this.

Examples of icons in main colors and status colors.

An icon’s color should reflect its role.

Descriptive icons must have a minimum 3:1 color contrast ratio. While decorative icons do not require a 3:1 ratio, it’s still a good guideline to follow to ensure readability.

Styles

The icon library has outline and solid icon types. Outline icons are standard, but the solid versions are provided as well to represent a toggled or selected state.

Bookmark
Bookmarked
<div className="pr-1_5">
<som-icon name="bookmark" size="md" />
<span className='text-type-6 pl-0_5'>Bookmark</span>
</div>
<div>
<som-icon name="bookmark-filled" size="md" />
<span className='text-type-6 pl-0_5'>Bookmarked</span>
</div>

Behavior

Icons are not interactive by default, but can be paired with a button to trigger an action. Buttons with icons have interactive states and modifiers. See the button component page for more info on using icons with buttons.

An image showing a static icon and an icon button as described below.

The contextual icon on the left is static. The icon on the right is inside a button and clickable.

Icon buttons should have a label, except in rare cases where the icon is universally recognizable, such as with home, print, or search.

How to use

Icons can be descriptive or decorative.

  • Descriptive icons convey information or functionality and require alt text to explain their purpose.
  • Decorative icons are purely aesthetic and can be marked as such with an empty alt attribute (alt=""), which will be ignored by screen readers.

Text can accompany icons to add context. Any accompanying text should be directly related to the icon and the message being conveyed.

Examples of icons paired with accompanying text.

Text can accompany icons to add context.

Improper use of the same icon to represent different concepts, as described in the caption.
Don’t use the same icon to represent different concepts.
Improper use of different icons to represent the same concept, as described in the caption.
Don’t use different icons to represent the same concept.

Layout

Some notes on placement:

  • Icons can be positioned beside or above text.
  • Icons placed beside text should be aligned to the top of the text block and match the line height of the text.
  • Icons can be placed above content as well.
  • If text is left-justified, icons should align to the left.
  • If text is centered, icons should align to the center.
An icon properly aligned with text.
Icons must be the same size as the line height and top-aligned when combined with text.
Two examples of text and icons aligned incorrectly, as described in the caption.
Don’t center-align text vertically or make icons larger than the line height.
Icons properly aligned with text.
Icon alignment should match text justification.
Text and icons improperly aligned, as described in the caption.
Don’t mix different alignments and justifications.
Get in touch

Do you have an idea, or want to help us improve this page? Reach out to us via email.

DTMB-DG-Support@michigan.gov

Need help? Visit our Support page to learn how to get assistance, troubleshoot issues, and connect with the team.

Open source