docs: added documentation for admin components (#9491)

- Documented common admin components with design that matches the admin.
- Updated existing admin customization snippets to match the admin's design.

Closes DOCS-964
This commit is contained in:
Shahed Nasser
2024-10-14 07:18:38 +00:00
committed by GitHub
parent e3dc9eaf0c
commit 74b286b701
22 changed files with 2385 additions and 241 deletions
@@ -24,12 +24,15 @@ For example, create the file `src/admin/widgets/product-widget.tsx` with the fol
```tsx title="src/admin/widgets/product-widget.tsx"
import { defineWidgetConfig } from "@medusajs/admin-sdk"
import { Container, Heading } from "@medusajs/ui"
const ProductWidget = () => {
return (
<div>
<h2>Product Widget</h2>
</div>
<Container className="divide-y p-0">
<div className="flex items-center justify-between px-6 py-4">
<Heading level="h2">Product Widget</Heading>
</div>
</Container>
)
}
@@ -42,6 +45,8 @@ export default ProductWidget
This inserts a widget with the text “Product Widget” at the beginning of a products details page.
In your widget, use custom components from the [Medusa UI package](https://docs.medusajs.com/ui).
### Test the Widget
To test out the widget, start the Medusa application:
@@ -51,3 +56,9 @@ npm run dev
```
Then, open a products details page in the Medusa Admin. Youll find your custom widget at the top of the page.
---
## Admin Components List
To build admin customizations that match the Medusa Admin's designs and layouts, refer to [this guide](!resources!/admin-component) to find common components.