Skip to content

Commit 8d4631a

Browse files
committed
docs: move codeblocks to code.mdx
1 parent 829a997 commit 8d4631a

File tree

2 files changed

+76
-118
lines changed

2 files changed

+76
-118
lines changed

src/collections/sistent/components/table/code.mdx

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,33 @@ Basic tables are used to display simple structured data.
4444
</div>
4545
</div>
4646

47+
<CodeBlock>
48+
49+
```jsx
50+
<TableContainer>
51+
<Table>
52+
<TableHead>
53+
<TableRow>
54+
<TableCell>Name</TableCell>
55+
<TableCell>Role</TableCell>
56+
<TableCell>Status</TableCell>
57+
</TableRow>
58+
</TableHead>
59+
<TableBody>
60+
<TableRow>
61+
<TableCell>User 1</TableCell>
62+
<TableCell>Contributor</TableCell>
63+
<TableCell>Active</TableCell>
64+
</TableRow>
65+
</TableBody>
66+
</Table>
67+
</TableContainer>
68+
```
69+
70+
</CodeBlock>
71+
72+
---
73+
4774
<a id="Striped Table">
4875
<h2>Striped Table</h2>
4976
</a>
@@ -71,6 +98,31 @@ Striped tables improve readability by alternating row colors.
7198
</div>
7299
</div>
73100

101+
<CodeBlock>
102+
103+
```jsx
104+
<TableContainer>
105+
<Table striped>
106+
<TableHead>
107+
<TableRow>
108+
<TableCell>Name</TableCell>
109+
<TableCell>Role</TableCell>
110+
</TableRow>
111+
</TableHead>
112+
<TableBody>
113+
<TableRow>
114+
<TableCell>User 1</TableCell>
115+
<TableCell>Contributor</TableCell>
116+
</TableRow>
117+
</TableBody>
118+
</Table>
119+
</TableContainer>
120+
```
121+
122+
</CodeBlock>
123+
124+
---
125+
74126
<a id="Compact Table">
75127
<h2>Compact Table</h2>
76128
</a>
@@ -96,4 +148,27 @@ Compact tables are useful when displaying dense data.
96148
</Table>
97149
</TableContainer>
98150
</div>
99-
</div>
151+
</div>
152+
153+
<CodeBlock>
154+
155+
```jsx
156+
<TableContainer>
157+
<Table size="small">
158+
<TableHead>
159+
<TableRow>
160+
<TableCell>Name</TableCell>
161+
<TableCell>Role</TableCell>
162+
</TableRow>
163+
</TableHead>
164+
<TableBody>
165+
<TableRow>
166+
<TableCell>User 1</TableCell>
167+
<TableCell>Contributor</TableCell>
168+
</TableRow>
169+
</TableBody>
170+
</Table>
171+
</TableContainer>
172+
```
173+
174+
</CodeBlock>

src/collections/sistent/components/table/index.mdx

Lines changed: 0 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,6 @@ Tables should be used when:
5757
</Table>
5858
</TableContainer>
5959

60-
<CodeBlock>
61-
62-
```jsx
63-
<TableContainer>
64-
<Table>
65-
<TableHead>
66-
<TableRow>
67-
<TableCell>Name</TableCell>
68-
<TableCell>Role</TableCell>
69-
<TableCell>Status</TableCell>
70-
</TableRow>
71-
</TableHead>
72-
<TableBody>
73-
<TableRow>
74-
<TableCell>User 1</TableCell>
75-
<TableCell>Contributor</TableCell>
76-
<TableCell>Active</TableCell>
77-
</TableRow>
78-
</TableBody>
79-
</Table>
80-
</TableContainer>
81-
```
82-
83-
</CodeBlock>
84-
8560
---
8661

8762
### Striped Table
@@ -103,29 +78,6 @@ Tables should be used when:
10378
</Table>
10479
</TableContainer>
10580

106-
<CodeBlock>
107-
108-
```jsx
109-
<TableContainer>
110-
<Table striped>
111-
<TableHead>
112-
<TableRow>
113-
<TableCell>Name</TableCell>
114-
<TableCell>Role</TableCell>
115-
</TableRow>
116-
</TableHead>
117-
<TableBody>
118-
<TableRow>
119-
<TableCell>User 1</TableCell>
120-
<TableCell>Contributor</TableCell>
121-
</TableRow>
122-
</TableBody>
123-
</Table>
124-
</TableContainer>
125-
```
126-
127-
</CodeBlock>
128-
12981
---
13082

13183
## States
@@ -149,29 +101,6 @@ Tables should be used when:
149101
</Table>
150102
</TableContainer>
151103

152-
<CodeBlock>
153-
154-
```jsx
155-
<TableContainer>
156-
<Table>
157-
<TableHead>
158-
<TableRow>
159-
<TableCell>Name</TableCell>
160-
<TableCell>Role</TableCell>
161-
</TableRow>
162-
</TableHead>
163-
<TableBody>
164-
<TableRow>
165-
<TableCell>User 1</TableCell>
166-
<TableCell>Contributor</TableCell>
167-
</TableRow>
168-
</TableBody>
169-
</Table>
170-
</TableContainer>
171-
```
172-
173-
</CodeBlock>
174-
175104
---
176105

177106
### Selectable Rows
@@ -193,29 +122,6 @@ Tables should be used when:
193122
</Table>
194123
</TableContainer>
195124

196-
<CodeBlock>
197-
198-
```jsx
199-
<TableContainer>
200-
<Table>
201-
<TableHead>
202-
<TableRow>
203-
<TableCell>Name</TableCell>
204-
<TableCell>Role</TableCell>
205-
</TableRow>
206-
</TableHead>
207-
<TableBody>
208-
<TableRow>
209-
<TableCell>User 1</TableCell>
210-
<TableCell>Contributor</TableCell>
211-
</TableRow>
212-
</TableBody>
213-
</Table>
214-
</TableContainer>
215-
```
216-
217-
</CodeBlock>
218-
219125
---
220126

221127
### Paginated Table
@@ -237,29 +143,6 @@ Tables should be used when:
237143
</Table>
238144
</TableContainer>
239145

240-
<CodeBlock>
241-
242-
```jsx
243-
<TableContainer>
244-
<Table>
245-
<TableHead>
246-
<TableRow>
247-
<TableCell>Name</TableCell>
248-
<TableCell>Role</TableCell>
249-
</TableRow>
250-
</TableHead>
251-
<TableBody>
252-
<TableRow>
253-
<TableCell>User 1</TableCell>
254-
<TableCell>Contributor</TableCell>
255-
</TableRow>
256-
</TableBody>
257-
</Table>
258-
</TableContainer>
259-
```
260-
261-
</CodeBlock>
262-
263146
---
264147

265148
## Best Practices

0 commit comments

Comments
 (0)