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);
});
A label used for buyers using assistive technologies. When set, any `children` supplied to this component will not be announced to screen reader users.
Icon source
A unique identifier for the component.
Callback when tag is removed
'arrowLeft' | 'arrowRight' | 'arrowUp' | 'arrowUpRight' | 'arrowDown' | 'bag' | 'bullet' | 'calendar' | 'camera' | 'caretDown' | 'cart' | 'cashDollar' | 'categories' | 'checkmark' | 'chevronLeft' | 'chevronRight' | 'chevronUp' | 'chevronDown' | 'clipboard' | 'clock' | 'close' | 'creditCard' | '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' | 'reset' | 'return' | 'savings' | 'settings' | 'star' | 'starFill' | 'starHalf' | 'store' | 'success' | 'truck' | 'upload' | 'verticalDots' | 'warning' | 'warningFill'