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 graphic symbols to visually communicate actions, status, and navigation throughout the interface. Use Icon to reinforce button actions, indicate status states, or provide wayfinding cues that help customers understand available functionality.

Icons support multiple sizes, appearances for semantic meaning, and can be integrated with other components like Button and Badge to enhance visual communication.

Support
Targets (25)

Configure the following properties on the Icon component.

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.

Render a graphic symbol from the built-in icon set. This example displays a single discount icon at its default size.

Display an icon

A discount icon rendered at its default size.

Display an icon

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

export default reactExtension(
'customer-account.page.render',
() => <Extension />,
);

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

export default extension('customer-account.page.render', (root) => {
const icon = root.createComponent(Icon, {source: 'discount'});

root.appendChild(icon);
});

Anchor to Apply semantic appearancesApply semantic appearances

Communicate status through color-coded icons. This example pairs success, warning, and critical appearances with status messages so customers can quickly identify the state of each item.

Apply semantic appearances

import {
reactExtension,
Icon,
Text,
InlineStack,
BlockStack,
} from '@shopify/ui-extensions-react/customer-account';

export default reactExtension(
'customer-account.page.render',
() => <Extension />,
);

function Extension() {
return (
<BlockStack spacing="base">
<InlineStack spacing="small">
<Icon source="checkCircle" appearance="success" />
<Text>Order confirmed</Text>
</InlineStack>
<InlineStack spacing="small">
<Icon source="warning" appearance="warning" />
<Text>Address needs review</Text>
</InlineStack>
<InlineStack spacing="small">
<Icon source="error" appearance="critical" />
<Text>Payment failed</Text>
</InlineStack>
</BlockStack>
);
}
import {extension, Icon, Text, InlineStack, BlockStack} from '@shopify/ui-extensions/customer-account';

export default extension('customer-account.page.render', (root) => {
function createRow(iconSource, appearance, label) {
const icon = root.createComponent(Icon, {source: iconSource, appearance});
const text = root.createComponent(Text, {}, label);
const row = root.createComponent(InlineStack, {spacing: 'small'});
row.append(icon);
row.append(text);
return row;
}

const stack = root.createComponent(BlockStack, {spacing: 'base'});
stack.append(createRow('checkCircle', 'success', 'Order confirmed'));
stack.append(createRow('warning', 'warning', 'Address needs review'));
stack.append(createRow('error', 'critical', 'Payment failed'));

root.append(stack);
});

Anchor to Pair icons with text labelsPair icons with text labels

Combine icons with text labels to reinforce meaning. This example shows fulfillment options with matching icons so customers can scan the list quickly.

Pair icons with text labels

import {
reactExtension,
Icon,
Text,
InlineStack,
BlockStack,
} from '@shopify/ui-extensions-react/customer-account';

export default reactExtension(
'customer-account.page.render',
() => <Extension />,
);

function Extension() {
return (
<BlockStack spacing="base">
<InlineStack spacing="small">
<Icon source="store" />
<Text>Store pickup</Text>
</InlineStack>
<InlineStack spacing="small">
<Icon source="delivery" />
<Text>Standard shipping</Text>
</InlineStack>
<InlineStack spacing="small">
<Icon source="return" />
<Text>Free returns</Text>
</InlineStack>
</BlockStack>
);
}
import {extension, Icon, Text, InlineStack, BlockStack} from '@shopify/ui-extensions/customer-account';

export default extension('customer-account.page.render', (root) => {
function createRow(iconSource, label) {
const icon = root.createComponent(Icon, {source: iconSource});
const text = root.createComponent(Text, {}, label);
const row = root.createComponent(InlineStack, {spacing: 'small'});
row.append(icon);
row.append(text);
return row;
}

const stack = root.createComponent(BlockStack, {spacing: 'base'});
stack.append(createRow('store', 'Store pickup'));
stack.append(createRow('delivery', 'Standard shipping'));
stack.append(createRow('return', 'Free returns'));

root.append(stack);
});

Adjust icon prominence with the size property. This example displays the same search icon at extraSmall, small, base, and large sizes side by side.

Compare icon sizes

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

export default reactExtension(
'customer-account.page.render',
() => <Extension />,
);

function Extension() {
return (
<InlineStack spacing="base" blockAlignment="center">
<Icon source="search" size="extraSmall" accessibilityLabel="Extra small search icon" />
<Icon source="search" size="small" accessibilityLabel="Small search icon" />
<Icon source="search" size="base" accessibilityLabel="Base search icon" />
<Icon source="search" size="large" accessibilityLabel="Large search icon" />
</InlineStack>
);
}
import {extension, Icon, InlineStack} from '@shopify/ui-extensions/customer-account';

export default extension('customer-account.page.render', (root) => {
const row = root.createComponent(InlineStack, {spacing: 'base', blockAlignment: 'center'});

['extraSmall', 'small', 'base', 'large'].forEach((size) => {
row.append(root.createComponent(Icon, {
source: 'search',
size,
accessibilityLabel: `${size} search icon`,
}));
});

root.append(row);
});

  • Use icons to support actions and status, not decorate: Icons should clarify what an action does or indicate state. Use a trash icon for delete actions, a checkmark for completed status, or a warning icon for errors. Avoid adding icons purely for visual interest.
  • 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 customers.
  • Pair icons with text labels whenever possible: Icons work best as visual reinforcement alongside text. Without text, even common icons can be ambiguous. Only use icons alone in space-constrained contexts with proper accessibility labels.
  • Use semantic appearances to communicate meaning: Apply appearances like critical for destructive actions, success for positive states, and warning for caution. Appearances should convey information, not serve as decoration.

  • Icons are limited to the predefined set provided by the component. Custom SVG icons, icon fonts, or external icon libraries aren't supported.
  • Icons can't be animated or include interactive states beyond color changes. For complex graphics or illustrations, use the Image component instead.
  • Icon color is determined by the appearance property. Custom colors or gradients aren't available.

Was this page helpful?