|
1
|
--- |
|
2
|
generate_toc: true |
|
3
|
--- |
|
4
|
|
|
5
|
import { ComponentExample } from "@/components/ComponentExample" |
|
6
|
import { ComponentReference } from "@/components/ComponentReference" |
|
7
|
|
|
8
|
export const metadata = { |
|
9
|
title: `Table`, |
|
10
|
} |
|
11
|
|
|
12
|
# {metadata.title} |
|
13
|
|
|
14
|
A component that displays data in a structured table format. |
|
15
|
|
|
16
|
In this guide, you'll learn how to use the Table component. |
|
17
|
|
|
18
|
<Note> |
|
19
|
|
|
20
|
If you're looking to add a table to your Medusa Admin customizations with advanced features like filters, search, sorting, and bulk actions, refer to the [DataTable](../data-table/page.mdx) component instead. |
|
21
|
|
|
22
|
</Note> |
|
23
|
|
|
24
|
<ComponentExample name="table-demo" /> |
|
25
|
|
|
26
|
## Usage |
|
27
|
|
|
28
|
```tsx |
|
29
|
import { Table } from "@medusajs/ui" |
|
30
|
``` |
|
31
|
|
|
32
|
```tsx |
|
33
|
<Table> |
|
34
|
<Table.Header> |
|
35
|
<Table.Row> |
|
36
|
<Table.HeaderCell> |
|
37
|
# |
|
38
|
</Table.HeaderCell> |
|
39
|
<Table.HeaderCell> |
|
40
|
Customer |
|
41
|
</Table.HeaderCell> |
|
42
|
<Table.HeaderCell> |
|
43
|
Email |
|
44
|
</Table.HeaderCell> |
|
45
|
</Table.Row> |
|
46
|
</Table.Header> |
|
47
|
<Table.Body> |
|
48
|
<Table.Row> |
|
49
|
<Table.Cell>1</Table.Cell> |
|
50
|
<Table.Cell>Emil Larsson</Table.Cell> |
|
51
|
<Table.Cell>emil2738@gmail.com</Table.Cell> |
|
52
|
</Table.Row> |
|
53
|
</Table.Body> |
|
54
|
</Table> |
|
55
|
``` |
|
56
|
|
|
57
|
--- |
|
58
|
|
|
59
|
## API Reference |
|
60
|
|
|
61
|
<ComponentReference mainComponent="Table" componentsToShow={[ |
|
62
|
"Table", |
|
63
|
"Table.Pagination" |
|
64
|
]} /> |
|
65
|
|
|
66
|
--- |
|
67
|
|
|
68
|
## Examples |
|
69
|
|
|
70
|
### Table with Pagination |
|
71
|
|
|
72
|
<ComponentExample name="table-pagination" hideFeedback /> |