Icons are the symbolic representation of an action or information, providing visual context and improving usability.

See the Iconography and SVG guidelines to explore the full icon library.

also known as <svg>, Symbol, Glyph

Figma:

Responsive:

Adaptive:

Props

Component props
Name
Type
Default
accessibilityLabel
Required
string
-

Label for screen readers to announce Icon. This populates the aria-label attribute. If the label is hidden, use an empty string for the label (accessibilityLabel="") to set aria-hidden.

See the Accessibility guidelines for details on proper usage.

color
"default"
| "disabled"
| "subtle"
| "success"
| "error"
| "warning"
| "info"
| "recommendation"
| "inverse"
| "shopping"
| "brandPrimary"
| "light"
| "dark"
"subtle"

The colors available to apply to Icon.

See the color variant to learn more.

dangerouslySetSvgPath
{
  __path: string;
}
-

Defines a new icon different from the built-in Gestalt icons.

See the custom icon variant to learn more.

dataTestId
string
-

Available for testing purposes, if needed. Consider better queries before using this prop.

icon
"360" | "3d" | "3d-move" | "accessibility" | "ad" | "ad-group" | "add" | "add-circle" | "add-layout" | "add-pin" | "add-section" | "ads-overview" | "ads-stats" | "alert" | "align-bottom" | "align-bottom-center" | "align-bottom-left" | "align-bottom-right" | "align-middle" | "align-top" | "align-top-center" | "align-top-left" | "align-top-right" | "alphabetical" | "android-share" | "angled-pin" | "animate" | "api" | "apple" | "apps" | "ar-try-on" | "arrow-back" | "arrow-circle-back" | "arrow-circle-down" | "arrow-circle-forward" | "arrow-circle-up" | "arrow-counter-clockwise" | "arrow-double-back" | "arrow-double-forward" | "arrow-down" | "arrow-end" | "arrow-forward" | "arrow-left-curved" | "arrow-nested" | "arrow-start" | "arrow-up" | "arrow-up-left" | "arrow-up-right" | "arrows-vertical" | "aspect-ratio" | "audio-bars" | "audio-mix" | "audio-playing" | "bell" | "bell-fill" | "birthday-cake" | "board" | "board-sticker-large" | "board-sticker-small" | "border" | "border-shadow" | "briefcase" | "building-business" | "business-hierarchy" | "calendar" | "calendar-check" | "camera" | "camera-flip" | "camera-roll" | "cancel" | "canonical-pin" | "captions" | "captions-outline" | "card-stack" | "check" | "check-circle" | "check-circle-fill" | "chevron-down-circle" | "chevron-left-circle" | "chevron-right-circle" | "chevron-up-circle" | "circle" | "circle-ellipsis" | "circle-information-fill" | "circle-initializing" | "clear" | "clips" | "clock" | "clock-checked" | "cloud-server" | "code" | "code-check" | "cog" | "collage" | "collapse" | "color" | "color-palette" | "color-picker" | "color-solid" | "color-split" | "compass" | "compose" | "contrast" | "conversion-tag" | "copy-to-clipboard" | "credit-card" | "crop" | "crystal-ball" | "cutout" | "dash" | "data-source" | "design" | "desktop" | "diagnostics" | "directional-arrow-left" | "directional-arrow-right" | "download" | "drag-drop" | "draw" | "dropbox" | "duplicate" | "edit" | "ellipsis" | "envelope" | "erase" | "erase-auto" | "etsy" | "expand" | "eye" | "eye-hide" | "face-happy" | "face-neutral" | "face-sad" | "face-smiley" | "face-smiley-outline" | "face-smiley-plus" | "face-tryon" | "facebook" | "fade" | "file-box" | "file-unknown" | "fill-opaque" | "fill-transparent" | "filter" | "flag" | "flame" | "flash" | "flash-automatic" | "flash-slash" | "flashlight" | "flip-horizontal" | "flip-vertical" | "folder" | "folder-fill" | "forward" | "gauge" | "ghost" | "ghost-fill" | "gif" | "gif-visual" | "gift" | "globe" | "globe-checked" | "gmail" | "graph-bar" | "graph-pie" | "hand" | "hand-pointing" | "handle" | "heart" | "heart-broken" | "heart-health" | "heart-outline" | "highlights" | "history" | "home" | "home-fill" | "idea-pin" | "image-portrait" | "impressum" | "indent" | "info-circle" | "information" | "insights-audience" | "insights-conversion" | "instagram" | "invoice" | "kakao-talk" | "key" | "knoop" | "lab-flask" | "lasso-magic" | "layers-stack" | "layout" | "lightbulb" | "lightning-bolt-circle" | "link" | "link-broken" | "lips" | "list-numbered" | "list-numbered-rtl" | "location" | "lock" | "logo-large" | "logo-small" | "logout" | "magic-pen" | "magic-wand" | "magnifying-glass-sparkle" | "manage-access" | "margins-large" | "margins-medium" | "margins-small" | "maximize" | "megaphone" | "menu" | "messenger" | "microphone" | "minimize" | "mobile" | "moon" | "move-pin" | "music-off" | "music-on" | "mute" | "mute-fill" | "orientation-landscape" | "orientation-portrait" | "outdent" | "outlook" | "overlay-text" | "overlay-text-outline" | "overview" | "paper-clip" | "paper-lines-plus" | "pause" | "pen" | "pen-auto" | "people" | "performance-plus" | "person" | "person-add" | "person-fill" | "person-magnifying-glass" | "phone" | "pin" | "pin-hide" | "pincode" | "pinterest" | "play" | "protect" | "question-mark" | "record-limit" | "record-limit-10" | "record-limit-15" | "record-limit-30" | "record-limit-5" | "record-limit-60" | "redo" | "refresh" | "remove" | "reorder-images" | "replace" | "report" | "rewind" | "ribbon" | "rocketship" | "rotate" | "saturation" | "save-outline" | "saved" | "scale" | "scissors" | "search" | "search-by-image" | "search-fill" | "security" | "select" | "send" | "shadows" | "shapes" | "share" | "shopping-bag" | "shrink" | "shuffles" | "skintone" | "slide" | "smiley" | "snapchat" | "sort-ascending" | "sort-descending" | "sound" | "sound-fill" | "sound-slash" | "sound-slash-fill" | "sparkle" | "speech" | "speech-ellipsis" | "speech-ellipsis-fill" | "speech-exclamation-point" | "speech-heart" | "speech-outline" | "speed" | "speed-.3x" | "speed-.5x" | "speed-1x" | "speed-2x" | "speed-3x" | "spread" | "star" | "star-half" | "star-outline" | "sticker" | "sticker-image" | "sun" | "swap" | "switch-account" | "table" | "tag" | "tag-star" | "target" | "telegram" | "template" | "terms" | "text" | "text-align-center" | "text-align-left" | "text-align-right" | "text-all-caps" | "text-extra-small" | "text-invert" | "text-large" | "text-line-height" | "text-medium" | "text-sentence-case" | "text-size" | "text-small" | "text-spacing" | "text-sticker" | "thumbs-down" | "thumbs-up" | "timer" | "timer-10" | "timer-3" | "trash-can" | "trending" | "undo" | "unlock" | "upload-feed" | "viber" | "video-advance-10-seconds" | "video-camera" | "video-rewind-10-seconds" | "view-type-default" | "view-type-dense" | "view-type-list" | "view-type-sparse" | "visit" | "warmth" | "wave" | "whatsapp" | "wifi-no" | "workflow-status-all" | "workflow-status-canceled" | "workflow-status-halted" | "workflow-status-in-progress" | "workflow-status-ok" | "workflow-status-problem" | "workflow-status-queued" | "workflow-status-unstarted" | "workflow-status-warning" | "x-social" | "yahoo" | "youtube"
-

SVG icon from the Gestalt icon library to use within Icon.

See the icon library to explore available options.

inline
boolean
false

Properly positions Icon relative to an inline element, such as Text using the inline property.

size
number | string
16

Use a number for pixel sizes or a string for percentage based sizes.

See the size variant to learn more.

Usage guidelines

When to use
  • As symbolic communication for elements that do not have room for text, like the number of pins in a carousel. In this case, ensure the icon choice is easily recognizable and makes sense to international users.
  • To convey a critical meaning that cannot be communicated with words, like a downward chevron in a Button to indicate it reveals a menu.
  • To help with quick scanning by adding rhythm and hierarchy to the design.
When not to use
  • For purposes that are decorative or for visual embellishment, such as how illustrations are typically used. Contact us if this is needed.
  • As a visual reinforcement for associated text, without adding new meaning.
  • To communicate status or health. Use Status instead.
  • As an interactive element (e.g., utilizing hover, focus, click/tap). Use IconButton instead.

Best practices

Do

Use icons intentionally, ensuring the Icon choice is easily recognizable and makes sense in the context.

Don't

Repurpose icons. Using icons for their intended meaning supports good comprehension.

Do

Pair text and icons when possible to provide better clarity.

Don't

Don't create interactive Icons using TapArea. Use IconButton instead.

Accessibility

Icons are a great way to help users who have difficulties with reading, focus attention, and low vision impairments.

ARIA attributes

If the icon appears without text, the Icon requires accessibilityLabel, a text description for screen readers to announce and communicate the represented Icon, as shown in the first example.

Avoid using the generic words like "image" or "icon"; instead, use verbs that describe the meaning of the icon, for example: “pins".

If an icon has a visible label that describes what the icon represents, accessibilityLabel can be an empty string, as shown in the second example.

import { Flex, Icon, Text } from 'gestalt';

export default function Example() {
  return (
    <Flex
      alignItems="center"
      height="100%"
      justifyContent="center"
      width="100%"
    >
      <Flex alignItems="center" gap={2}>
        <Icon accessibilityLabel="Number of views" color="default" icon="eye" />
        <Text size="300" weight="bold">
          4
        </Text>
      </Flex>
    </Flex>
  );
}

import { Flex, Icon, Text } from 'gestalt';

export default function Example() {
  return (
    <Flex
      alignItems="center"
      height="100%"
      justifyContent="center"
      width="100%"
    >
      <Flex alignItems="center" gap={2}>
        <Icon accessibilityLabel="" color="default" icon="tag" />
        <Text size="300" weight="bold">
          Shopping spotlight
        </Text>
      </Flex>
    </Flex>
  );
}

Legibility and touch area

Ensure that icons use a contrast ratio of 4.5:1 between icon color and background color.

Localization

Be sure to localize all text strings. Note that localization can lengthen text by 20 to 30 percent.

Variants

Colors

Icons can be created using the following color options. brandPrimary should only be used to represent the Pinterest logo, as it is not accessible. See the design tokens for more info.

color="default"
color="disabled"
color="subtle"
color="success"
color="error"
color="warning"
color="info"
color="recommendation"
color="inverse"
color="shopping"
color="brandPrimary"
color="light"
color="dark"

Size

These are the guidelines for icon sizes (in px):

  1. 12
    Used sparingly in tight spaces. When possible, use a text label next to the icon, as it can be hard to see for visually impaired people.
  2. 14
    Used often following body text content any time an icon is needed.
  3. 16
    Used often any time an icon is needed. Default icon size.
  4. 24
    Used frequently any time an icon is needed.
  5. 32
    Used occasionally, on more dense UI.
  6. 32+
    Should be used sparingly and only in places where the UI is very dense and a larger icon is required.

Custom icon

Icon accepts both Gestalt icons and custom icons, as shown in the second example. For custom icons, follow the iconography and SVG guidelines.

Built-in icon
import { Flex, Icon } from 'gestalt';

export default function Example() {
  return (
    <Flex
      alignItems="center"
      height="100%"
      justifyContent="center"
      width="100%"
    >
      <Icon
        accessibilityLabel="Go to next steps"
        icon="directional-arrow-right"
      />
    </Flex>
  );
}

Custom SVG icon
import { Flex, Icon } from 'gestalt';

export default function Example() {
  return (
    <Flex
      alignItems="center"
      height="100%"
      justifyContent="center"
      width="100%"
    >
      <Icon
        accessibilityLabel="Go to next steps"
        dangerouslySetSvgPath={{
          __path:
            'M23 5v14a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4v-5.5h10.258l-1.94 1.939a1.5 1.5 0 0 0 2.121 2.122L17 12l-5.561-5.561a1.501 1.501 0 0 0-2.121 2.122l1.94 1.939H1V5a4 4 0 0 1 4-4h14a4 4 0 0 1 4 4',
        }}
      />
    </Flex>
  );
}

Compact icon

Icons are available as part of a Compact Icon set. These icons have a 16x16 viewboxes and are used in places where space is limited. Refer to your designer for guidance on when to use Compact Icons.

They can be used with the IconCompact component.

Compact Icon
import React, { useState } from 'react';
import { Flex, IconCompact, SelectList } from 'gestalt';

export default function Example() {
  const compactIconsList = IconCompact.icons;
  const [selectedValue, setSelectedValue] = useState(compactIconsList[0]);

  return (
    <Flex
      alignItems="center"
      height="100%"
      justifyContent="center"
      width="100%"
    >
      <Flex alignItems="center" direction="row" gap={4}>
        <SelectList
          id="select-list-example"
          onChange={({ value }) => {
            setSelectedValue(value);
          }}
        >
          {compactIconsList.map((value) => (
            <SelectList.Option key={value} label={value} value={value} />
          ))}
        </SelectList>

        <IconCompact
          accessibilityLabel="Add a new item"
          color="default"
          icon={selectedValue}
        />
      </Flex>
    </Flex>
  );
}

Writing

Do

Use a descriptive label to describe the Icon

  • Be succinct. Exclude unnecessary words.
  • Be informative and accurate
  • Write in the active voice
  • Avoid technical jargon
Don't
  • Use the words "image" or "icon" in the description label; instead, use words that indicate the purpose of the icon.

Component quality checklist

Component quality checklist
Quality item
Status
Status description
Figma Library
Ready
Component is available in Figma for web and mobile web.
Responsive Web
Ready
Component responds to changing viewport sizes in web and mobile web.

IconButton
Use IconButton when only an icon is needed to represent an action instead of text.

Button
Use Button to allow users to take an action.