A Tag is used to help label, organize or categorize objects. It is commonly used in Checkout to display the discounts applied to a cart.
import {
reactExtension,
Tag,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return <Tag icon="discount">SPRING</Tag>;
}
import {extension, Tag} from '@shopify/ui-extensions/checkout';
export default extension('purchase.checkout.block.render', (root) => {
const tag = root.createComponent(Tag, {icon: 'discount'}, 'SPRING');
root.appendChild(tag);
});
Icon source
A label used for buyers using assistive technologies. When set, any `children` supplied to this component will not be announced to screen reader users.
Callback when tag is removed
A unique identifier for the component.
'arrowLeft' | 'arrowRight' | 'arrowUp' | 'arrowUpRight' | 'arrowDown' | 'bag' | 'calendar' | 'camera' | 'caretDown' | 'cart' | 'checkmark' | 'chevronLeft' | 'chevronRight' | 'chevronUp' | 'chevronDown' | 'clock' | 'close' | 'critical' | 'delete' | 'delivered' | 'delivery' | 'disabled' | 'discount' | 'email' | 'error' | 'errorFill' | 'external' | 'filter' | 'geolocation' | 'gift' | 'giftFill' | 'grid' | 'hamburger' | 'hollowCircle' | 'horizontalDots' | 'image' | 'info' | 'infoFill' | 'list' | 'lock' | 'magnify' | 'map' | 'marker' | 'minus' | 'mobile' | 'note' | 'orderBox' | 'pen' | 'plus' | 'profile' | 'question' | 'questionFill' | 'reorder' | 'return' | 'store' | 'success' | 'truck' | 'verticalDots' | 'warning' | 'warningFill'