Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

Icon

The Icon component renders pictograms or graphic symbols. It can act as a wayfinding tool or as a means of communicating functionality.

Support
Targets (50)

Supported targets


Anchor to source
source
required

The name of the icon to display.

Anchor to accessibilityLabel
accessibilityLabel
string

A label that describes the purpose or contents of the icon. When set, it will be announced to users using assistive technologies and will provide them with more context.

Anchor to appearance
appearance
Default: 'base'

The color of the icon, set using a design-system keyword.

string

A unique identifier for the component. Use this to target the component in scripts or stylesheets, or to distinguish it from other instances of the same component.

'extraSmall' | 'small' | 'large' | 'base' | 'fill'
Default: 'base'

The size of the icon.

  • extraSmall: The smallest available icon size.
  • small: A compact icon size, smaller than the default.
  • base: Renders the icon at its standard size.
  • large: A larger icon for increased visual prominence.
  • fill: Stretches the icon to fill the available space in its container while preserving its aspect ratio.

Basic Icon

Example

Basic Icon

import {
reactExtension,
Icon,
} from '@shopify/ui-extensions-react/checkout';

export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);

function Extension() {
return <Icon source="discount" />;
}
import {extension, Icon} from '@shopify/ui-extensions/checkout';

export default extension('purchase.checkout.block.render', (root) => {
const icon = root.createComponent(Icon, {source: 'discount'});

root.appendChild(icon);
});

  • Use meaningful icons to support actions and status, not decorate: Icons should clarify what an action does or indicate state. Use icons with well-established meanings such as a trash icon for delete actions, a checkmark for completed status, or a warning icon for errors. Avoid adding icons purely for visual interest.
  • Use appearances consistently to communicate semantic meaning: Apply info for neutral guidance, success for confirmations, warning for issues that need attention, and critical sparingly for problems that must be resolved immediately.
  • Pair with text labels: Don't rely on icons alone to communicate meaning. Always pair icons with visible text for clarity and accessibility.
  • Maintain consistency across your interface: Always use the same icon for the same action or concept throughout your extension. If you use a pencil for edit in one place, use it everywhere. Inconsistent icon usage confuses buyers.
  • Size appropriately: Use base for standard inline icons, small for compact layouts, and large when extra emphasis is needed. Avoid mixing sizes in the same row. Inconsistent sizing creates uneven vertical alignment and makes the UI feel unpolished.

  • The Icon component's source property only accepts values from the predefined IconSource set. Custom SVG icons, icon fonts, or external icon libraries aren't supported.
  • Custom pixel or percentage dimensions aren't supported for the size property. Use the accepted values listed in the size property description above.
  • The Icon component's color is determined by the appearance property. Custom colors or gradients aren't available.


ValueDescription
"accent"Conveys emphasis and draws attention to the element.
"interactive"Conveys that the element is pressable, hoverable or otherwise interactive.
"subdued"Conveys a subdued or disabled state for the element.
"info"Conveys that the element is informative or has information.
"success"Convey a successful interaction.
"warning"Convey something needs attention or an action needs to be taken.
"critical"Conveys a problem has arisen.
"monochrome"Takes the color of its parent.

Was this page helpful?