Skip to content

Ahmad-shopify-dev/shopify-admin-ui-extension

Repository files navigation

Shopify Admin UI Extensions - Actions & Blocks

A practical demonstration of building Shopify Admin UI Extensions using the modern Admin Actions and Admin Blocks framework. This project shows how to extend the Shopify Admin interface to manage custom metadata (metafields) directly from the Product Details page.

🚀 Tech Stack

🔄 Project Flow

  1. Admin Block: An inline "Product Data" card on the Product Details page that lists custom "Posts" stored in a metafield.
  2. Admin Action: A modal-based form triggered from the "More actions" menu (or via navigation from the block) that allows users to create new "Posts".
  3. Data Sync: Both extensions interact with the same Shopify Metafield ($app:demo_info) to ensure real-time data consistency.
  4. Inter-Extension Navigation: Demonstration of using shopify.navigation to move the user from a Block to an Action modal.

🛠️ How to Use

  1. Clone the Repo:
    git clone <repo-url>
  2. Install Dependencies:
    npm install
  3. Connect to Shopify:
    npm run dev
  4. Deploy Extensions: Follow the CLI prompts to create a new app or link to an existing one. Ensure the shopify.extension.toml files are correctly configured.

📝 Examples

  • Reading Data: Using shopify.query to fetch product metafields directly within the extension sandbox.
  • Writing Data: Using GraphQL mutations to update metafield values with data validation logic.
  • Form Validation: Simple, pure JavaScript validation for title and description fields.

🔗 Important Documentation

For a deep dive into the architecture used here, refer to the official Shopify documentation:

📄 License

This project is Open Source and available for anyone to use and modify.

👨‍💻 Author

[StackWise Dev]
Free for learning and community growth.

About

A practical guide and template for building Shopify Admin UI Extensions. Features real-world examples of Admin Actions and Admin Blocks for managing product metafields using React Router 7 and the GraphQL Admin API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors