
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
@shopify/ui-extensions-react
Advanced tools
@shopify/ui-extensions-react
This package contains the public type definitions and utilities needed to create a Shopify UI extension with React. This is a generalized package that is intended to be the long-term home of the surface-specific UI extension packages, like @shopify/checkout-ui-extensions-react
and @shopify/admin-ui-extensions-react
.
Is your extension currently using
@shopify/checkout-ui-extensions-react
? You can learn what you need to do to upgrade to this API versioned package in the migration guide.
Currently, this package only contains the extension APIs for the checkout
surface, but other Shopify surfaces will be added here soon.
All extensions, regardless of where they appear in Shopify, make use of the same underlying technology, and most of the same βcoreβ components (e.g., BlockStack
, Button
, TextField
, etc) and capabilities (e.g., direct API access, session tokens). Separating APIs by surface makes it easier for a developer to see what is available to them in each context, and gives us a flexible system for introducing components and APIs available in only some areas of Shopify.
A checkout extension using React would be written as follows:
import {useState} from 'react';
import {
reactExtension,
useApi,
TextField,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension('purchase.checkout.block.render', () => (
<GiftNote />
));
function GiftNote() {
const {i18n, metafields, applyMetafieldChange} = useApi();
const [value, setValue] = useState(() => {
const metafield = metafields.current.find(
(metafield) =>
metafield.namespace === 'custom' && metafield.key === 'gift_note',
);
return metafield?.value ?? '';
});
return (
<TextField
label={i18n.translate('gift_note.label')}
value={value}
onChange={(value) => {
setValue(value);
applyMetafieldChange({
namespace: 'custom',
key: 'gift_note',
value,
valueType: 'string',
});
}}
/>
);
}
FAQs
React bindings for @shopify/ui-extensions
The npm package @shopify/ui-extensions-react receives a total of 30,391 weekly downloads. As such, @shopify/ui-extensions-react popularity was classified as popular.
We found that @shopify/ui-extensions-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.