/ src / admin / README.md
README.md
 1  # Admin Customizations
 2  
 3  You can extend the Medusa Admin to add widgets and new pages. Your customizations interact with API routes to provide merchants with custom functionalities.
 4  
 5  > Learn more about Admin Extensions in [this documentation](https://docs.medusajs.com/learn/fundamentals/admin).
 6  
 7  ## Example: Create a Widget
 8  
 9  A widget is a React component that can be injected into an existing page in the admin dashboard.
10  
11  For example, create the file `src/admin/widgets/product-widget.tsx` with the following content:
12  
13  ```tsx title="src/admin/widgets/product-widget.tsx"
14  import { defineWidgetConfig } from "@medusajs/admin-sdk"
15  
16  // The widget
17  const ProductWidget = () => {
18    return (
19      <div>
20        <h2>Product Widget</h2>
21      </div>
22    )
23  }
24  
25  // The widget's configurations
26  export const config = defineWidgetConfig({
27    zone: "product.details.after",
28  })
29  
30  export default ProductWidget
31  ```
32  
33  This inserts a widget with the text “Product Widget” at the end of a product’s details page.