@slashsuite/ui-react 0.11.3 → 0.12.1
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/README.md +14 -1
- package/agent-docs/components/app-shell.md +136 -0
- package/agent-docs/components/avatar-stack.md +64 -0
- package/agent-docs/components/avatar.md +76 -0
- package/agent-docs/components/badge.md +61 -0
- package/agent-docs/components/body-text.md +158 -0
- package/agent-docs/components/bottom-sheet.md +95 -0
- package/agent-docs/components/breadcrumbs.md +62 -0
- package/agent-docs/components/bullet-list.md +54 -0
- package/agent-docs/components/button.md +135 -0
- package/agent-docs/components/callout.md +86 -0
- package/agent-docs/components/card-grid.md +108 -0
- package/agent-docs/components/card.md +113 -0
- package/agent-docs/components/centered-layout.md +90 -0
- package/agent-docs/components/chat-composer.md +48 -0
- package/agent-docs/components/chat-message.md +61 -0
- package/agent-docs/components/chat-thread.md +49 -0
- package/agent-docs/components/checkbox.md +75 -0
- package/agent-docs/components/cluster.md +106 -0
- package/agent-docs/components/code-example.md +48 -0
- package/agent-docs/components/code.md +70 -0
- package/agent-docs/components/colour-scheme-toggle.md +92 -0
- package/agent-docs/components/container.md +50 -0
- package/agent-docs/components/copy-button.md +61 -0
- package/agent-docs/components/copy-line.md +54 -0
- package/agent-docs/components/date-field.md +103 -0
- package/agent-docs/components/date-range-picker.md +101 -0
- package/agent-docs/components/detail-layout.md +147 -0
- package/agent-docs/components/dialog.md +178 -0
- package/agent-docs/components/disclosure.md +66 -0
- package/agent-docs/components/divider.md +62 -0
- package/agent-docs/components/docs-layout.md +160 -0
- package/agent-docs/components/drawer.md +128 -0
- package/agent-docs/components/empty-state.md +67 -0
- package/agent-docs/components/field-dialog.md +97 -0
- package/agent-docs/components/field.md +68 -0
- package/agent-docs/components/fieldset.md +82 -0
- package/agent-docs/components/file-drop.md +52 -0
- package/agent-docs/components/form-layout.md +141 -0
- package/agent-docs/components/form-row.md +93 -0
- package/agent-docs/components/full-bleed-layout.md +116 -0
- package/agent-docs/components/headings.md +101 -0
- package/agent-docs/components/hero.md +59 -0
- package/agent-docs/components/icon-button.md +92 -0
- package/agent-docs/components/icon.md +66 -0
- package/agent-docs/components/image.md +64 -0
- package/agent-docs/components/input.md +83 -0
- package/agent-docs/components/kbd.md +38 -0
- package/agent-docs/components/key-value-list.md +81 -0
- package/agent-docs/components/lightbox.md +97 -0
- package/agent-docs/components/list-layout.md +154 -0
- package/agent-docs/components/list-row.md +116 -0
- package/agent-docs/components/loading.md +69 -0
- package/agent-docs/components/markdown.md +51 -0
- package/agent-docs/components/media-tile.md +97 -0
- package/agent-docs/components/menu.md +103 -0
- package/agent-docs/components/meta-list.md +69 -0
- package/agent-docs/components/morph.md +128 -0
- package/agent-docs/components/navigation-progress.md +56 -0
- package/agent-docs/components/outline-region.md +63 -0
- package/agent-docs/components/page-fade.md +116 -0
- package/agent-docs/components/page-header.md +93 -0
- package/agent-docs/components/pagination.md +64 -0
- package/agent-docs/components/pill.md +104 -0
- package/agent-docs/components/progress-bar.md +66 -0
- package/agent-docs/components/prose-layout.md +87 -0
- package/agent-docs/components/prose.md +41 -0
- package/agent-docs/components/radio-group.md +74 -0
- package/agent-docs/components/scroll-strip.md +48 -0
- package/agent-docs/components/segmented-control.md +133 -0
- package/agent-docs/components/select.md +65 -0
- package/agent-docs/components/show.md +120 -0
- package/agent-docs/components/side-column.md +70 -0
- package/agent-docs/components/sidebar-layout.md +134 -0
- package/agent-docs/components/site-footer.md +63 -0
- package/agent-docs/components/site-search.md +67 -0
- package/agent-docs/components/sortable-list.md +107 -0
- package/agent-docs/components/split-bar.md +54 -0
- package/agent-docs/components/stack.md +197 -0
- package/agent-docs/components/stacked-bar.md +88 -0
- package/agent-docs/components/stat-tile.md +69 -0
- package/agent-docs/components/status-pages.md +105 -0
- package/agent-docs/components/steps.md +74 -0
- package/agent-docs/components/sticky-bar.md +51 -0
- package/agent-docs/components/switch.md +79 -0
- package/agent-docs/components/table.md +373 -0
- package/agent-docs/components/tabs.md +180 -0
- package/agent-docs/components/text-link.md +105 -0
- package/agent-docs/components/textarea.md +51 -0
- package/agent-docs/components/timeline.md +79 -0
- package/agent-docs/components/toast.md +86 -0
- package/agent-docs/components/trend-chart.md +61 -0
- package/agent-docs/components/video.md +44 -0
- package/agent-docs/llms.txt +155 -0
- package/package.json +6 -3
- package/skills/uislash/SKILL.md +20 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
## Dialog
|
|
2
|
+
|
|
3
|
+
Group: Feedback
|
|
4
|
+
|
|
5
|
+
When to use: A confirmation or a short form the reader must answer before they go on.
|
|
6
|
+
|
|
7
|
+
### Use instead
|
|
8
|
+
- Drawer (drawer.md): A record or a long form is worked on beside the page.
|
|
9
|
+
- FieldDialog (field-dialog.md): Only one text value is asked for.
|
|
10
|
+
- BottomSheet (bottom-sheet.md): Content sits over a map or a canvas that must stay usable: not modal.
|
|
11
|
+
- Lightbox (lightbox.md): One photo or video is shown at full size.
|
|
12
|
+
|
|
13
|
+
### The one right way
|
|
14
|
+
A confirmation is a title that names the action, one line of consequence, and Cancel beside the action. It is rendered only while open.
|
|
15
|
+
```tsx
|
|
16
|
+
import { useState } from "react";
|
|
17
|
+
import { Button, Dialog } from "@slashsuite/ui-react";
|
|
18
|
+
|
|
19
|
+
function Example() {
|
|
20
|
+
const [open, setOpen] = useState(false);
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<Button variant="outline" onClick={() => setOpen(true)}>
|
|
24
|
+
Delete build
|
|
25
|
+
</Button>
|
|
26
|
+
{open && (
|
|
27
|
+
<Dialog
|
|
28
|
+
title="Delete build"
|
|
29
|
+
description="This removes the build and every snapshot in it."
|
|
30
|
+
onClose={() => setOpen(false)}
|
|
31
|
+
footer={
|
|
32
|
+
<>
|
|
33
|
+
<Button variant="ghost" onClick={() => setOpen(false)}>
|
|
34
|
+
Cancel
|
|
35
|
+
</Button>
|
|
36
|
+
<Button tone="danger" onClick={() => setOpen(false)}>
|
|
37
|
+
Delete
|
|
38
|
+
</Button>
|
|
39
|
+
</>
|
|
40
|
+
}
|
|
41
|
+
/>
|
|
42
|
+
)}
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Do
|
|
49
|
+
- Render it only while it is open: `{open && <Dialog … onClose={() => setOpen(false)} />}`. It opens itself on mount.
|
|
50
|
+
- A `title` that names the action, a `description` with the consequence, and the actions in `footer`: Cancel as `variant="ghost"` first, then the one action, `tone="danger"` when it destroys something.
|
|
51
|
+
- A form is the Dialog's own `onSubmit`: the body, the error and the footer are one form, so the footer's `Button type="submit"` and Enter in a field submit it, with no form id and no `form` attribute. The footer is Cancel (`variant="ghost"`), then the one submit button. With `onSubmit`, put no `<form method="dialog">` in the footer: it would nest a form.
|
|
52
|
+
- An error about one field is that `Field`'s `error`. An error about the whole submit (the server refused it, a conflict, no connection) is the Dialog's `error`: an alert between the body and the footer, beside the button that was pressed however tall the body is.
|
|
53
|
+
- A tall body scrolls inside the dialog, which is never taller than the screen: the title, the description and the footer stay on screen, so the actions are always in reach. There is nothing to set.
|
|
54
|
+
- One text field is a `FieldDialog`. A record or a long form is a `Drawer`. A message that needs no answer is a `Callout` in the page, or a `Toast` when it should not move the page.
|
|
55
|
+
- It fades and slides in, and out again on close, but a `<dialog>` only animates out while it is still in the DOM. So `onClose` is called once the exit has finished: put `setOpen(false)` there and nowhere else. Esc, the backdrop and a `<form method="dialog">` close it that way already. Your own Cancel or action button closes it by calling `.close()` on its `<dialog>`, which a click handler finds with `event.currentTarget.closest("dialog")`. A button that calls `setOpen(false)` itself unmounts the dialog at once, and it vanishes with no exit animation.
|
|
56
|
+
- After async work (a save), keep the `<dialog>` from the event before the `await` (`const dialog = event.currentTarget.closest("dialog")`) and call `dialog?.close()` when it resolves.
|
|
57
|
+
|
|
58
|
+
### Don't
|
|
59
|
+
With no Cancel and no consequence, the only way out of the dialog is the one button that destroys the build.
|
|
60
|
+
```tsx
|
|
61
|
+
import { useState } from "react";
|
|
62
|
+
import { Button, Dialog } from "@slashsuite/ui-react";
|
|
63
|
+
|
|
64
|
+
function Example() {
|
|
65
|
+
const [open, setOpen] = useState(false);
|
|
66
|
+
return (
|
|
67
|
+
<>
|
|
68
|
+
<Button variant="outline" onClick={() => setOpen(true)}>
|
|
69
|
+
Delete build
|
|
70
|
+
</Button>
|
|
71
|
+
{open && (
|
|
72
|
+
<Dialog
|
|
73
|
+
title="Are you sure?"
|
|
74
|
+
onClose={() => setOpen(false)}
|
|
75
|
+
footer={
|
|
76
|
+
<Button tone="danger" onClick={() => setOpen(false)}>
|
|
77
|
+
Delete
|
|
78
|
+
</Button>
|
|
79
|
+
}
|
|
80
|
+
/>
|
|
81
|
+
)}
|
|
82
|
+
</>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
A modal for a message makes the reader dismiss it before they can carry on.
|
|
88
|
+
```tsx
|
|
89
|
+
import { useState } from "react";
|
|
90
|
+
import { Button, Dialog } from "@slashsuite/ui-react";
|
|
91
|
+
|
|
92
|
+
function Example() {
|
|
93
|
+
const [open, setOpen] = useState(false);
|
|
94
|
+
return (
|
|
95
|
+
<>
|
|
96
|
+
<Button variant="outline" onClick={() => setOpen(true)}>
|
|
97
|
+
Save
|
|
98
|
+
</Button>
|
|
99
|
+
{open && (
|
|
100
|
+
<Dialog
|
|
101
|
+
title="Saved"
|
|
102
|
+
description="Your review is saved."
|
|
103
|
+
onClose={() => setOpen(false)}
|
|
104
|
+
footer={<Button onClick={() => setOpen(false)}>OK</Button>}
|
|
105
|
+
/>
|
|
106
|
+
)}
|
|
107
|
+
</>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
A form id in the body, a `form` attribute on the button, and a hand-made error line under the fields, away from the button that was pressed.
|
|
113
|
+
```tsx
|
|
114
|
+
import { useState } from "react";
|
|
115
|
+
import { Button, Dialog, Field, Input, Stack, Text } from "@slashsuite/ui-react";
|
|
116
|
+
|
|
117
|
+
function Example() {
|
|
118
|
+
const [open, setOpen] = useState(false);
|
|
119
|
+
return (
|
|
120
|
+
<>
|
|
121
|
+
<Button variant="outline" onClick={() => setOpen(true)}>
|
|
122
|
+
New flag
|
|
123
|
+
</Button>
|
|
124
|
+
{open && (
|
|
125
|
+
<Dialog
|
|
126
|
+
title="New flag"
|
|
127
|
+
onClose={() => setOpen(false)}
|
|
128
|
+
footer={
|
|
129
|
+
<Button type="submit" form="new-flag-form">
|
|
130
|
+
Create
|
|
131
|
+
</Button>
|
|
132
|
+
}
|
|
133
|
+
>
|
|
134
|
+
<form id="new-flag-form" onSubmit={(event) => event.preventDefault()}>
|
|
135
|
+
<Stack>
|
|
136
|
+
<Field label="Key">
|
|
137
|
+
<Input defaultValue="new-checkout" />
|
|
138
|
+
</Field>
|
|
139
|
+
<Text tone="danger">Could not create the flag: the key is taken.</Text>
|
|
140
|
+
</Stack>
|
|
141
|
+
</form>
|
|
142
|
+
</Dialog>
|
|
143
|
+
)}
|
|
144
|
+
</>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Accessibility
|
|
150
|
+
- A Dialog is the browser's own `<dialog>` opened with `showModal()`: the page behind goes inert, focus stays inside it and Esc closes it.
|
|
151
|
+
- The fade and slide are switched off under `prefers-reduced-motion: reduce`, and then it closes at once.
|
|
152
|
+
- It is named by its `title`, an `h2`, through `aria-labelledby`.
|
|
153
|
+
- A click on the backdrop closes it, and so does a submit of a `<form method="dialog">`; every close calls `onClose`.
|
|
154
|
+
- The browser focuses the first focusable element in it when it opens; put `autoFocus` on the button that should have focus first.
|
|
155
|
+
- A tall body that holds nothing focusable, such as plain text, takes a tab stop so the arrow keys can scroll it. A tall form keeps its first focus on its first field.
|
|
156
|
+
|
|
157
|
+
### Props
|
|
158
|
+
### Dialog
|
|
159
|
+
A modal on the browser's own `<dialog>`: it is opened with `showModal()` on mount, so render it only while it is open. The page behind goes inert, Esc closes it and focus stays inside; a click on the backdrop (the `<dialog>` element itself, not its contents) closes it too. A windowed dialog is never taller than the screen: a tall body scrolls and the title and footer stay on screen.
|
|
160
|
+
- description: ReactNode. A muted line under the title.
|
|
161
|
+
- error: ReactNode. What went wrong with the whole submit (the server refused it, no connection): a danger
|
|
162
|
+
`Callout`, announced as an alert, between the body and the footer, so it stays beside the
|
|
163
|
+
buttons however tall the body is. An error about one field is that `Field`'s `error`.
|
|
164
|
+
- footer: ReactNode. Actions under the body, right-aligned: Cancel (`variant="ghost"`), then the one main action.
|
|
165
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
166
|
+
- onClose: () => void (required). Called when the dialog closes: Esc, a click on the backdrop, or a `<form method="dialog">` submit.
|
|
167
|
+
- onSubmit: ((event: FormEvent<HTMLFormElement>) => void | Promise<unknown>). Makes the dialog a form: one `<form noValidate>` holds the body, the `error` and the footer,
|
|
168
|
+
so a `Button type="submit"` in the footer or Enter in a field submits it, with no `form`
|
|
169
|
+
attribute or id. The default is prevented before this runs, and a rejection is yours to
|
|
170
|
+
catch and show as `error`. Put no `<form method="dialog">` in the footer of a form dialog:
|
|
171
|
+
it would nest a form.
|
|
172
|
+
- title: ReactNode (required). The dialog's accessible name, shown as its heading.
|
|
173
|
+
- width: "sm" | "md" | "lg" | "full" (default md). The panel's width: `sm` (320px) is a list, `md` (440px) holds a form, `lg` (640px) a wider
|
|
174
|
+
form or a table. `full` fills the whole screen, for media or a player: the body takes the
|
|
175
|
+
height between the header and the footer and scrolls if it is taller. It has no backdrop to
|
|
176
|
+
click, so give it a close action in the `footer` (a `<form method="dialog">` button).
|
|
177
|
+
|
|
178
|
+
A single photo or video is a `Lightbox`.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
## Disclosure
|
|
2
|
+
|
|
3
|
+
Group: Content
|
|
4
|
+
|
|
5
|
+
When to use: Detail the person may not need on first sight: a history, an FAQ answer, the fine print.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
Detail the person may not need, behind a summary that says what it is, is a `Disclosure`.
|
|
9
|
+
```tsx
|
|
10
|
+
import { Disclosure, Stack, Text } from "@slashsuite/ui-react";
|
|
11
|
+
|
|
12
|
+
<Stack gap="xs">
|
|
13
|
+
<Text>Order 1042 was posted on Monday.</Text>
|
|
14
|
+
<Disclosure summary="Tracking history">
|
|
15
|
+
<Text>Posted Monday · Sorted Tuesday · Out for delivery Wednesday.</Text>
|
|
16
|
+
</Disclosure>
|
|
17
|
+
</Stack>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Do
|
|
21
|
+
- Give it a `summary` that says what is inside; the `children` are the body. It starts closed; `defaultOpen` starts it open.
|
|
22
|
+
- It keeps its own state. Several in a column are independent of each other.
|
|
23
|
+
- `bordered` draws it as a panel for a section that opens in place on a page of cards: a bordered box, the summary a full-width row that fills on hover, the body padded under a hairline.
|
|
24
|
+
- A collapsible section header in a list of rows is a `ListRow` with `expanded`, where the caller owns the state.
|
|
25
|
+
- It replaces `<details>` and `<summary>`.
|
|
26
|
+
|
|
27
|
+
### Don't
|
|
28
|
+
- Do not hide what the person must read to carry on, such as an error or the one thing the page is for.
|
|
29
|
+
|
|
30
|
+
A hand-built `<details>` and `<summary>` has none of the library's look or focus ring. `Disclosure` replaces it.
|
|
31
|
+
```tsx
|
|
32
|
+
import { Stack, Text } from "@slashsuite/ui-react";
|
|
33
|
+
|
|
34
|
+
<Stack gap="xs">
|
|
35
|
+
<Text>Order 1042 was posted on Monday.</Text>
|
|
36
|
+
<details>
|
|
37
|
+
<summary>Tracking history</summary>
|
|
38
|
+
<Text>Posted Monday · Sorted Tuesday · Out for delivery Wednesday.</Text>
|
|
39
|
+
</details>
|
|
40
|
+
</Stack>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
What the person must read to carry on, such as an error, is not hidden behind a summary: show it.
|
|
44
|
+
```tsx
|
|
45
|
+
import { Callout, Disclosure } from "@slashsuite/ui-react";
|
|
46
|
+
|
|
47
|
+
<Disclosure summary="Details">
|
|
48
|
+
<Callout tone="danger">Your payment was declined. Your order is not placed.</Callout>
|
|
49
|
+
</Disclosure>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Accessibility
|
|
53
|
+
- The summary is a real `<button>` with `aria-expanded` and `aria-controls`; Enter and Space toggle it.
|
|
54
|
+
- The body is a `role="group"` named by the summary, and hidden from assistive tech while closed.
|
|
55
|
+
- The chevron is decorative. The focus ring comes from the component.
|
|
56
|
+
|
|
57
|
+
### Props
|
|
58
|
+
### Disclosure
|
|
59
|
+
A summary line with a chevron over a body that opens and closes under it. The summary is a button with `aria-expanded`, and Enter and Space toggle it; the body is hidden while closed. It starts closed and keeps its own state; `defaultOpen` starts it open. To drive it from the app, pass `open` with `onOpenChange`. `bordered` draws it as a panel: a bordered box with the summary as a roomy row across the top (the hover fill of a `ListRow`) and the body padded under a hairline, for a section that opens in place in a page of cards. Plain, it is a line of text with the body indented under it.
|
|
60
|
+
- bordered: boolean (default false). Draws it as a bordered panel: the summary a full-width row, the body padded under a hairline.
|
|
61
|
+
- children: ReactNode (required). The body, shown while open.
|
|
62
|
+
- defaultOpen: boolean (default false). Starts with the body showing.
|
|
63
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
64
|
+
- onOpenChange: ((open: boolean) => void). Called with the new state when the summary is pressed.
|
|
65
|
+
- open: boolean. Whether the body shows, for an app that holds the state; pass `onOpenChange` with it.
|
|
66
|
+
- summary: ReactNode (required). The always-visible line: the button that toggles the body.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
## Divider
|
|
2
|
+
|
|
3
|
+
Group: Layout
|
|
4
|
+
|
|
5
|
+
When to use: One line between a heading and its content, or above a footer.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
A `Divider` is one hairline between two parts of a page, here the content and its footer. The space around it is the `Stack`'s.
|
|
9
|
+
```tsx
|
|
10
|
+
import { Caption, Divider, Stack, Text } from "@slashsuite/ui-react";
|
|
11
|
+
|
|
12
|
+
<Stack gap="lg">
|
|
13
|
+
<Text>The last paragraph of a page.</Text>
|
|
14
|
+
<Divider />
|
|
15
|
+
<Caption>Hack Cove (Pty) Ltd</Caption>
|
|
16
|
+
</Stack>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Do
|
|
20
|
+
- Use it between two parts of a page that are not bordered, such as the content and its footer.
|
|
21
|
+
- The space around it is the layout's: put it in a `Stack`, never add margin.
|
|
22
|
+
- For a rule under a section title, `SectionHeading` and `Section` have `rule`. For a line between two `Section`s, put a `Divider` between them in their `Stack`.
|
|
23
|
+
- Rows with a line between each and no gap (a list of `ListRow`s) are a `Stack divided`, not a `Divider` after every row.
|
|
24
|
+
|
|
25
|
+
### Don't
|
|
26
|
+
- Do not draw it between bordered blocks such as `Card`: their borders and the `gap` already separate them.
|
|
27
|
+
|
|
28
|
+
A `Divider` and a footer placed by hand inside a `Card`: the card's own `footer` draws that strip, its line and its spacing.
|
|
29
|
+
```tsx
|
|
30
|
+
import { Caption, Card, Divider, Stack, Text } from "@slashsuite/ui-react";
|
|
31
|
+
|
|
32
|
+
<Card title="Quote 12">
|
|
33
|
+
<Stack gap="lg">
|
|
34
|
+
<Text>Two lines, R 1 200.</Text>
|
|
35
|
+
<Divider />
|
|
36
|
+
<Caption>Total R 1 200</Caption>
|
|
37
|
+
</Stack>
|
|
38
|
+
</Card>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
A `Divider` between two Cards is a second line on top of their borders and the gap.
|
|
42
|
+
```tsx
|
|
43
|
+
import { Card, Divider, Stack, Text } from "@slashsuite/ui-react";
|
|
44
|
+
|
|
45
|
+
<Stack>
|
|
46
|
+
<Card title="Build 412">
|
|
47
|
+
<Text>3 changed</Text>
|
|
48
|
+
</Card>
|
|
49
|
+
<Divider />
|
|
50
|
+
<Card title="Build 411">
|
|
51
|
+
<Text>No changes</Text>
|
|
52
|
+
</Card>
|
|
53
|
+
</Stack>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Accessibility
|
|
57
|
+
- It is an `<hr>`, which assistive tech announces as a separator. Use it only where the content really changes.
|
|
58
|
+
|
|
59
|
+
### Props
|
|
60
|
+
### Divider
|
|
61
|
+
A hairline rule in the theme's line colour: between a heading and its content, or above a footer. Space around it is the layout's.
|
|
62
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
## DocsLayout
|
|
2
|
+
|
|
3
|
+
Group: Page layouts
|
|
4
|
+
|
|
5
|
+
When to use: Every page of a docs site: a nav of grouped pages, an article with its own headings, and previous and next in reading order.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
A docs page is one `DocsLayout`: the nav, the title, `contents` and the neighbours are props, and the layout draws the list and the links.
|
|
9
|
+
```tsx
|
|
10
|
+
import { DocsLayout, Section, Text } from "@slashsuite/ui-react";
|
|
11
|
+
|
|
12
|
+
<DocsLayout
|
|
13
|
+
nav={[{ title: "Guides", items: [{ label: "Install", href: "#install", selected: true }] }]}
|
|
14
|
+
navLabel="Docs"
|
|
15
|
+
title="Install"
|
|
16
|
+
contents={[
|
|
17
|
+
{ id: "do-setup", label: "Setup", level: 2 },
|
|
18
|
+
{ id: "do-run", label: "Run", level: 2 },
|
|
19
|
+
]}
|
|
20
|
+
next={{ label: "First build", href: "#first-build" }}
|
|
21
|
+
>
|
|
22
|
+
<Section id="do-setup" title="Setup">
|
|
23
|
+
<Text>Add the package.</Text>
|
|
24
|
+
</Section>
|
|
25
|
+
<Section id="do-run" title="Run">
|
|
26
|
+
<Text>Capture the stories.</Text>
|
|
27
|
+
</Section>
|
|
28
|
+
</DocsLayout>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Full page
|
|
32
|
+
A whole docs page in the shell: nav, breadcrumbs, a `Prose` article whose h2 and h3 ids match `contents`, the second heading `current`, and previous and next.
|
|
33
|
+
```tsx
|
|
34
|
+
import { Breadcrumbs, DocsLayout, Prose, Section, Text } from "@slashsuite/ui-react";
|
|
35
|
+
|
|
36
|
+
<DemoShell>
|
|
37
|
+
<DocsLayout
|
|
38
|
+
nav={[
|
|
39
|
+
{ items: [{ label: "All docs", href: "#docs" }] },
|
|
40
|
+
{
|
|
41
|
+
title: "Get started",
|
|
42
|
+
items: [
|
|
43
|
+
{ label: "Install", href: "#install", selected: true },
|
|
44
|
+
{ label: "First build", href: "#first-build" },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: "Guides",
|
|
49
|
+
items: [
|
|
50
|
+
{ label: "Baselines", href: "#baselines" },
|
|
51
|
+
{ label: "Ignore areas", href: "#ignore" },
|
|
52
|
+
{ label: "CI", href: "#ci" },
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
]}
|
|
56
|
+
navLabel="Docs"
|
|
57
|
+
breadcrumbs={<Breadcrumbs items={[{ label: "Docs", href: "#docs" }, "Install"]} />}
|
|
58
|
+
title="Install"
|
|
59
|
+
description="Add the CLI to a project and run its first capture."
|
|
60
|
+
contents={[
|
|
61
|
+
{ id: "requirements", label: "Requirements", level: 2 },
|
|
62
|
+
{ id: "package", label: "The package", level: 2 },
|
|
63
|
+
{ id: "token", label: "A token", level: 3 },
|
|
64
|
+
{ id: "check", label: "Check it works", level: 2 },
|
|
65
|
+
]}
|
|
66
|
+
current="package"
|
|
67
|
+
previous={{ label: "All docs", href: "#docs" }}
|
|
68
|
+
next={{ label: "First build", href: "#first-build" }}
|
|
69
|
+
>
|
|
70
|
+
<Prose>
|
|
71
|
+
<Section id="requirements" title="Requirements">
|
|
72
|
+
<Text>Bun 1.3 or Node 24, and a Storybook that builds.</Text>
|
|
73
|
+
</Section>
|
|
74
|
+
<Section id="package" title="The package">
|
|
75
|
+
<Text>Add the CLI as a dev dependency of the project that owns the stories.</Text>
|
|
76
|
+
<Section id="token" title="A token">
|
|
77
|
+
<Text>Create a token on the server and keep it in the CI secrets.</Text>
|
|
78
|
+
</Section>
|
|
79
|
+
</Section>
|
|
80
|
+
<Section id="check" title="Check it works">
|
|
81
|
+
<Text>Run a capture; the report lists every story it shot.</Text>
|
|
82
|
+
</Section>
|
|
83
|
+
</Prose>
|
|
84
|
+
</DocsLayout>
|
|
85
|
+
</DemoShell>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Do
|
|
89
|
+
- Give `nav` the docs pages in reading order, in groups: each group's `title` over its links, a group with no title at the top. `navLabel` names the rail and the disclosure it folds behind below `md`.
|
|
90
|
+
- Give `contents` the page's own headings (`id`, `label`, `level` 2 or 3) in order; the layout draws the On this page list, a closed disclosure above the article below `xl` and a sticky column right of it from `xl`. With fewer than two there is no list.
|
|
91
|
+
- `current` is the id of the heading being read, a value the page passes; a site that follows the reader computes it. Left out, no entry is marked.
|
|
92
|
+
- Give `previous` and `next` the pages either side in reading order; they are links, not cards, so they add no heading to the outline.
|
|
93
|
+
- Wrap the article in a `Prose`; its `Section` headings start at `h2` under the layout's `h1`.
|
|
94
|
+
|
|
95
|
+
### Don't
|
|
96
|
+
- Do not hand-build a contents list or a pager beside a `SidebarLayout`: that is `DocsLayout`.
|
|
97
|
+
- Never put a scroll spy in the page to mark the list; pass `current`.
|
|
98
|
+
|
|
99
|
+
A `SidebarLayout` with a hand-built contents list and pager: two copies of the rules every docs site must then keep in step. Use `DocsLayout`.
|
|
100
|
+
```tsx
|
|
101
|
+
import {
|
|
102
|
+
Overline,
|
|
103
|
+
Section,
|
|
104
|
+
SidebarLayout,
|
|
105
|
+
Stack,
|
|
106
|
+
Tabs,
|
|
107
|
+
Text,
|
|
108
|
+
TextLink,
|
|
109
|
+
} from "@slashsuite/ui-react";
|
|
110
|
+
|
|
111
|
+
<SidebarLayout
|
|
112
|
+
aside={
|
|
113
|
+
<Tabs
|
|
114
|
+
orientation="vertical"
|
|
115
|
+
label="Guides"
|
|
116
|
+
items={[{ label: "Install", href: "#install", selected: true }]}
|
|
117
|
+
/>
|
|
118
|
+
}
|
|
119
|
+
>
|
|
120
|
+
<Stack gap="md">
|
|
121
|
+
<nav aria-label="Contents">
|
|
122
|
+
<Overline>Contents</Overline>
|
|
123
|
+
<TextLink href="#dont-setup">Setup</TextLink> <TextLink href="#dont-run">Run</TextLink>
|
|
124
|
+
</nav>
|
|
125
|
+
<Section id="dont-setup" title="Setup">
|
|
126
|
+
<Text>Add the package.</Text>
|
|
127
|
+
</Section>
|
|
128
|
+
<TextLink href="#first-build">Next: First build</TextLink>
|
|
129
|
+
</Stack>
|
|
130
|
+
</SidebarLayout>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Accessibility
|
|
134
|
+
- The rail is an `<aside>` named `navLabel`; each group is a `<nav>` named by its title (the top group by `navLabel`), and the current page has `aria-current="page"`.
|
|
135
|
+
- The title is the page's one `h1`.
|
|
136
|
+
- The On this page list is one `<nav>` named `contentsLabel` at every width, so there is one copy of each link; the entry for `current` has `aria-current="location"`.
|
|
137
|
+
- Previous and next are one `<nav>` named from `previousLabel` and `nextLabel`; each link's name is its visible text, the word then the page ("Previous Install").
|
|
138
|
+
|
|
139
|
+
### Props
|
|
140
|
+
### DocsLayout
|
|
141
|
+
A docs page: a `SidebarLayout` whose rail is the docs `nav` (each group's title over its links, folded behind a disclosure named `navLabel` below `md`), and a canvas of the page's title, an "On this page" list of its `contents`, the article and the previous and next links. The contents list is rendered once: from `xl` a 12rem column right of the article that sticks under the header, below `xl` a closed disclosure above the article. `current` marks the heading being read; it is a value the page passes (a site that follows the reader computes it), with no scroll spy inside. The previous and next links are links, not cards, so they add no heading to the page's outline.
|
|
142
|
+
- breadcrumbs: ReactNode. A `Breadcrumbs` above the title.
|
|
143
|
+
- children: ReactNode (required). The article. Wrap long text in a `Prose`.
|
|
144
|
+
- contents: DocsHeading[] (default []). The page's own headings, in order. With fewer than two there is no "On this page" list.
|
|
145
|
+
- contentsLabel: string (default On this page). The contents list's name and its label.
|
|
146
|
+
- current: string. The id of the heading being read: its entry is marked (`aria-current="location"`). A value the page passes, never tracked inside.
|
|
147
|
+
- description: ReactNode. The line under the title (a `Lead`).
|
|
148
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
149
|
+
- nav: DocsNavGroup[] (required). The docs nav, in reading order: each group's title over a vertical pill list of its pages.
|
|
150
|
+
- navLabel: string (required). Names the nav's landmark, and the disclosure it folds behind below `md` ("Docs", "All components").
|
|
151
|
+
- next: DocsNeighbour. The page after this one in reading order.
|
|
152
|
+
- nextLabel: string (default Next). The word over the next page's label.
|
|
153
|
+
- previous: DocsNeighbour. The page before this one in reading order.
|
|
154
|
+
- previousLabel: string (default Previous). The word over the previous page's label.
|
|
155
|
+
- title: ReactNode (required). The page's title, its `h1`.
|
|
156
|
+
|
|
157
|
+
### Types
|
|
158
|
+
- DocsHeading: `{ id: string; label: string; level: 2 | 3 }`. One entry of "On this page": a heading's id, its text and its level.
|
|
159
|
+
- DocsNavGroup: `{ title?: string; items: Tab[] }`. One group of the docs nav: a title over its links (`Tab`s with an `href`). A group with no title is the nav's top.
|
|
160
|
+
- DocsNeighbour: `{ label: string; href: string }`. The page before or after this one in reading order.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
## Drawer
|
|
2
|
+
|
|
3
|
+
Group: Feedback
|
|
4
|
+
|
|
5
|
+
When to use: A record or a form the reader works on beside the page, with actions that stay in view.
|
|
6
|
+
|
|
7
|
+
### Use instead
|
|
8
|
+
- Dialog (dialog.md): A question, or a short form, must be answered before going on.
|
|
9
|
+
- BottomSheet (bottom-sheet.md): Content sits over a map or a canvas that must stay usable: not modal.
|
|
10
|
+
- FieldDialog (field-dialog.md): Only one text value is asked for.
|
|
11
|
+
|
|
12
|
+
### The one right way
|
|
13
|
+
A record or a form beside the page: the title names it, the body scrolls and the actions stay pinned in `footer`.
|
|
14
|
+
```tsx
|
|
15
|
+
import { useState } from "react";
|
|
16
|
+
import { Button, Drawer, KeyValue, KeyValueList } from "@slashsuite/ui-react";
|
|
17
|
+
|
|
18
|
+
function Example() {
|
|
19
|
+
const [open, setOpen] = useState(false);
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<Button variant="outline" onClick={() => setOpen(true)}>
|
|
23
|
+
Open HC-65
|
|
24
|
+
</Button>
|
|
25
|
+
{open && (
|
|
26
|
+
<Drawer
|
|
27
|
+
title="HC-65 · Tabs"
|
|
28
|
+
onClose={() => setOpen(false)}
|
|
29
|
+
footer={
|
|
30
|
+
<>
|
|
31
|
+
<Button variant="ghost" onClick={() => setOpen(false)}>
|
|
32
|
+
Cancel
|
|
33
|
+
</Button>
|
|
34
|
+
<Button onClick={() => setOpen(false)}>Save</Button>
|
|
35
|
+
</>
|
|
36
|
+
}
|
|
37
|
+
>
|
|
38
|
+
<KeyValueList>
|
|
39
|
+
<KeyValue label="Status">In progress</KeyValue>
|
|
40
|
+
<KeyValue label="Owner">Jacobus</KeyValue>
|
|
41
|
+
</KeyValueList>
|
|
42
|
+
</Drawer>
|
|
43
|
+
)}
|
|
44
|
+
</>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Do
|
|
50
|
+
- Render it only while it is open: `{open && <Drawer … onClose={() => setOpen(false)} />}`. It opens itself on mount.
|
|
51
|
+
- Use it for a record to read or edit, or a form with several fields; a yes-or-no question is a `Dialog`.
|
|
52
|
+
- The actions go in `footer`, pinned under the body, which scrolls between the header and the footer.
|
|
53
|
+
- `width` is `sm`, `md` (the default) or `lg`; choose by the content, `sm` for one field and `lg` for a table. `description` is a muted line under the title, as on a `Dialog`.
|
|
54
|
+
- Set `closeLabel` to the reader's language when the page is not in English.
|
|
55
|
+
- It slides out again on close, but only while it is still in the DOM, so `onClose` is called once the exit has finished: put `setOpen(false)` there and nowhere else. Esc, the scrim and the close button close it that way already. A Cancel or Save button in the `footer` closes it by calling `.close()` on its `<dialog>`, which a click handler finds with `event.currentTarget.closest("dialog")`. A button that calls `setOpen(false)` itself unmounts the drawer at once, with no exit animation. After async work, keep the `<dialog>` from the event before the `await` and call `.close()` when it resolves.
|
|
56
|
+
|
|
57
|
+
### Don't
|
|
58
|
+
A yes-or-no question is a `Dialog`: a full-height panel for one confirmation is more than it asks.
|
|
59
|
+
```tsx
|
|
60
|
+
import { useState } from "react";
|
|
61
|
+
import { Button, Drawer, Text } from "@slashsuite/ui-react";
|
|
62
|
+
|
|
63
|
+
function Example() {
|
|
64
|
+
const [open, setOpen] = useState(false);
|
|
65
|
+
return (
|
|
66
|
+
<>
|
|
67
|
+
<Button variant="outline" onClick={() => setOpen(true)}>
|
|
68
|
+
Delete build
|
|
69
|
+
</Button>
|
|
70
|
+
{open && (
|
|
71
|
+
<Drawer
|
|
72
|
+
title="Delete build?"
|
|
73
|
+
width="sm"
|
|
74
|
+
onClose={() => setOpen(false)}
|
|
75
|
+
footer={<Button onClick={() => setOpen(false)}>Delete</Button>}
|
|
76
|
+
>
|
|
77
|
+
<Text>This removes the build and every snapshot in it.</Text>
|
|
78
|
+
</Drawer>
|
|
79
|
+
)}
|
|
80
|
+
</>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
A Save in the body scrolls out of view with a long form and leaves the footer empty.
|
|
86
|
+
```tsx
|
|
87
|
+
import { useState } from "react";
|
|
88
|
+
import { Button, Drawer, Field, Input, Stack } from "@slashsuite/ui-react";
|
|
89
|
+
|
|
90
|
+
function Example() {
|
|
91
|
+
const [open, setOpen] = useState(false);
|
|
92
|
+
return (
|
|
93
|
+
<>
|
|
94
|
+
<Button variant="outline" onClick={() => setOpen(true)}>
|
|
95
|
+
Rename
|
|
96
|
+
</Button>
|
|
97
|
+
{open && (
|
|
98
|
+
<Drawer title="Rename" width="sm" onClose={() => setOpen(false)}>
|
|
99
|
+
<Stack>
|
|
100
|
+
<Field label="Name" htmlFor="drawer-rename-body">
|
|
101
|
+
<Input id="drawer-rename-body" defaultValue="Hack Cove" />
|
|
102
|
+
</Field>
|
|
103
|
+
<Button onClick={() => setOpen(false)}>Save</Button>
|
|
104
|
+
</Stack>
|
|
105
|
+
</Drawer>
|
|
106
|
+
)}
|
|
107
|
+
</>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Accessibility
|
|
113
|
+
- A Drawer is the browser's own `<dialog>` opened with `showModal()`: the page behind goes inert, focus stays inside it and Esc closes it.
|
|
114
|
+
- It is named by its `title`, an `h2`, through `aria-labelledby`.
|
|
115
|
+
- The header's close button is an `IconButton` named by `closeLabel` ("Close" by default); a click on the scrim closes it too.
|
|
116
|
+
- Closing, or unmounting it, hands focus back to the element that opened it.
|
|
117
|
+
- The slide in and out is switched off under `prefers-reduced-motion: reduce`, and then it closes at once.
|
|
118
|
+
|
|
119
|
+
### Props
|
|
120
|
+
### Drawer
|
|
121
|
+
A modal slide-over anchored to the right edge, on the browser's own `<dialog>`: it is opened with `showModal()` on mount, so render it only while it is open. The page behind goes inert, Esc closes it and focus stays inside; a click on the scrim (the `<dialog>` element itself, not its contents) closes it too. The header holds the title, an optional `description` under it and a close button; the body scrolls between it and an optional pinned `footer`.
|
|
122
|
+
- closeLabel: string (default Close). The accessible name of the close button.
|
|
123
|
+
- description: ReactNode. A muted line under the title, as on a `Dialog`.
|
|
124
|
+
- footer: ReactNode. Actions pinned under the scrolling body, right-aligned.
|
|
125
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
126
|
+
- onClose: () => void (required). Called when the drawer closes: Esc, a click on the scrim or the close button.
|
|
127
|
+
- title: ReactNode (required). The drawer's accessible name, shown as its heading.
|
|
128
|
+
- width: "sm" | "md" | "lg" (default md). The panel's width: `md` holds a form or a record; `sm` (320px) is narrower and `lg` (640px) wider.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
## EmptyState
|
|
2
|
+
|
|
3
|
+
Group: Feedback
|
|
4
|
+
|
|
5
|
+
When to use: A whole page or list with no content yet: say what belongs here and offer the first step.
|
|
6
|
+
|
|
7
|
+
### Use instead
|
|
8
|
+
- Callout (callout.md): There is content, and a line or two about it must be seen.
|
|
9
|
+
- Status pages (status-pages.md): The route itself cannot show, not just its content.
|
|
10
|
+
|
|
11
|
+
### The one right way
|
|
12
|
+
An empty page says what belongs here and offers the first step as the primary action.
|
|
13
|
+
```tsx
|
|
14
|
+
import { Button, EmptyState, Text } from "@slashsuite/ui-react";
|
|
15
|
+
|
|
16
|
+
<EmptyState title="No builds yet" actions={<Button>Create a project</Button>}>
|
|
17
|
+
<Text>Builds appear here once a project has uploaded its first capture.</Text>
|
|
18
|
+
</EmptyState>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Do
|
|
22
|
+
- Give it a `title`, one `Text` that says what belongs here, and the first step as `actions`, with the primary `Button` first.
|
|
23
|
+
- For a get-started list, put `Steps` after the `Text` in the children.
|
|
24
|
+
- The title's heading level comes from where it sits: an `h2` on the page, an `h3` in a `Section`, so the outline does not skip or repeat; `level` sets it by hand and the look does not change.
|
|
25
|
+
- On its own it draws a dashed frame round itself; inside a `Card` the card is the frame. `icon` sets one of the library's icons above the title.
|
|
26
|
+
- It is the one empty look. Give it to the part's `empty` slot (`ListLayout`, `CardGrid`, `ChatThread`, `TableBody`, `Timeline`, a `Stack as="ul"`), which shows it when the part has no children: `empty={<EmptyState title="No invoices yet." />}` everywhere.
|
|
27
|
+
- The slot picks the size: one muted line (`size="sm"`, no heading) in a `TableBody`, a `Timeline` or a `Stack as="ul"`; the titled block (`md`) on a page, in a `CardGrid` or a `ChatThread`. `size` sets it by hand.
|
|
28
|
+
- `padding="inset"` pads all four sides, for an EmptyState in a `Card flush`, whose body has no padding of its own; the default pads above and below.
|
|
29
|
+
|
|
30
|
+
### Don't
|
|
31
|
+
- Do not leave it as a title alone: a page with nothing in it and nothing to do is a dead end.
|
|
32
|
+
|
|
33
|
+
A bare "Nothing here" is a dead end: it does not say what belongs here or what to do next.
|
|
34
|
+
```tsx
|
|
35
|
+
import { EmptyState } from "@slashsuite/ui-react";
|
|
36
|
+
|
|
37
|
+
<EmptyState title="Nothing here" />
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
A muted `Text` written by hand is a second empty look, and it stays on screen when the list fills.
|
|
42
|
+
```tsx
|
|
43
|
+
import { Card, Text } from "@slashsuite/ui-react";
|
|
44
|
+
|
|
45
|
+
<Card title="Builds">
|
|
46
|
+
<Text tone="muted">No builds yet.</Text>
|
|
47
|
+
</Card>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Accessibility
|
|
51
|
+
- At `md` an EmptyState is a `<section>` named by its `title`, which is an `h2` unless `level` says otherwise, so it is a landmark region a screen reader can jump to.
|
|
52
|
+
- At `sm` it is a plain block whose title is a paragraph, so a table cell or a list adds no heading or region to the outline.
|
|
53
|
+
- The actions are ordinary buttons and links, in reading order after the explanation.
|
|
54
|
+
|
|
55
|
+
### Props
|
|
56
|
+
### EmptyState
|
|
57
|
+
The one empty look: what a list, a table or a page shows when there is nothing in it yet. Give it to the part's `empty` slot (`ListLayout`, `CardGrid`, `TableBody`, `Timeline`, `ChatThread`, a `Stack as="ul"`), which shows it when the part has no children and picks its size. `md` is a centred `title`, the `children` as the explanation under it (a `Text`, then `Steps` for a "get started" list), and `actions` (buttons, links) in a centred row at the bottom, with an optional `icon` above the title. A named `<section>`. On its own it draws a dashed frame round itself; inside a `Card` the card is the frame. `level` is the title's heading level, one below the heading that holds it: a 2 on the page, a 3 in a `Section`. `sm` is the one-line form for inside a table, a timeline or a list: the title as one centred muted line, the `children` under it in the same small text and the `actions` after. It is a plain block with no heading and no landmark, so a table cell or a card does not grow a region.
|
|
58
|
+
- actions: ReactNode. Buttons or links in a centred row at the bottom.
|
|
59
|
+
- icon: "page" | "grid" | "search" | "table" | "type" | "diff" | "baseline" | "review" | "ci" | "self-host" | "privacy" | "capture" | "branch" | "theme" | "speed" | "chevron-right" | "chevron-down" | "close" | "external-link" | "settings" | "bell" | "check" | "plus" | "more" | "window" | "card" | "pointer" | "field" | "compass" | "briefcase". One of the library's icons, at feature size in the muted ink above the title.
|
|
60
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
61
|
+
- level: 2 | 3 | 4 | 5 | 6 (default one below the heading that holds it: 2 on the page). The title's heading level, 2 to 6. It does not change how the title looks.
|
|
62
|
+
- padding: "default" | "inset" (default default). `inset` pads all four sides, for an empty state in a `Card flush`, whose body has no padding
|
|
63
|
+
of its own. `default` pads above and below only. On its own, outside a card, it pads all four
|
|
64
|
+
sides inside its frame either way.
|
|
65
|
+
- size: "sm" | "md" (default the slot's: sm in a TableBody, a Timeline or a Stack as="ul", else md). `md` is the titled block; `sm` one muted line with no heading, for inside a table, a timeline or
|
|
66
|
+
a list. `icon` and `level` do nothing at `sm`.
|
|
67
|
+
- title: ReactNode (required). The heading, centred: what is missing ("No projects yet"). It names the section.
|