- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Container - Admin Components
The Medusa Admin wraps each section of a page in a container.
To create a component that uses the same container styling in your widgets or UI routes, create the file src/admin/components/container.tsx
with the following content:
The Container
component re-uses the component from the Medusa UI package and applies to it classes to match the Medusa Admin's design conventions.
Example#
Use that Container
component in any widget or UI route.
For example, create the widget src/admin/widgets/product-widget.tsx
with the following content:
1import { defineWidgetConfig } from "@medusajs/admin-sdk"2import { Container } from "../components/container"3import { Header } from "../components/header"4 5const ProductWidget = () => {6 return (7 <Container>8 <Header title="Product Widget" />9 </Container>10 )11}12 13export const config = defineWidgetConfig({14 zone: "product.details.before",15})16 17export default ProductWidget
This widget also uses a Header custom component.
Was this page helpful?