tabler-react-2 0.1.76 → 0.1.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/badge/index.js +3 -4
- package/dist/breadcrumb/index.js +2 -1
- package/dist/button/index.js +2 -1
- package/dist/steps/index.js +3 -4
- package/dist/util/flex.js +6 -3
- package/docs/LICENSE +21 -0
- package/docs/README.md +61 -0
- package/docs/gatsby-config.js +54 -0
- package/docs/package-lock.json +23315 -0
- package/docs/package.json +36 -0
- package/docs/src/@rocketseat/gatsby-theme-docs/components/Logo.js +31 -0
- package/docs/src/components/ColorSwatch.jsx +22 -0
- package/docs/src/components/Excerpt.jsx +28 -0
- package/docs/src/components/Margin.jsx +13 -0
- package/docs/src/components/Tabler.jsx +48 -0
- package/docs/src/config/sidebar.yml +36 -0
- package/docs/src/docs/components/alerts.mdx +105 -0
- package/docs/src/docs/components/avatar.mdx +259 -0
- package/docs/src/docs/components/badges.mdx +190 -0
- package/docs/src/docs/components/cards.mdx +245 -0
- package/docs/src/docs/components/hr.mdx +68 -0
- package/docs/src/docs/components/typography.mdx +173 -0
- package/docs/src/docs/faq.mdx +35 -0
- package/docs/src/docs/getting-started.mdx +79 -0
- package/docs/src/docs/todo.md +5 -0
- package/docs/src/docs/utilities/colors.mdx +114 -0
- package/docs/src/docs/utilities/margins.mdx +90 -0
- package/docs/src/home/index.mdx +23 -0
- package/docs/src/pages/404.js +18 -0
- package/docs/src/yamlFiles/letters.yml +3 -0
- package/docs/static/banner.png +0 -0
- package/docs/static/favicon.png +0 -0
- package/docs/static/tabler.replaced.css +23191 -0
- package/package.json +1 -1
- /package/{docs → static-docs}/assets/index-BGz0WjR_.css +0 -0
- /package/{docs → static-docs}/assets/index-BzTYsikY.js +0 -0
- /package/{docs → static-docs}/index.html +0 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Badges
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { Badge } from "tabler-react-2";
|
|
6
|
+
import { Excerpt } from "../../components/Excerpt.jsx";
|
|
7
|
+
|
|
8
|
+
Badges are used to display a small label.
|
|
9
|
+
|
|
10
|
+
## Signature
|
|
11
|
+
|
|
12
|
+
```jsx
|
|
13
|
+
import { Badge } from "tabler-react-2";
|
|
14
|
+
|
|
15
|
+
<Badge {...props}>{children}</Badge>;
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Props
|
|
19
|
+
|
|
20
|
+
| Prop | Required | Type | Default | Description |
|
|
21
|
+
| --------- | -------- | -------------------------- | ------- | ------------------------------------- |
|
|
22
|
+
| `color` | No | [Color](/utilities/colors) | | The color of the badge. |
|
|
23
|
+
| `outline` | No | Boolean | | Whether the badge should be outlined. |
|
|
24
|
+
| `soft` | No | Boolean | | Whether the badge should be soft. |
|
|
25
|
+
|
|
26
|
+
## Basic Usage
|
|
27
|
+
|
|
28
|
+
The `Badge` component is used to display a badge.
|
|
29
|
+
|
|
30
|
+
<Excerpt>
|
|
31
|
+
<Badge>Badge</Badge>
|
|
32
|
+
</Excerpt>
|
|
33
|
+
|
|
34
|
+
```jsx
|
|
35
|
+
<Badge>Badge</Badge>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Colors
|
|
39
|
+
|
|
40
|
+
Badges can be colored using the `color` prop. The `color` prop accepts a string value of any [color](/utilities/colors).
|
|
41
|
+
|
|
42
|
+
<Excerpt>
|
|
43
|
+
<div
|
|
44
|
+
style={{
|
|
45
|
+
display: "flex",
|
|
46
|
+
flexDirection: "row",
|
|
47
|
+
gap: 10,
|
|
48
|
+
flexWrap: "wrap",
|
|
49
|
+
alignItems: "center",
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
{[
|
|
53
|
+
"primary",
|
|
54
|
+
"secondary",
|
|
55
|
+
"success",
|
|
56
|
+
"danger",
|
|
57
|
+
"warning",
|
|
58
|
+
"info",
|
|
59
|
+
"dark",
|
|
60
|
+
"blue",
|
|
61
|
+
"azure",
|
|
62
|
+
"indigo",
|
|
63
|
+
"purple",
|
|
64
|
+
"pink",
|
|
65
|
+
"red",
|
|
66
|
+
"orange",
|
|
67
|
+
"yellow",
|
|
68
|
+
"lime",
|
|
69
|
+
"green",
|
|
70
|
+
"teal",
|
|
71
|
+
"cyan",
|
|
72
|
+
].map((color) => (
|
|
73
|
+
<Badge key={color} color={color}>
|
|
74
|
+
{color}
|
|
75
|
+
</Badge>
|
|
76
|
+
))}
|
|
77
|
+
</div>
|
|
78
|
+
</Excerpt>
|
|
79
|
+
|
|
80
|
+
```jsx
|
|
81
|
+
<Badge color="primary">primary</Badge>
|
|
82
|
+
<Badge color="secondary">secondary</Badge>
|
|
83
|
+
<Badge color="success">success</Badge>
|
|
84
|
+
<Badge color="danger">danger</Badge>
|
|
85
|
+
<Badge color="warning">warning</Badge>
|
|
86
|
+
<Badge color="info">info</Badge>
|
|
87
|
+
<Badge color="dark">dark</Badge>
|
|
88
|
+
<Badge color="blue">blue</Badge>
|
|
89
|
+
<Badge color="azure">azure</Badge>
|
|
90
|
+
<Badge color="indigo">indigo</Badge>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Outline
|
|
94
|
+
|
|
95
|
+
Badges can be outlined using the `outline` prop. The `outline` prop accepts a boolean value.
|
|
96
|
+
|
|
97
|
+
<Excerpt>
|
|
98
|
+
<div
|
|
99
|
+
style={{
|
|
100
|
+
display: "flex",
|
|
101
|
+
flexDirection: "row",
|
|
102
|
+
gap: 10,
|
|
103
|
+
flexWrap: "wrap",
|
|
104
|
+
alignItems: "center",
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
{["primary", "secondary", "success", "danger", "warning", "info"].map(
|
|
108
|
+
(color) => (
|
|
109
|
+
<Badge key={color} color={color} outline>
|
|
110
|
+
{color}
|
|
111
|
+
</Badge>
|
|
112
|
+
)
|
|
113
|
+
)}
|
|
114
|
+
</div>
|
|
115
|
+
</Excerpt>
|
|
116
|
+
|
|
117
|
+
```jsx
|
|
118
|
+
<Badge color="primary" outline>primary</Badge>
|
|
119
|
+
<Badge color="secondary" outline>secondary</Badge>
|
|
120
|
+
<Badge color="success" outline>success</Badge>
|
|
121
|
+
<Badge color="danger" outline>danger</Badge>
|
|
122
|
+
<Badge color="warning" outline>warning</Badge>
|
|
123
|
+
<Badge color="info" outline>info</Badge>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Soft
|
|
127
|
+
|
|
128
|
+
Badges can be soft using the `soft` prop. The `soft` prop accepts a boolean value.
|
|
129
|
+
|
|
130
|
+
<Excerpt>
|
|
131
|
+
<div
|
|
132
|
+
style={{
|
|
133
|
+
display: "flex",
|
|
134
|
+
flexDirection: "row",
|
|
135
|
+
gap: 10,
|
|
136
|
+
flexWrap: "wrap",
|
|
137
|
+
alignItems: "center",
|
|
138
|
+
}}
|
|
139
|
+
>
|
|
140
|
+
{["primary", "secondary", "success", "danger", "warning", "info"].map(
|
|
141
|
+
(color) => (
|
|
142
|
+
<Badge key={color} color={color} soft>
|
|
143
|
+
{color}
|
|
144
|
+
</Badge>
|
|
145
|
+
)
|
|
146
|
+
)}
|
|
147
|
+
</div>
|
|
148
|
+
</Excerpt>
|
|
149
|
+
|
|
150
|
+
```jsx
|
|
151
|
+
<Badge color="primary" soft>primary</Badge>
|
|
152
|
+
<Badge color="secondary" soft>secondary</Badge>
|
|
153
|
+
<Badge color="success" soft>success</Badge>
|
|
154
|
+
<Badge color="danger" soft>danger</Badge>
|
|
155
|
+
<Badge color="warning" soft>warning</Badge>
|
|
156
|
+
<Badge color="info" soft>info</Badge>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Soft + Outline
|
|
160
|
+
|
|
161
|
+
Badges can be soft and outlined using the `soft` and `outline` props. The `soft` and `outline` props accept a boolean value.
|
|
162
|
+
|
|
163
|
+
<Excerpt>
|
|
164
|
+
<div
|
|
165
|
+
style={{
|
|
166
|
+
display: "flex",
|
|
167
|
+
flexDirection: "row",
|
|
168
|
+
gap: 10,
|
|
169
|
+
flexWrap: "wrap",
|
|
170
|
+
alignItems: "center",
|
|
171
|
+
}}
|
|
172
|
+
>
|
|
173
|
+
{["primary", "secondary", "success", "danger", "warning", "info"].map(
|
|
174
|
+
(color) => (
|
|
175
|
+
<Badge key={color} color={color} soft outline>
|
|
176
|
+
{color}
|
|
177
|
+
</Badge>
|
|
178
|
+
)
|
|
179
|
+
)}
|
|
180
|
+
</div>
|
|
181
|
+
</Excerpt>
|
|
182
|
+
|
|
183
|
+
```jsx
|
|
184
|
+
<Badge color="primary" soft outline>primary</Badge>
|
|
185
|
+
<Badge color="secondary" soft outline>secondary</Badge>
|
|
186
|
+
<Badge color="success" soft outline>success</Badge>
|
|
187
|
+
<Badge color="danger" soft outline>danger</Badge>
|
|
188
|
+
<Badge color="warning" soft outline>warning</Badge>
|
|
189
|
+
<Badge color="info" soft outline>info</Badge>
|
|
190
|
+
```
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Cards
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { Excerpt } from "../../components/Excerpt.jsx";
|
|
6
|
+
import { Card } from "tabler-react-2";
|
|
7
|
+
|
|
8
|
+
Cards are used to group related content and tasks. They can be used to display information, tasks, or actions.
|
|
9
|
+
|
|
10
|
+
## Signature
|
|
11
|
+
|
|
12
|
+
```jsx
|
|
13
|
+
import { Card } from "tabler-react-2";
|
|
14
|
+
|
|
15
|
+
<Card {...props}>{children}</Card>;
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Props
|
|
19
|
+
|
|
20
|
+
| Prop | Required | Type | Default | Description |
|
|
21
|
+
| ------------ | -------- | ------------------ | ------- | ------------------------------------------------------------ |
|
|
22
|
+
| `children` | No | node | | The content inside the card. |
|
|
23
|
+
| `size` | No | [`sm`, `md`, `lg`] | | The size of the card. |
|
|
24
|
+
| `title` | No | String | | The title shown in a top cell of the card. |
|
|
25
|
+
| `variant` | No | String | | The color variant of the card. |
|
|
26
|
+
| `variantPos` | No | [`top`, `side`] | `top` | The position of the colored bar. |
|
|
27
|
+
| `stacked` | No | Boolean | false | Whether there should be a second card placed below the card. |
|
|
28
|
+
| `tabs` | No | `TabList` | | A list of tabs to be shown in the card. |
|
|
29
|
+
|
|
30
|
+
## Basic Usage
|
|
31
|
+
|
|
32
|
+
The `Card` component wraps a div with some default styles.
|
|
33
|
+
|
|
34
|
+
<Excerpt>
|
|
35
|
+
<Card>
|
|
36
|
+
<p>Card content</p>
|
|
37
|
+
</Card>
|
|
38
|
+
</Excerpt>
|
|
39
|
+
|
|
40
|
+
```jsx
|
|
41
|
+
<Card>
|
|
42
|
+
<p>Card content</p>
|
|
43
|
+
</Card>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Title
|
|
47
|
+
|
|
48
|
+
The `title` prop can be used to add a title to the card. The title is rendered as a heading element.
|
|
49
|
+
|
|
50
|
+
<Excerpt>
|
|
51
|
+
<Card title="Card Title">
|
|
52
|
+
<p>Card content</p>
|
|
53
|
+
</Card>
|
|
54
|
+
</Excerpt>
|
|
55
|
+
|
|
56
|
+
```jsx
|
|
57
|
+
<Card title="Card Title">
|
|
58
|
+
<p>Card content</p>
|
|
59
|
+
</Card>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Sizes
|
|
63
|
+
|
|
64
|
+
Cards can be sized using the `size` prop. The `size` prop accepts a string value of `sm`, `md`, or `lg`.
|
|
65
|
+
|
|
66
|
+
<Excerpt>
|
|
67
|
+
<div
|
|
68
|
+
style={{
|
|
69
|
+
display: "flex",
|
|
70
|
+
flexDirection: "row",
|
|
71
|
+
gap: 10,
|
|
72
|
+
flexWrap: "wrap",
|
|
73
|
+
alignItems: "center",
|
|
74
|
+
|
|
75
|
+
}}
|
|
76
|
+
|
|
77
|
+
>
|
|
78
|
+
|
|
79
|
+
{["sm", "md", "lg"].map((size) => (
|
|
80
|
+
<Card key={size} size={size} style={{ maxWidth: 250, minWidth: 150 }}>
|
|
81
|
+
{size} card
|
|
82
|
+
</Card>
|
|
83
|
+
))}
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
</Excerpt>
|
|
87
|
+
|
|
88
|
+
```jsx
|
|
89
|
+
<Card size="sm">
|
|
90
|
+
<p>Small card</p>
|
|
91
|
+
</Card>
|
|
92
|
+
<Card size="md">
|
|
93
|
+
<p>Medium card</p>
|
|
94
|
+
</Card>
|
|
95
|
+
<Card size="lg">
|
|
96
|
+
<p>Large card</p>
|
|
97
|
+
</Card>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Colors
|
|
101
|
+
|
|
102
|
+
Cards can be colored using the `variant` prop. The `variant` prop accepts a string value of any [color](/utilities/colors).
|
|
103
|
+
|
|
104
|
+
<Excerpt>
|
|
105
|
+
<div
|
|
106
|
+
style={{
|
|
107
|
+
display: "flex",
|
|
108
|
+
flexDirection: "row",
|
|
109
|
+
gap: 10,
|
|
110
|
+
flexWrap: "wrap",
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
{[
|
|
115
|
+
"primary",
|
|
116
|
+
"secondary",
|
|
117
|
+
"success",
|
|
118
|
+
"danger",
|
|
119
|
+
"warning",
|
|
120
|
+
"info",
|
|
121
|
+
"light",
|
|
122
|
+
"dark",
|
|
123
|
+
"blue",
|
|
124
|
+
"orange",
|
|
125
|
+
"cyan",
|
|
126
|
+
"twitter",
|
|
127
|
+
].map((variant) => (
|
|
128
|
+
<Card
|
|
129
|
+
key={variant}
|
|
130
|
+
variant={variant}
|
|
131
|
+
size="sm"
|
|
132
|
+
style={{ maxWidth: 250, minWidth: 150 }}
|
|
133
|
+
>
|
|
134
|
+
{variant} card
|
|
135
|
+
</Card>
|
|
136
|
+
))}
|
|
137
|
+
</div>
|
|
138
|
+
</Excerpt>
|
|
139
|
+
|
|
140
|
+
```jsx
|
|
141
|
+
<Card variant="primary">
|
|
142
|
+
<p>Card content</p>
|
|
143
|
+
</Card>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Variant Position
|
|
147
|
+
|
|
148
|
+
You can change the position of the colored bar by passing the `variantPos` prop. The `variantPos` prop accepts a string value of `top` or `side`.
|
|
149
|
+
|
|
150
|
+
<Excerpt>
|
|
151
|
+
<div
|
|
152
|
+
style={{
|
|
153
|
+
display: "flex",
|
|
154
|
+
flexDirection: "row",
|
|
155
|
+
gap: 10,
|
|
156
|
+
flexWrap: "wrap",
|
|
157
|
+
alignItems: "center",
|
|
158
|
+
}}
|
|
159
|
+
>
|
|
160
|
+
{["top", "side"].map((pos) => (
|
|
161
|
+
<Card
|
|
162
|
+
key={pos}
|
|
163
|
+
variant="danger"
|
|
164
|
+
variantPos={pos}
|
|
165
|
+
size="sm"
|
|
166
|
+
style={{ maxWidth: 250, minWidth: 150 }}
|
|
167
|
+
>
|
|
168
|
+
{pos} card
|
|
169
|
+
</Card>
|
|
170
|
+
))}
|
|
171
|
+
</div>
|
|
172
|
+
</Excerpt>
|
|
173
|
+
|
|
174
|
+
```jsx
|
|
175
|
+
<Card variant="danger" variantPos="side">
|
|
176
|
+
<p>side card</p>
|
|
177
|
+
</Card>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Stacked Cards
|
|
181
|
+
|
|
182
|
+
You can pass a `stacked` prop to the `Card` component to create the effect of a stacked card. This is useful for signifying a list of cards.
|
|
183
|
+
|
|
184
|
+
<Excerpt>
|
|
185
|
+
<div
|
|
186
|
+
style={{
|
|
187
|
+
display: "flex",
|
|
188
|
+
flexDirection: "row",
|
|
189
|
+
gap: 10,
|
|
190
|
+
flexWrap: "wrap",
|
|
191
|
+
alignItems: "center",
|
|
192
|
+
}}
|
|
193
|
+
>
|
|
194
|
+
<Card stacked>
|
|
195
|
+
<p>Stacked Card</p>
|
|
196
|
+
</Card>
|
|
197
|
+
</div>
|
|
198
|
+
</Excerpt>
|
|
199
|
+
|
|
200
|
+
```jsx
|
|
201
|
+
<Card stacked>
|
|
202
|
+
<p>Stacked Card</p>
|
|
203
|
+
</Card>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
_Note: Stacked cards do not support size props._
|
|
207
|
+
|
|
208
|
+
## Tabs
|
|
209
|
+
|
|
210
|
+
The `Card` component can be used to display tabs. The `tabs` prop accepts a `TabList` type (see below).
|
|
211
|
+
|
|
212
|
+
<Excerpt>
|
|
213
|
+
<div>
|
|
214
|
+
<Card
|
|
215
|
+
size="md"
|
|
216
|
+
variantPos="top"
|
|
217
|
+
tabs={[
|
|
218
|
+
{ title: "Tab 1", content: <p>Content of Tab 1</p> },
|
|
219
|
+
{ title: "Tab 2", content: <p>Content of Tab 2</p> },
|
|
220
|
+
]}
|
|
221
|
+
/>
|
|
222
|
+
</div>
|
|
223
|
+
</Excerpt>
|
|
224
|
+
|
|
225
|
+
```jsx
|
|
226
|
+
<Card
|
|
227
|
+
size="md"
|
|
228
|
+
variantPos="top"
|
|
229
|
+
tabs={[
|
|
230
|
+
{ title: "Tab 1", content: <p>Content of Tab 1</p> },
|
|
231
|
+
{ title: "Tab 2", content: <p>Content of Tab 2</p> },
|
|
232
|
+
]}
|
|
233
|
+
/>
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### TabList
|
|
237
|
+
|
|
238
|
+
The `TabList` type is used to define the tabs for a `Card` component. The `TabList` type inherits from `Array` and expects each object to have a `title` and `content` property.
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
type TabList = Array<{
|
|
242
|
+
title: string;
|
|
243
|
+
content: React.ReactNode;
|
|
244
|
+
}>;
|
|
245
|
+
```
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Horizontal Rule
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { Excerpt } from "../../components/Excerpt.jsx";
|
|
6
|
+
import { Util } from "tabler-react-2";
|
|
7
|
+
|
|
8
|
+
Horizontal rules are used to separate content in a layout.
|
|
9
|
+
|
|
10
|
+
## Signature
|
|
11
|
+
|
|
12
|
+
```jsx
|
|
13
|
+
import { Util } from "tabler-react-2";
|
|
14
|
+
|
|
15
|
+
<Util.Hr {...props} />;
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
<blockquote>
|
|
19
|
+
<p>
|
|
20
|
+
**Tip:** You can destructure the `Util` component to bring individual components into scope. For example:
|
|
21
|
+
|
|
22
|
+
```jsx
|
|
23
|
+
import { Util } from "tabler-react-2";
|
|
24
|
+
const { Hr } = Util;
|
|
25
|
+
|
|
26
|
+
export default () => (
|
|
27
|
+
<>
|
|
28
|
+
<Hr />
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
</p>
|
|
34
|
+
</blockquote>
|
|
35
|
+
|
|
36
|
+
### Props
|
|
37
|
+
|
|
38
|
+
| Prop | Required | Type | Default | Description |
|
|
39
|
+
| ------ | -------- | -------- | ------- | ------------------------------------------- |
|
|
40
|
+
| `text` | No | `string` | | The text to display in the horizontal rule. |
|
|
41
|
+
|
|
42
|
+
## Basic Usage
|
|
43
|
+
|
|
44
|
+
The `Hr` component is used to create a horizontal rule.
|
|
45
|
+
|
|
46
|
+
<Excerpt>
|
|
47
|
+
<div style={{ minWidth: 200 }}>
|
|
48
|
+
<Util.Hr />
|
|
49
|
+
</div>
|
|
50
|
+
</Excerpt>
|
|
51
|
+
|
|
52
|
+
```jsx
|
|
53
|
+
<Hr />
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Text
|
|
57
|
+
|
|
58
|
+
You can pass a `text` prop to the `Hr` component to display text in the horizontal rule.
|
|
59
|
+
|
|
60
|
+
<Excerpt>
|
|
61
|
+
<div style={{ minWidth: 200 }}>
|
|
62
|
+
<Util.Hr text="Hello world" />
|
|
63
|
+
</div>
|
|
64
|
+
</Excerpt>
|
|
65
|
+
|
|
66
|
+
```jsx
|
|
67
|
+
<Hr text="Hello world" />
|
|
68
|
+
```
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Typography
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { Typography, Card } from "tabler-react-2";
|
|
6
|
+
import { Excerpt } from "../../components/Excerpt.jsx";
|
|
7
|
+
|
|
8
|
+
# Typography
|
|
9
|
+
|
|
10
|
+
```jsx
|
|
11
|
+
import { Typography } from "tabler-react-2";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Typography is provided by the `Typography` component and includes provisions for headings, body text, special text, and more.
|
|
15
|
+
|
|
16
|
+
<blockquote>
|
|
17
|
+
<p>
|
|
18
|
+
**Tip:** You can destructure the `Typography` component to bring individual components into scope. For example:
|
|
19
|
+
|
|
20
|
+
```jsx
|
|
21
|
+
import { Typography } from "tabler-react-2";
|
|
22
|
+
const { H1, Text } = Typography;
|
|
23
|
+
|
|
24
|
+
export default () => (
|
|
25
|
+
<>
|
|
26
|
+
<H1>Heading 1</H1>
|
|
27
|
+
<Text>Body text</Text>
|
|
28
|
+
</>
|
|
29
|
+
);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
</p>
|
|
33
|
+
</blockquote>
|
|
34
|
+
|
|
35
|
+
## Headings
|
|
36
|
+
|
|
37
|
+
Headings are provided by the `H1`, `H2`, `H3`, `H4`, `H5`, and `H6` components. These map to their semantic HTML counterparts and include styles for the appropriate font size and weight as well as legibility enhancements.
|
|
38
|
+
|
|
39
|
+
<Excerpt height={300}>
|
|
40
|
+
<Typography.H1>Heading 1</Typography.H1>
|
|
41
|
+
<Typography.H2>Heading 2</Typography.H2>
|
|
42
|
+
<Typography.H3>Heading 3</Typography.H3>
|
|
43
|
+
<Typography.H4>Heading 4</Typography.H4>
|
|
44
|
+
<Typography.H5>Heading 5</Typography.H5>
|
|
45
|
+
<Typography.H6>Heading 6</Typography.H6>
|
|
46
|
+
</Excerpt>
|
|
47
|
+
|
|
48
|
+
```jsx
|
|
49
|
+
<Typography.H1>Heading 1</Typography.H1>
|
|
50
|
+
<Typography.H2>Heading 2</Typography.H2>
|
|
51
|
+
<Typography.H3>Heading 3</Typography.H3>
|
|
52
|
+
<Typography.H4>Heading 4</Typography.H4>
|
|
53
|
+
<Typography.H5>Heading 5</Typography.H5>
|
|
54
|
+
<Typography.H6>Heading 6</Typography.H6>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Body text
|
|
58
|
+
|
|
59
|
+
Body text is provided by the `Text` component. It is enhanced by the `Strong` (or `B`), `I`, and `U` components for basic styling.
|
|
60
|
+
|
|
61
|
+
<Excerpt>
|
|
62
|
+
<Typography.Text>
|
|
63
|
+
The <Typography.Strong>quick</Typography.Strong> brown{" "}
|
|
64
|
+
<Typography.B>fox</Typography.B> jumps
|
|
65
|
+
<Typography.I>over</Typography.I> the <Typography.U>lazy</Typography.U> dog.
|
|
66
|
+
</Typography.Text>
|
|
67
|
+
</Excerpt>
|
|
68
|
+
|
|
69
|
+
```jsx
|
|
70
|
+
<Typography.Text>
|
|
71
|
+
The <Typography.Strong>quick</Typography.Strong> brown{" "}
|
|
72
|
+
<Typography.B>fox</Typography.B> jumps
|
|
73
|
+
<Typography.I>over</Typography.I> the <Typography.U>lazy</Typography.U> dog.
|
|
74
|
+
</Typography.Text>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`Strong` and `B` are aliases for the same component. They both compile down to `<strong>`. They do not have any differences other than the aliasing.
|
|
78
|
+
|
|
79
|
+
### Removing bottom margin
|
|
80
|
+
|
|
81
|
+
All body text elements have a bottom margin. You can override this by passing the `mb-0` class:
|
|
82
|
+
|
|
83
|
+
```jsx
|
|
84
|
+
<Typography.Text mb-0>
|
|
85
|
+
The quick brown fox jumps over the lazy dog.
|
|
86
|
+
</Typography.Text>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
This class works on all elements in Tabler, but is most commonly used on `Typography.Text`. See the [margins](/utilities/margins) documentation page for more information.
|
|
90
|
+
|
|
91
|
+
## Special text
|
|
92
|
+
|
|
93
|
+
Special text is provided by the `Typography.Special.*` components.
|
|
94
|
+
|
|
95
|
+
<Excerpt>
|
|
96
|
+
<div style={{ display: "flex", flexDirection: "row", gap: 100 }}>
|
|
97
|
+
<div
|
|
98
|
+
style={{
|
|
99
|
+
display: "flex",
|
|
100
|
+
flexDirection: "column",
|
|
101
|
+
gap: 4,
|
|
102
|
+
flex: 0,
|
|
103
|
+
alignItems: "flex-start",
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
<Typography.Special.Abbr>Abbreviation</Typography.Special.Abbr>
|
|
107
|
+
<Typography.Special.Cite>Citation</Typography.Special.Cite>
|
|
108
|
+
<Typography.Special.Del>Deleted</Typography.Special.Del>
|
|
109
|
+
<Typography.Special.Em>Emphasis</Typography.Special.Em>
|
|
110
|
+
<Typography.Special.Ins>Inserted</Typography.Special.Ins>
|
|
111
|
+
<Typography.Special.S>Strikethrough</Typography.Special.S>
|
|
112
|
+
<Typography.Special.Samp>Sample</Typography.Special.Samp>
|
|
113
|
+
</div>
|
|
114
|
+
<div
|
|
115
|
+
style={{
|
|
116
|
+
display: "flex",
|
|
117
|
+
flexDirection: "column",
|
|
118
|
+
gap: 4,
|
|
119
|
+
flex: 0,
|
|
120
|
+
alignItems: "flex-start",
|
|
121
|
+
}}
|
|
122
|
+
>
|
|
123
|
+
<Typography.Special.Var>Variable</Typography.Special.Var>
|
|
124
|
+
<span
|
|
125
|
+
style={{
|
|
126
|
+
wordBreak: "keep-all",
|
|
127
|
+
whiteSpace: "nowrap",
|
|
128
|
+
}}
|
|
129
|
+
>
|
|
130
|
+
<Typography.Special.Time>18:00</Typography.Special.Time>{" "}
|
|
131
|
+
<span> (Time)</span>
|
|
132
|
+
</span>
|
|
133
|
+
<span
|
|
134
|
+
style={{
|
|
135
|
+
wordBreak: "keep-all",
|
|
136
|
+
whiteSpace: "nowrap",
|
|
137
|
+
}}
|
|
138
|
+
>
|
|
139
|
+
<Typography.Special.Sub>Subscript</Typography.Special.Sub>{" "}
|
|
140
|
+
<span> (Sub)</span>
|
|
141
|
+
</span>
|
|
142
|
+
<span
|
|
143
|
+
style={{
|
|
144
|
+
wordBreak: "keep-all",
|
|
145
|
+
whiteSpace: "nowrap",
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
<Typography.Special.Sup>Superscript</Typography.Special.Sup>{" "}
|
|
149
|
+
<span> (Sup)</span>
|
|
150
|
+
</span>
|
|
151
|
+
<Typography.Special.Kbd>Keyboard</Typography.Special.Kbd>
|
|
152
|
+
<Typography.Special.Mark>Highlight</Typography.Special.Mark>
|
|
153
|
+
<Typography.Special.Code>Code</Typography.Special.Code>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</Excerpt>
|
|
157
|
+
|
|
158
|
+
```jsx
|
|
159
|
+
<Typography.Special.Abbr>Abbreviation</Typography.Special.Abbr>
|
|
160
|
+
<Typography.Special.Cite>Citation</Typography.Special.Cite>
|
|
161
|
+
<Typography.Special.Del>Deleted</Typography.Special.Del>
|
|
162
|
+
<Typography.Special.Em>Emphasis</Typography.Special.Em>
|
|
163
|
+
<Typography.Special.Ins>Inserted</Typography.Special.Ins>
|
|
164
|
+
<Typography.Special.S>Strikethrough</Typography.Special.S>
|
|
165
|
+
<Typography.Special.Samp>Sample</Typography.Special.Samp>
|
|
166
|
+
<Typography.Special.Var>Variable</Typography.Special.Var>
|
|
167
|
+
<Typography.Special.Time>18:00</Typography.Special.Time>
|
|
168
|
+
<Typography.Special.Sub>Subscript</Typography.Special.Sub>
|
|
169
|
+
<Typography.Special.Sup>Superscript</Typography.Special.Sup>
|
|
170
|
+
<Typography.Special.Kbd>Keyboard</Typography.Special.Kbd>
|
|
171
|
+
<Typography.Special.Mark>Highlight</Typography.Special.Mark>
|
|
172
|
+
<Typography.Special.Code>Code</Typography.Special.Code>
|
|
173
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Frequently Asked Questions
|
|
3
|
+
description: Frequently asked questions about the theme.
|
|
4
|
+
disableTableOfContents: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Will be included search or dark mode?
|
|
8
|
+
|
|
9
|
+
This theme is a great and complete option to build simple documentation websites.
|
|
10
|
+
We don't plan anymore to include search, dark mode or i18n to the project.
|
|
11
|
+
|
|
12
|
+
Remember that if necessary, you can change colors and include a default
|
|
13
|
+
dark theme. To do so, check this [doc](/usage/shadowing#changing-theme-colors).
|
|
14
|
+
|
|
15
|
+
## How can I deploy my website?
|
|
16
|
+
|
|
17
|
+
To deploy this project, we recommend you take a look at this extensive documentation
|
|
18
|
+
hosted on [Gatsby website](https://www.gatsbyjs.com/docs/deploying-and-hosting/). It
|
|
19
|
+
includes deploy tutorials for many services, like [Vercel](https://vercel.com/),
|
|
20
|
+
[Netlify](https://www.netlify.com/), [GitHub Pages](https://pages.github.com/) and others.
|
|
21
|
+
|
|
22
|
+
## What are good examples of the theme usage?
|
|
23
|
+
|
|
24
|
+
- [Botmation](https://botmation.dev)
|
|
25
|
+
- [Capmonster.cloud for Python](https://capmonster-python.alperenn.com/)
|
|
26
|
+
- [ESPHome Devices](https://devices.esphome.io/)
|
|
27
|
+
- [Label U](https://opendatalab.github.io/labelU-Kit/)
|
|
28
|
+
- [React Observing](https://react-observing.web.app/)
|
|
29
|
+
- [RudderStack Docs](https://rudderstack.com/docs/)
|
|
30
|
+
- [Unform](https://unform.dev)
|
|
31
|
+
- [Use Pandas](https://www.usepandas.com/)
|
|
32
|
+
- [golangci-lint](https://golangci-lint.run/)
|
|
33
|
+
- [use-cloudinary](https://use-cloudinary.netlify.app/)
|
|
34
|
+
|
|
35
|
+
ps: are you using this project? Submit a PR to add it to the [list](https://github.com/jpedroschmitz/rocketdocs/blob/main/examples/gatsby-theme-docs/src/docs/faq.mdx#what-are-good-examples-of-the-theme-usage).
|