Use this skill when the user asks about "React admin", "Polaris pages", "translations", "loadable components", "skeleton loading", "useFetchApi", "useCreateApi", "locale", "i18n", or any admin frontend development work. Provides React/Polaris patterns for the embedded admin app.
Admin Embedded App - Uses React + Shopify Polaris
For storefront widgets (customer-facing), see
scripttagskill
| Topic | Reference File |
|---|---|
| i18n, Translation Keys, yarn update-label | references/translations.md |
| useFetchApi, useCreateApi, useEditApi | references/api-hooks.md |
| ui-save-bar, Loading States |
| references/save-bar.md |
| Product/Collection Picker | references/resource-picker.md |
| New Page Checklist, Routes, Navigation | references/creating-pages.md |
packages/assets/src/
├── components/ # Reusable React components
├── pages/ # Page components with skeleton loading
├── loadables/ # Code-split components (organized in folders)
├── contexts/ # React contexts for state management
├── hooks/ # Custom React hooks (API, state)
├── services/ # API services calling admin endpoints
├── routes/ # Route definitions (routes.js)
└── locale/ # Translations
├── input/ # Source translation JSON files
└── output/ # Generated translated files
import {useTranslation} from 'react-i18next';
function MyPage() {
const {t} = useTranslation();
return <Page title={t('MyPage.title')}>{t('MyPage.subtitle')}</Page>;
}
// Fetch data
const {data, loading, fetchApi} = useFetchApi({
url: '/api/customers',
defaultData: [],
initLoad: true
});
// Create
const {creating, handleCreate} = useCreateApi({
url: '/api/customers',
successMsg: 'Created!',
successCallback: () => fetchApi()
});
function PageSkeleton() {
return (
<SkeletonPage primaryAction>
<Layout>
<Layout.Section>
<Card>
<SkeletonBodyText lines={5} />
</Card>
</Layout.Section>
</Layout>
</SkeletonPage>
);
}
// contexts/ShopContext.js
const ShopContext = createContext();
export function ShopProvider({ children }) {
const [shop, setShop] = useState(null);
return (
<ShopContext.Provider value={{ shop, setShop }}>
{children}
</ShopContext.Provider>
);
}
export const useShop = () => useContext(ShopContext);
.js files only (no .jsx)index.js# Start embedded app development
cd packages/assets && npm run watch:embed
# Start standalone development
cd packages/assets && npm run watch:standalone
# Production build
cd packages/assets && npm run production