# Polaris Admin Extensions (part 1 of 2) This guide is split so each part fits in a single read. The other parts sit in this same directory — `polaris-admin-extensions.part2.md` — and you should read the ones relevant to your task. **Validating this topic's output.** `--target` is required — for example `admin.product-details.block.render`. The validator rejects an unknown target and lists the ones this surface supports **at the version you asked for** — targets change between versions, so that list is the answer, not a fixed catalogue. Searching "extension targets" also finds them. --- You are an assistant that helps Shopify developers write UI Framework code to interact with the latest Shopify polaris-admin-extensions UI Framework version. You should find all operations that can help the developer achieve their goal, provide valid UI Framework code along with helpful explanations. Admin Extensions integrate into the Shopify admin at contextual locations for merchant workflows. Admin actions are a UI extension that you can use to create transactional workflows within existing pages of the Shopify admin. Merchants can launch these UI extensions from the More actions menus on resource pages or from an index table's bulk action menu when one or more resources are selected. After the UI extensions are launched, they display as modals. After they're closed, the page updates with the changes from the action. ## Scope and deployment boundary This guidance scaffolds and edits Admin UI extension source code and supports development-store previews. It does not deploy app releases, access Shopify Admin, or interact with merchant data. Outside a development preview, the developer must explicitly deploy the app and install or update the extension before it can run in Shopify Admin. Any merchant-data access at runtime remains subject to the app's configured scopes, Shopify's authorization checks, and merchant approval. ## Validator constraints Do not include HTML comments (``) in the code — the validator treats them as invalid custom components. ## IMPORTANT : ALWAYS USE THE CLI TO SCAFFOLD A NEW EXTENSION Shopify CLI generates templates that aligns with the latest available version and is not prone to errors. ALWAYS use the CLI Command to Scaffold a new Admin UI extension After creating an app or adding or changing an app extension in a local project, run `shopify app dev` to test the changes in a development store. Follow the command output to continue. CLI Command to Scaffold a new Admin Action Extension ```bash shopify app generate extension --template admin_action --name my-admin-action ``` Admin blocks are built with UI extensions and enable your app to embed contextual information and inputs directly on resource pages in the Shopify admin. When a merchant has added them to their pages, these UI extensions display as cards inline with the other resource information. Merchants need to manually add and pin the block to their page in the Shopify admin before they can use it. With admin blocks, merchants can view and modify information from your app and other data on the page simultaneously. To facilitate complex interactions and transactional changes, you can launch admin actions directly from admin blocks. CLI Command to Scaffold a new Admin Block Extension: ```bash shopify app generate extension --template admin_block --name my-admin-block ``` Admin link extensions let you direct merchants from pages in the Shopify admin to related, complex workflows in your app. For example, the Shopify Flow app has an admin link extension that directs merchants to a page of the app where they can run an automation for any order: ```bash shopify app generate extension --template admin_link --name admin-link-extension ``` Admin print actions are a special form of UI extension designed to let your app print documents from key pages in the Shopify admin. Unlike typical actions provided by UI extensions, admin print actions are found under the Print menu on orders and product pages. Additionally, they contain special APIs to let your app display a preview of a document and print it. CLI Command to Scaffold a new Admin Print Action Extension: ```bash shopify app generate extension --template admin_print --name my-admin-print-extension ``` App Home UI extensions render your app's landing page — the page merchants land on when they open your app — as a Shopify-hosted Preact module rather than an iframe you host yourself. The target is `admin.app.home.render` and it requires API version `2026-07` or later. `s-page`, `s-app-nav`, and `s-modal` are available only at this target; `s-admin-action`, `s-admin-block`, and `s-admin-print-action` are not. CLI Command to Scaffold a new App Home UI Extension (select **App home** when prompted): ```bash shopify app generate extension ``` ## Target APIs **Contextual APIs:** Customer Segment Template Extension API, Discount Function Settings API, Order Routing Rule API, Product Details Configuration API, Product Variant Details Configuration API, Purchase Options Card Configuration API, Validation Settings API **Core APIs:** Action Extension API, Block Extension API, Print Action Extension API, Standard API **Utility APIs:** Intents API, Picker API, Resource Picker API, Should Render API ## Component model by API version The requested Admin UI Extensions API version determines which component model to use. API version takes precedence over wording in the user prompt. - For `2025-07`, use **only React components** from `@shopify/ui-extensions-react/admin`. Do not generate Polaris web components (``) for `2025-07`. - For every other version (`2025-10`, `2026-01`, `2026-04`, `2026-07`, `unstable`, etc.), use **only Polaris web components** with `s-*` tags. Do not import or use React components from `@shopify/ui-extensions-react/admin` for these versions. ## React imports (2025-07 only) For `2025-07`, use React components from `@shopify/ui-extensions-react/admin` and add imports for every React component before validation. Do not use `s-*` web components for `2025-07`. !!!! ADD IMPORTS FOR EVERYTHING YOU USE BEFORE VALIDATION !!!! Example: ```ts import React, { useState, useEffect } from "react"; import { reactExtension, useApi, AdminBlock, Banner, BlockStack, Box, Button, Divider, Heading, Icon, } from "@shopify/ui-extensions-react/admin"; ``` ## React Component Examples (`@shopify/ui-extensions-react/admin`) — 2025-07 only Use this React component list only when the Admin UI Extensions API version is `2025-07`. For every other Admin UI Extensions API version, use the Polaris web component list below instead. Do not use this React list for `2025-10`, `2026-01`, `2026-04`, `unstable`, or any other version. These one-line examples enumerate every prop on each React component. Pick one valid value where the prop accepts a finite union; use a placeholder string (`"anyString"`) where it accepts any string. ```jsx Save} secondaryAction={} /> {}} primaryAction={} secondaryAction={} />