|
1
|
--- |
|
2
|
sidebar_label: "Components" |
|
3
|
--- |
|
4
|
|
|
5
|
import { CardList } from "docs-ui" |
|
6
|
|
|
7
|
export const metadata = { |
|
8
|
title: `Components - Admin Components`, |
|
9
|
} |
|
10
|
|
|
11
|
# {metadata.title} |
|
12
|
|
|
13
|
<Note> |
|
14
|
|
|
15
|
These components are available since Medusa [v2.21.0](https://github.com/medusajs/medusa/releases/tag/v2.21.0). |
|
16
|
|
|
17
|
</Note> |
|
18
|
|
|
19
|
The `@medusajs/dashboard/components` subpath exports the React components that the Medusa Admin uses to build its pages. Use them in your [widgets](!docs!/learn/fundamentals/admin/widgets) and [UI routes](!docs!/learn/fundamentals/admin/ui-routes) to match the Medusa Admin's design conventions without re-implementing the components. |
|
20
|
|
|
21
|
```tsx |
|
22
|
import { |
|
23
|
ActionMenu, |
|
24
|
SectionRow, |
|
25
|
} from "@medusajs/dashboard/components" |
|
26
|
``` |
|
27
|
|
|
28
|
<Note title="Tip"> |
|
29
|
|
|
30
|
These components build on the [Medusa UI package](!ui!). Refer to the [Medusa UI documentation](!ui!) for the underlying primitives, such as buttons and inputs. |
|
31
|
|
|
32
|
</Note> |
|
33
|
|
|
34
|
--- |
|
35
|
|
|
36
|
## Layout Components |
|
37
|
|
|
38
|
<CardList items={[ |
|
39
|
{ |
|
40
|
title: "LayoutComposer", |
|
41
|
href: "/admin-components/layouts/layout-composer", |
|
42
|
}, |
|
43
|
]} /> |
|
44
|
|
|
45
|
--- |
|
46
|
|
|
47
|
## Common Components |
|
48
|
|
|
49
|
<CardList items={[ |
|
50
|
{ |
|
51
|
title: "ActionMenu", |
|
52
|
href: "/admin-components/components/action-menu", |
|
53
|
}, |
|
54
|
{ |
|
55
|
title: "ConditionalTooltip", |
|
56
|
href: "/admin-components/components/conditional-tooltip", |
|
57
|
}, |
|
58
|
{ |
|
59
|
title: "DisplayId", |
|
60
|
href: "/admin-components/components/display-id", |
|
61
|
}, |
|
62
|
{ |
|
63
|
title: "Empty States", |
|
64
|
href: "/admin-components/components/empty-states", |
|
65
|
}, |
|
66
|
{ |
|
67
|
title: "IconAvatar", |
|
68
|
href: "/admin-components/components/icon-avatar", |
|
69
|
}, |
|
70
|
{ |
|
71
|
title: "JsonViewSection", |
|
72
|
href: "/admin-components/components/json-view-section", |
|
73
|
}, |
|
74
|
{ |
|
75
|
title: "Listicle", |
|
76
|
href: "/admin-components/components/listicle", |
|
77
|
}, |
|
78
|
{ |
|
79
|
title: "SectionRow", |
|
80
|
href: "/admin-components/components/section-row", |
|
81
|
}, |
|
82
|
{ |
|
83
|
title: "Thumbnail", |
|
84
|
href: "/admin-components/components/thumbnail", |
|
85
|
}, |
|
86
|
]} /> |
|
87
|
|
|
88
|
--- |
|
89
|
|
|
90
|
## Form and Input Components |
|
91
|
|
|
92
|
<CardList items={[ |
|
93
|
{ |
|
94
|
title: "KeyboundForm", |
|
95
|
href: "/admin-components/components/keybound-form", |
|
96
|
}, |
|
97
|
{ |
|
98
|
title: "Combobox", |
|
99
|
href: "/admin-components/components/combobox", |
|
100
|
}, |
|
101
|
{ |
|
102
|
title: "CountrySelect", |
|
103
|
href: "/admin-components/components/country-select", |
|
104
|
}, |
|
105
|
{ |
|
106
|
title: "HandleInput", |
|
107
|
href: "/admin-components/components/handle-input", |
|
108
|
}, |
|
109
|
]} className="mb-1" /> |
|
110
|
|
|
111
|
Refer to the [Forms guide](../guides/forms/page.mdx) to build create and edit forms with the `Form` component. |
|
112
|
|
|
113
|
--- |
|
114
|
|
|
115
|
## Modal Components |
|
116
|
|
|
117
|
Use these components to build modals in UI routes that Medusa opens as a route. When the user closes the modal, Medusa navigates back to the previous route. |
|
118
|
|
|
119
|
<CardList items={[ |
|
120
|
{ |
|
121
|
title: "RouteDrawer", |
|
122
|
href: "/admin-components/components/route-drawer", |
|
123
|
}, |
|
124
|
{ |
|
125
|
title: "RouteFocusModal", |
|
126
|
href: "/admin-components/components/route-focus-modal", |
|
127
|
}, |
|
128
|
{ |
|
129
|
title: "StackedDrawer", |
|
130
|
href: "/admin-components/components/stacked-drawer", |
|
131
|
}, |
|
132
|
{ |
|
133
|
title: "StackedFocusModal", |
|
134
|
href: "/admin-components/components/stacked-focus-modal", |
|
135
|
}, |
|
136
|
]} /> |
|
137
|
|
|
138
|
--- |
|
139
|
|
|
140
|
## Table Components |
|
141
|
|
|
142
|
<CardList items={[ |
|
143
|
{ |
|
144
|
title: "ConfigurableDataTable", |
|
145
|
href: "/admin-components/components/configurable-data-table", |
|
146
|
}, |
|
147
|
{ |
|
148
|
title: "DataGrid", |
|
149
|
href: "/admin-components/components/data-grid", |
|
150
|
}, |
|
151
|
{ |
|
152
|
title: "Product Table Cells", |
|
153
|
href: "/admin-components/components/product-table-cells", |
|
154
|
}, |
|
155
|
]} /> |