@slashsuite/ui-react 0.12.0 → 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 +12 -0
- 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,65 @@
|
|
|
1
|
+
## Select
|
|
2
|
+
|
|
3
|
+
Group: Forms
|
|
4
|
+
|
|
5
|
+
When to use: One choice from a list of about five or more: a category, a country, a rating.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
Choosing one of several is a `Select` in a `Field`.
|
|
9
|
+
```tsx
|
|
10
|
+
import { Field, Select } from "@slashsuite/ui-react";
|
|
11
|
+
|
|
12
|
+
<Field label="Category" htmlFor="do-category">
|
|
13
|
+
<Select
|
|
14
|
+
id="do-category"
|
|
15
|
+
defaultValue="books"
|
|
16
|
+
items={[
|
|
17
|
+
{ value: "books", label: "Books" },
|
|
18
|
+
{ value: "clothes", label: "Clothes" },
|
|
19
|
+
{ value: "furniture", label: "Furniture" },
|
|
20
|
+
{ value: "records", label: "Records" },
|
|
21
|
+
{ value: "toys", label: "Toys" },
|
|
22
|
+
]}
|
|
23
|
+
/>
|
|
24
|
+
</Field>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Do
|
|
28
|
+
- Put a `Select` in a `Field` and give it its choices as `items` (`{ value, label, disabled? }`); set `defaultValue` or control it with `value` and `onChange`.
|
|
29
|
+
- A yes or no is a `Checkbox`.
|
|
30
|
+
- Two to five modes switched in place are a `SegmentedControl`.
|
|
31
|
+
- `size` and `width` are the same choices as on `Input`.
|
|
32
|
+
|
|
33
|
+
### Don't
|
|
34
|
+
A yes or no is not a choice from a list: it is a `Checkbox`.
|
|
35
|
+
```tsx
|
|
36
|
+
import { Field, Select } from "@slashsuite/ui-react";
|
|
37
|
+
|
|
38
|
+
<Field label="Open now" htmlFor="dont-open">
|
|
39
|
+
<Select
|
|
40
|
+
id="dont-open"
|
|
41
|
+
defaultValue="yes"
|
|
42
|
+
items={[
|
|
43
|
+
{ value: "yes", label: "Yes" },
|
|
44
|
+
{ value: "no", label: "No" },
|
|
45
|
+
]}
|
|
46
|
+
/>
|
|
47
|
+
</Field>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Accessibility
|
|
51
|
+
- A `Select` is a native `<select>`, so it keeps the browser's arrow, its keyboard handling and its mobile picker.
|
|
52
|
+
- In a `Field`, the `Field` around it gives it its label and its hint or error as `aria-describedby`, and an error marks it `aria-invalid` with a red edge.
|
|
53
|
+
- The focus ring comes from the component.
|
|
54
|
+
|
|
55
|
+
### Props
|
|
56
|
+
### Select
|
|
57
|
+
A native `<select>` styled like `Input`, keeping the browser's own arrow, over its `items`. Takes `size` and `width` too: inside a `Field` it fills the row, and on its own it is as wide as its longest choice. The `ref` reaches the `<select>`.
|
|
58
|
+
- disabled: boolean (native). Disables the select; say why in its `Field` hint.
|
|
59
|
+
- items: readonly { value: string; label: string; disabled?: boolean }[] (required). The choices, in order.
|
|
60
|
+
- name: string (native). The key the value posts under in a form.
|
|
61
|
+
- ref: Ref<HTMLSelectElement>. The `<select>` itself, for focus control.
|
|
62
|
+
- size: "sm" | "md" | "lg" (default md). `sm` is compact, `text-sm` with less padding, for dense forms and table rows; `md` is `text-base`;
|
|
63
|
+
`lg` is `text-lg` with more padding, for a hero form. Under an `AppShell density="compact"` each
|
|
64
|
+
is one type step down, and on a touch screen a field is never under 16px.
|
|
65
|
+
- width: "sm" | "md" | "lg" | "xs" | "auto" | "fill" | "full" (default full inside a `Field`, `auto` outside one). As an `Input`'s `width`.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
## Show
|
|
2
|
+
|
|
3
|
+
Group: Layout
|
|
4
|
+
|
|
5
|
+
When to use: Content that only fits a wide screen, and its narrow-screen form: a table from `sm`, a stack of cards below it.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
A table that only fits a wide screen is in a `Show from`; its phone form, a stack of rows, is in a `Show below` at the same breakpoint.
|
|
9
|
+
```tsx
|
|
10
|
+
import {
|
|
11
|
+
Card,
|
|
12
|
+
ListRow,
|
|
13
|
+
Show,
|
|
14
|
+
Stack,
|
|
15
|
+
Table,
|
|
16
|
+
TableBody,
|
|
17
|
+
TableCell,
|
|
18
|
+
TableHead,
|
|
19
|
+
TableHeaderCell,
|
|
20
|
+
TableRow,
|
|
21
|
+
} from "@slashsuite/ui-react";
|
|
22
|
+
|
|
23
|
+
<Stack>
|
|
24
|
+
<Show below="sm">
|
|
25
|
+
<Card flush>
|
|
26
|
+
<Stack as="ul" divided aria-label="Builds">
|
|
27
|
+
<li>
|
|
28
|
+
<ListRow secondary="main, 3 changed">Build 412</ListRow>
|
|
29
|
+
</li>
|
|
30
|
+
<li>
|
|
31
|
+
<ListRow secondary="main, no changes">Build 411</ListRow>
|
|
32
|
+
</li>
|
|
33
|
+
</Stack>
|
|
34
|
+
</Card>
|
|
35
|
+
</Show>
|
|
36
|
+
<Show from="sm">
|
|
37
|
+
<Table label="Builds">
|
|
38
|
+
<TableHead>
|
|
39
|
+
<TableRow>
|
|
40
|
+
<TableHeaderCell>Build</TableHeaderCell>
|
|
41
|
+
<TableHeaderCell>Branch</TableHeaderCell>
|
|
42
|
+
<TableHeaderCell numeric>Changed</TableHeaderCell>
|
|
43
|
+
</TableRow>
|
|
44
|
+
</TableHead>
|
|
45
|
+
<TableBody>
|
|
46
|
+
<TableRow>
|
|
47
|
+
<TableCell>Build 412</TableCell>
|
|
48
|
+
<TableCell mono>main</TableCell>
|
|
49
|
+
<TableCell numeric>3</TableCell>
|
|
50
|
+
</TableRow>
|
|
51
|
+
<TableRow>
|
|
52
|
+
<TableCell>Build 411</TableCell>
|
|
53
|
+
<TableCell mono>main</TableCell>
|
|
54
|
+
<TableCell numeric>0</TableCell>
|
|
55
|
+
</TableRow>
|
|
56
|
+
</TableBody>
|
|
57
|
+
</Table>
|
|
58
|
+
</Show>
|
|
59
|
+
</Stack>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Do
|
|
63
|
+
- Content that only fits a wide screen is in a `Show from`; its narrow-screen form is in a `Show below` at the same breakpoint: `<Show below="sm">{cards}</Show><Show from="sm">{table}</Show>`.
|
|
64
|
+
- Give exactly one of `from` or `below`, each `sm`, `md` or `lg`. There is no default: the reader sees the rule.
|
|
65
|
+
- `as="span"` inside phrasing content: a run in a `<p>`, a `Kbd` hint in a button row.
|
|
66
|
+
- The wrapper adds no box, so its children sit in the parent's row, grid or `Stack` and the parent's gap spaces them. To keep two items together, put a `Cluster` inside the `Show`.
|
|
67
|
+
- Hidden content stays mounted, so two `Show`s of one stateful panel mount it twice. A panel shown at every width that folds on a phone is a `SideColumn asideLabel`, not two `Show`s.
|
|
68
|
+
|
|
69
|
+
### Don't
|
|
70
|
+
- Never write `hidden sm:block` or `sm:hidden` in an app: the breakpoint is a `Show`.
|
|
71
|
+
|
|
72
|
+
The same table at every width squashes on a phone and scrolls sideways; never hide it with a class of your own either.
|
|
73
|
+
```tsx
|
|
74
|
+
import {
|
|
75
|
+
Table,
|
|
76
|
+
TableBody,
|
|
77
|
+
TableCell,
|
|
78
|
+
TableHead,
|
|
79
|
+
TableHeaderCell,
|
|
80
|
+
TableRow,
|
|
81
|
+
} from "@slashsuite/ui-react";
|
|
82
|
+
|
|
83
|
+
<Table label="Builds">
|
|
84
|
+
<TableHead>
|
|
85
|
+
<TableRow>
|
|
86
|
+
<TableHeaderCell>Build</TableHeaderCell>
|
|
87
|
+
<TableHeaderCell>Branch</TableHeaderCell>
|
|
88
|
+
<TableHeaderCell numeric>Changed</TableHeaderCell>
|
|
89
|
+
</TableRow>
|
|
90
|
+
</TableHead>
|
|
91
|
+
<TableBody>
|
|
92
|
+
<TableRow>
|
|
93
|
+
<TableCell>Build 412</TableCell>
|
|
94
|
+
<TableCell mono>main</TableCell>
|
|
95
|
+
<TableCell numeric>3</TableCell>
|
|
96
|
+
</TableRow>
|
|
97
|
+
<TableRow>
|
|
98
|
+
<TableCell>Build 411</TableCell>
|
|
99
|
+
<TableCell mono>main</TableCell>
|
|
100
|
+
<TableCell numeric>0</TableCell>
|
|
101
|
+
</TableRow>
|
|
102
|
+
</TableBody>
|
|
103
|
+
</Table>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Accessibility
|
|
107
|
+
- Hidden is `display: none`: the content is out of the accessibility tree and the tab order, so a table hidden on a phone is not read out there.
|
|
108
|
+
- The reading order is the source order; `Show` moves nothing.
|
|
109
|
+
- It is CSS only, the same markup on the server and the client, so it works before the page hydrates and with no script.
|
|
110
|
+
|
|
111
|
+
### Props
|
|
112
|
+
### Show
|
|
113
|
+
Shows its children only from a width up (`from`) or only below it (`below`), by CSS alone: the same markup on the server and the client, with no script. Hidden is `display: none`, so the content is out of the accessibility tree and the tab order too. Shown, the wrapper adds no box, so the children sit in the parent's row, grid or Stack and take its gap. Content that only fits a wide screen is in a `Show from`; its narrow-screen form is in a `Show below` at the same breakpoint. Hidden content stays mounted, so two `Show`s of the same content mount it twice: a stateful panel shown at every width with a fold is a `SideColumn asideLabel`. `as="span"` is for phrasing content (inside a `<p>` or a button row).
|
|
114
|
+
- as: "div" | "span" (default div). The element: `div`, or `span` inside phrasing content.
|
|
115
|
+
- below: "sm" | "md" | "lg". Shown below this width, gone from it up.
|
|
116
|
+
- from: "sm" | "md" | "lg". Shown from this width up, gone below it.
|
|
117
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
118
|
+
|
|
119
|
+
### Types
|
|
120
|
+
- Breakpoint: `"sm" | "md" | "lg"`. A width step: `sm` 640px, `md` 768px, `lg` 1024px.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
## SideColumn
|
|
2
|
+
|
|
3
|
+
Group: Layout
|
|
4
|
+
|
|
5
|
+
When to use: Any main area beside a side panel, such as a thread beside its assistant or a record beside its facts; a whole page with a header is `DetailLayout`, which is this split under a `PageHeader`.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
A main area and a side column of a known width are a `SideColumn`: the aside is exactly as wide as `asideWidth`, whatever it holds.
|
|
9
|
+
```tsx
|
|
10
|
+
import { Card, SideColumn, Text } from "@slashsuite/ui-react";
|
|
11
|
+
|
|
12
|
+
<SideColumn
|
|
13
|
+
aside={
|
|
14
|
+
<Card title="Reply agent">
|
|
15
|
+
<Text>Ask for a draft, then edit it before it is sent.</Text>
|
|
16
|
+
</Card>
|
|
17
|
+
}
|
|
18
|
+
>
|
|
19
|
+
<Card title="Thread">
|
|
20
|
+
<Text>The main area takes everything the aside leaves.</Text>
|
|
21
|
+
</Card>
|
|
22
|
+
</SideColumn>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Do
|
|
26
|
+
- `children` are the main area and `aside` is the side column. From `lg` the aside is `asideWidth` wide on the right and the main area takes the room left; below `lg` the aside stacks under the main area.
|
|
27
|
+
- `asideWidth` is `sm` (18rem), `md` (24rem, the default) or `third` (one third of the row, the main area two thirds). `sm` and `md` are exact, whatever the aside holds; there is no other width.
|
|
28
|
+
- `sticky` keeps the aside in view from `lg` as a long page scrolls: it sticks under the header and, when it is taller than the screen, scrolls itself.
|
|
29
|
+
- `asideLabel` is for an aside that should not take a phone's screen: below `lg` it folds, closed, behind a disclosure of that name, and from `lg` it is the same column, always shown, with no toggle. The aside stays mounted while folded, so state inside it is kept. Left out, the aside is always shown. It also names the aside's landmark.
|
|
30
|
+
- It sets no page width, padding or header of its own: put it inside a layout, a `Card` or a panel. Space inside each column with a `Stack`.
|
|
31
|
+
- `DetailLayout`'s aside is a `SideColumn asideWidth="third"`, so a split inside a page that wants the thirds is `SideColumn asideWidth="third"`, never a `CardGrid`. A rail of links on the left is `SidebarLayout`. A `Stack` with `rowFrom` and a `ClusterGrow` sizes the side by its content, so it is not a fixed column.
|
|
32
|
+
|
|
33
|
+
### Don't
|
|
34
|
+
A `Stack` with `rowFrom` and a `ClusterGrow` sizes the side by its content: a long line makes it wide and takes the room from the main area.
|
|
35
|
+
```tsx
|
|
36
|
+
import { Card, ClusterGrow, Overline, Stack, Text } from "@slashsuite/ui-react";
|
|
37
|
+
|
|
38
|
+
<Stack rowFrom="lg">
|
|
39
|
+
<ClusterGrow>
|
|
40
|
+
<Card title="Thread">
|
|
41
|
+
<Text>The main area takes what is left.</Text>
|
|
42
|
+
</Card>
|
|
43
|
+
</ClusterGrow>
|
|
44
|
+
<Card>
|
|
45
|
+
<Overline>Reply agent</Overline>
|
|
46
|
+
<Text>
|
|
47
|
+
Whatever width the aside's text wants is the width it takes, so it changes with its words.
|
|
48
|
+
</Text>
|
|
49
|
+
</Card>
|
|
50
|
+
</Stack>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Accessibility
|
|
54
|
+
- The side column is an `<aside>`, a complementary landmark; the main area is a plain `div`. Give the aside a heading, or set `asideLabel`, which also names it, when it needs a name.
|
|
55
|
+
- In the DOM the main area comes first and the aside second, so that is the reading and tab order on every screen.
|
|
56
|
+
- A `sticky` aside that is taller than the screen and holds no link or field takes a tab stop of its own, named by `asideLabel`, so the keyboard can scroll it.
|
|
57
|
+
- With `asideLabel` the aside is a native `<details>` disclosure below `lg`: its `<summary>` is the toggle, on the keyboard like any button. From `lg` the summary is gone and, once the page has loaded, the `<details>` is open for real, so the aside is in the accessibility tree.
|
|
58
|
+
|
|
59
|
+
### Props
|
|
60
|
+
### SideColumn
|
|
61
|
+
A main area beside a side column, in the Container the page already has: from `lg` the `aside` is `asideWidth` on the right and `children` take the room left; below `lg` the aside stacks under `children`. It sets no page width, padding or header of its own, so it sits inside a layout, a `Card` or a panel. `asideWidth` is `sm` (18rem), `md` (24rem) or `third` (one third of the row, the main area two thirds: the split `DetailLayout` draws). A rail of links on the left is `SidebarLayout`. `asideLabel` is for an aside that should not take the phone's screen: below `lg` it folds, closed, behind a native disclosure of that name, and from `lg` it is the same column, always shown. The aside stays mounted while folded, so a conversation or a draft inside it is kept. `sticky` keeps the aside in view from `lg` as a long page scrolls: it sticks under AppShell's header and, if it is taller than the room left, scrolls itself (a tab stop named by `asideLabel`) so its end stays reachable.
|
|
62
|
+
- aside: ReactNode (required). The side column: `asideWidth` wide on the right from `lg`, under `children` below it.
|
|
63
|
+
- asideLabel: string. Folds the aside behind a disclosure with this name below `lg`, and names the `<aside>` landmark. Left out, the aside is always shown and unnamed.
|
|
64
|
+
- asideWidth: "sm" | "md" | "third" (default md). The aside's width from `lg`: `sm` 18rem, `md` 24rem, or `third`, one third of the row.
|
|
65
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
66
|
+
- sticky: boolean (default false). From `lg`, keeps the aside in view under the header as the page scrolls; an aside taller than
|
|
67
|
+
the screen scrolls inside itself.
|
|
68
|
+
|
|
69
|
+
### Types
|
|
70
|
+
- SideColumnWidth: `"sm" | "md" | "third"`. How wide a `SideColumn`'s aside is from `lg`: `sm` 18rem, `md` 24rem, or `third` a third of the row.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
## SidebarLayout
|
|
2
|
+
|
|
3
|
+
Group: Page layouts
|
|
4
|
+
|
|
5
|
+
When to use: A section with several sub-pages, such as settings, where the rail is the way between them.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
A vertical pill `Tabs` is the rail: a short list of sections beside the page.
|
|
9
|
+
```tsx
|
|
10
|
+
import { Card, Tabs, PageHeader, SidebarLayout, Text } from "@slashsuite/ui-react";
|
|
11
|
+
|
|
12
|
+
<SidebarLayout
|
|
13
|
+
aside={
|
|
14
|
+
<Tabs
|
|
15
|
+
orientation="vertical"
|
|
16
|
+
label="Settings"
|
|
17
|
+
items={[
|
|
18
|
+
{ label: "Profile", href: "#profile", selected: true },
|
|
19
|
+
{ label: "Billing", href: "#billing" },
|
|
20
|
+
{ label: "Team", href: "#team" },
|
|
21
|
+
]}
|
|
22
|
+
/>
|
|
23
|
+
}
|
|
24
|
+
>
|
|
25
|
+
<PageHeader title="Profile" description="Your name and email." />
|
|
26
|
+
<Card title="Account">
|
|
27
|
+
<Text>Naledi Mokoena, naledi@example.com</Text>
|
|
28
|
+
</Card>
|
|
29
|
+
</SidebarLayout>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Full page
|
|
33
|
+
A whole page with a rail: the shell with its brand and nav, then the layout with a vertical `Tabs` in `aside` and the page in `children`.
|
|
34
|
+
```tsx
|
|
35
|
+
import {
|
|
36
|
+
AppShell,
|
|
37
|
+
Button,
|
|
38
|
+
Card,
|
|
39
|
+
Tabs,
|
|
40
|
+
PageHeader,
|
|
41
|
+
SidebarLayout,
|
|
42
|
+
Text,
|
|
43
|
+
} from "@slashsuite/ui-react";
|
|
44
|
+
|
|
45
|
+
<AppShell
|
|
46
|
+
brand={<a href="#">Hack Cove</a>}
|
|
47
|
+
nav={
|
|
48
|
+
<Tabs
|
|
49
|
+
label="Main"
|
|
50
|
+
items={[
|
|
51
|
+
{ label: "Quotes", href: "#quotes", selected: true },
|
|
52
|
+
{ label: "Clients", href: "#clients" },
|
|
53
|
+
]}
|
|
54
|
+
/>
|
|
55
|
+
}
|
|
56
|
+
>
|
|
57
|
+
<SidebarLayout
|
|
58
|
+
aside={
|
|
59
|
+
<Tabs
|
|
60
|
+
orientation="vertical"
|
|
61
|
+
label="Organisations"
|
|
62
|
+
items={[
|
|
63
|
+
{ label: "Hack Cove", href: "#hack-cove", selected: true },
|
|
64
|
+
{ label: "Acme", href: "#acme" },
|
|
65
|
+
{ label: "Northwind", href: "#northwind" },
|
|
66
|
+
]}
|
|
67
|
+
/>
|
|
68
|
+
}
|
|
69
|
+
>
|
|
70
|
+
<PageHeader
|
|
71
|
+
title="Hack Cove"
|
|
72
|
+
description="3 projects"
|
|
73
|
+
actions={<Button>New project</Button>}
|
|
74
|
+
/>
|
|
75
|
+
<Card title="Projects">
|
|
76
|
+
<Text>Storybook, Dashboard, Site.</Text>
|
|
77
|
+
</Card>
|
|
78
|
+
</SidebarLayout>
|
|
79
|
+
</AppShell>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Do
|
|
83
|
+
- The `aside` is `Tabs` of links with `orientation="vertical"` (the pill rail), one link per section and the current one `selected`.
|
|
84
|
+
- The `children` are the section's page: its `PageHeader`, then the content.
|
|
85
|
+
- From `md` the rail is a fixed width beside the page; below it, the rail stacks above the page.
|
|
86
|
+
- From `md` the rail stays in view under the shell's header as a long page scrolls, with or without `asideLabel`; it is always on, not an option. A rail taller than the screen scrolls inside itself, so its last link is reachable. Below `md` nothing sticks.
|
|
87
|
+
- The rail has no background or border: it is a list of links on the page.
|
|
88
|
+
- Once the page has loaded, a rail that scrolls shows its current link (the one with `aria-current`) in view, with its own thin scrollbar, and the folded disclosure reads `asideLabel` and the current link, such as "All components: Button". Nothing to set; in Astro, hydrate the layout (`client:load`).
|
|
89
|
+
- Facts about one record go in `DetailLayout`'s aside, not a rail.
|
|
90
|
+
- A docs site uses `DocsLayout`, which is this rail with the docs page's title, contents list and neighbours fixed.
|
|
91
|
+
|
|
92
|
+
### Don't
|
|
93
|
+
The default, horizontal pill `Tabs` wraps into a ragged block in the rail. Give the rail `orientation="vertical"`.
|
|
94
|
+
```tsx
|
|
95
|
+
import { Card, Tabs, PageHeader, SidebarLayout, Text } from "@slashsuite/ui-react";
|
|
96
|
+
|
|
97
|
+
<SidebarLayout
|
|
98
|
+
aside={
|
|
99
|
+
<Tabs
|
|
100
|
+
label="Settings"
|
|
101
|
+
items={[
|
|
102
|
+
{ label: "Profile", href: "#profile", selected: true },
|
|
103
|
+
{ label: "Billing", href: "#billing" },
|
|
104
|
+
{ label: "Team", href: "#team" },
|
|
105
|
+
]}
|
|
106
|
+
/>
|
|
107
|
+
}
|
|
108
|
+
>
|
|
109
|
+
<PageHeader title="Profile" description="Your name and email." />
|
|
110
|
+
<Card title="Account">
|
|
111
|
+
<Text>Naledi Mokoena, naledi@example.com</Text>
|
|
112
|
+
</Card>
|
|
113
|
+
</SidebarLayout>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Accessibility
|
|
117
|
+
- The rail is an `<aside>` holding the `Tabs`, which is a `<nav>` named by its `label`. `asideLabel` also names the `<aside>`, so a page with a second complementary landmark (a `DetailLayout` aside) can tell them apart.
|
|
118
|
+
- The current link has `aria-current="page"`.
|
|
119
|
+
- In the DOM the rail comes first, so it is first in the tab order; folded, the summary is that first stop and the links are skipped until it is opened.
|
|
120
|
+
- With `asideLabel` the rail is a native `<details>` disclosure: its `<summary>` is the toggle, on the keyboard like any button. From `md` the `<details>` is open for real (after the page loads; before that, and with no JavaScript, the CSS shows it), so the links are in the accessibility tree.
|
|
121
|
+
- A rail that scrolls itself is still in the tab order, and a focus ring on a link in it is not cut off at the rail's edge. A rail of links has no tab stop of its own; a rail that scrolls and holds no link takes one, named by `asideLabel`.
|
|
122
|
+
|
|
123
|
+
### Props
|
|
124
|
+
### SidebarLayout
|
|
125
|
+
An `aside` of links (the rail) beside the `children` canvas, in the Container the shell already gives every page (a plain `<AppShell>`, no `bleed`): the rail starts at the header logo's x and the canvas ends at the header's right edge. The rail has no background and no border, so it is a list of links on the page; a `Tabs orientation="vertical"` is its content. From `md` it is `w-56` with the canvas filling the rest, and it stays in view under the shell's header as a long page scrolls; a rail taller than the screen scrolls itself, so its last link is reachable. Below `md` it stacks above the canvas and nothing sticks. A long rail sets `asideLabel`: below `md` it then folds behind a disclosure of that name, closed, so the page comes first on a phone, and from `md` it is the same rail; `asideLabel` also names the rail's `<aside>` landmark. Once the page has loaded, a rail that scrolls shows its current link (the one with `aria-current`) in view, and the folded disclosure reads `asideLabel` and the current link's name ("All components: Button"); both need the layout to hydrate. While `loading` the canvas waits (the rail is navigation, drawn as itself) and the layout owns the wait.
|
|
126
|
+
- aside: ReactNode (required). The links beside the canvas, usually a `Tabs orientation="vertical"`.
|
|
127
|
+
- asideLabel: string. Folds the rail behind a disclosure with this name below `md` (a long rail), and names the rail's
|
|
128
|
+
`<aside>` landmark. Left out, the rail is always open and the aside is unnamed.
|
|
129
|
+
|
|
130
|
+
Folded, the page comes first on a phone; from `md` it is the same rail.
|
|
131
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
132
|
+
- loading: boolean. The data is not here yet: an empty slot draws a bone of its shape, a filled one draws as usual.
|
|
133
|
+
Left out, the part takes the nearest loading layout's or part's; `false` opts it out inside one.
|
|
134
|
+
- loadingLabel: string (default Loading). What a screen reader hears while this part is loading, when its own `loading` is set.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
## SiteFooter
|
|
2
|
+
|
|
3
|
+
Group: Layout
|
|
4
|
+
|
|
5
|
+
When to use: The footer of a marketing site or a docs site, in `AppShell`'s `footer` slot. An app with no footer leaves the slot empty.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
A site's footer is a `SiteFooter` in `AppShell`'s `footer` slot: the shell draws the one footer landmark around it.
|
|
9
|
+
```tsx
|
|
10
|
+
import { SiteFooter, Text } from "@slashsuite/ui-react";
|
|
11
|
+
|
|
12
|
+
<SiteFooter
|
|
13
|
+
links={[
|
|
14
|
+
{ label: "Privacy", href: "/privacy" },
|
|
15
|
+
{ label: "Terms", href: "/terms" },
|
|
16
|
+
]}
|
|
17
|
+
notes={["Hack Cove (Pty) Ltd"]}
|
|
18
|
+
>
|
|
19
|
+
<Text>Email hello@example.com</Text>
|
|
20
|
+
</SiteFooter>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Do
|
|
24
|
+
- Put it in `AppShell`'s `footer` slot: `<AppShell footer={<SiteFooter ... />}>`.
|
|
25
|
+
- `brand` is the site's mark, linked to `brandHref` (`/` by default) and named by `brandLabel`. `children` is the contact line beside it, at body size.
|
|
26
|
+
- `links` are the site's own pages (Privacy, Terms, GitHub, a mail address), one wrapping row; `external` opens one in a new tab. `notes` are lines of fine print under them (a licence, a legal name, a credit), one paragraph each.
|
|
27
|
+
- Links go through the app's `LinkProvider`, like every link.
|
|
28
|
+
|
|
29
|
+
### Don't
|
|
30
|
+
- Do not add link columns, a newsletter form or social icons: a site footer is this and nothing else.
|
|
31
|
+
|
|
32
|
+
A footer built from a `Stack` of `Caption`s and a `MetaList` by hand drifts from every other site's.
|
|
33
|
+
```tsx
|
|
34
|
+
import { Caption, MetaList, Stack, Text, TextLink } from "@slashsuite/ui-react";
|
|
35
|
+
|
|
36
|
+
<Stack gap="xs">
|
|
37
|
+
<Text>Email hello@example.com</Text>
|
|
38
|
+
<MetaList>
|
|
39
|
+
<TextLink href="/privacy">Privacy</TextLink>
|
|
40
|
+
<TextLink href="/terms">Terms</TextLink>
|
|
41
|
+
</MetaList>
|
|
42
|
+
<Caption>Hack Cove (Pty) Ltd</Caption>
|
|
43
|
+
</Stack>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Accessibility
|
|
47
|
+
- It is not a `<footer>`: `AppShell` draws the one `contentinfo` landmark around its slot, so the page has exactly one.
|
|
48
|
+
- The brand is one link named by `brandLabel`, or by its own text.
|
|
49
|
+
- The links are a list, so a screen reader counts them.
|
|
50
|
+
|
|
51
|
+
### Props
|
|
52
|
+
### SiteFooter
|
|
53
|
+
The footer a site puts in `AppShell`'s `footer` slot: the site's mark linked home with a contact line beside it, a row of the site's own links (Privacy, Terms, GitHub), then lines of fine print. It is not a `<footer>`: the shell draws the one `contentinfo` landmark around its slot. No link columns, newsletter form or social icons: a site footer is this and nothing else.
|
|
54
|
+
- brand: ReactNode. The site's mark (a wordmark, a logo), linked to `brandHref`. Left out, there is no brand.
|
|
55
|
+
- brandHref: string (default /). Where the brand links. Needs `brand`.
|
|
56
|
+
- brandLabel: string. Names the brand link for assistive tech ("PixelSlash home"). Needs `brand`.
|
|
57
|
+
- children: ReactNode. A sentence at body size beside the brand: the contact line ("Email hello@...").
|
|
58
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
59
|
+
- links: SiteFooterLink[] (default []). The site's own links (Privacy, Terms, GitHub, a mail address), one wrapping row.
|
|
60
|
+
- notes: ReactNode[] (default []). Lines of fine print under the links (a licence, a trademark, a credit), one paragraph each.
|
|
61
|
+
|
|
62
|
+
### Types
|
|
63
|
+
- SiteFooterLink: `{ label: string; href: string; external?: boolean }`. One link in a `SiteFooter`'s row: its words, where it goes, and whether it opens a new tab.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
## SiteSearch
|
|
2
|
+
|
|
3
|
+
Group: Navigation
|
|
4
|
+
|
|
5
|
+
When to use: A site with more pages than a reader can scan in its nav: a docs site, an app with many sections.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
`SiteSearch` in the header's `controls`, beside the colour toggle, given every page: one search, on every page, with a shortcut.
|
|
9
|
+
```tsx
|
|
10
|
+
import { Cluster, ColourSchemeToggle, SiteSearch } from "@slashsuite/ui-react";
|
|
11
|
+
|
|
12
|
+
<Cluster gap="sm">
|
|
13
|
+
<SiteSearch
|
|
14
|
+
label="Search components"
|
|
15
|
+
items={[
|
|
16
|
+
{ label: "Dialog", description: "A modal window.", href: "#dialog" },
|
|
17
|
+
{ label: "Tabs", description: "Switch a view in place.", href: "#tabs" },
|
|
18
|
+
]}
|
|
19
|
+
/>
|
|
20
|
+
<ColourSchemeToggle size="sm" store={false} />
|
|
21
|
+
</Cluster>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Do
|
|
25
|
+
- Put one `SiteSearch` in `AppShell`'s `controls`, on every page, and pass every page as `items`: `{ label, description, href, keywords }`.
|
|
26
|
+
- `label` names the phone's icon button and titles the dialog: say what is searched ("Search components"). `resultsLabel` names the list of matches, "Results" by default, for an app in another language.
|
|
27
|
+
- Give `items` in the nav's order: results of the same rank keep it.
|
|
28
|
+
- `keywords` are other names a page answers to (the exports it documents); they match but are not shown.
|
|
29
|
+
- A result ranks by the name starting with the text, then the name containing it, then a keyword, then the description.
|
|
30
|
+
- From `sm` up the button reads Search with its key (Ctrl K, or ⌘ K on a Mac); below `sm` it is the search icon alone.
|
|
31
|
+
- It searches names, not page text, and needs no service.
|
|
32
|
+
|
|
33
|
+
### Don't
|
|
34
|
+
A field and a hand-filtered list in the page body is a second search with no shortcut, no keys and no count read out. Use `SiteSearch`.
|
|
35
|
+
```tsx
|
|
36
|
+
import { Input, ListRow, Stack } from "@slashsuite/ui-react";
|
|
37
|
+
|
|
38
|
+
<Stack gap="sm">
|
|
39
|
+
<Input type="search" aria-label="Filter" icon="search" defaultValue="dia" />
|
|
40
|
+
<div>
|
|
41
|
+
<ListRow href="#dialog" size="sm">
|
|
42
|
+
Dialog
|
|
43
|
+
</ListRow>
|
|
44
|
+
<ListRow href="#field-dialog" size="sm" divided>
|
|
45
|
+
FieldDialog
|
|
46
|
+
</ListRow>
|
|
47
|
+
</div>
|
|
48
|
+
</Stack>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Accessibility
|
|
52
|
+
- Ctrl+K or Cmd+K opens it from anywhere on the page; the button carries `aria-keyshortcuts`.
|
|
53
|
+
- It opens a `Dialog` titled by `label` with focus in the search field; Esc closes it and focus goes back to where it was.
|
|
54
|
+
- Enter opens the first result. ArrowDown moves from the field to the results and ArrowUp and ArrowDown move between them; they are links, so Tab reaches them too.
|
|
55
|
+
- A polite live region reads the result count as you type ("3 results").
|
|
56
|
+
|
|
57
|
+
### Props
|
|
58
|
+
### SiteSearch
|
|
59
|
+
The site's search: a header button that opens a dialog with a search field over a list of links to the pages that match. Put it in `AppShell`'s `controls` and pass every page as `items`. Ctrl+K (⌘ K on a Mac) opens it from anywhere on the page, and the button shows that key. Typing filters by name, then by `keywords`, then by description; Enter opens the first result, the arrow keys move through them, and Esc closes it and puts focus back where it was. Render it once per page.
|
|
60
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
61
|
+
- items: readonly SiteSearchItem[] (required). Every page to search, in the order ties are listed (the rail's order).
|
|
62
|
+
- label: string (required). The dialog's title and the phone's icon button's accessible name: "Search components". The wide
|
|
63
|
+
button is named by its own text, "Search".
|
|
64
|
+
- resultsLabel: string (default Results). The name of the list of matches, for an app in another language.
|
|
65
|
+
|
|
66
|
+
### Types
|
|
67
|
+
- SiteSearchItem: `{ label: string; description?: string; href: string; keywords?: string[] }`. One page the search can find.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
## SortableList
|
|
2
|
+
|
|
3
|
+
Group: Data
|
|
4
|
+
|
|
5
|
+
When to use: A list the user puts in order, such as a priority queue: tasks under priority bands, the next one on top.
|
|
6
|
+
|
|
7
|
+
### The one right way
|
|
8
|
+
The list reports a move and the app applies it to its own data, so a drag or the keyboard reorders it.
|
|
9
|
+
```tsx
|
|
10
|
+
import { useState } from "react";
|
|
11
|
+
import { SortableItem, SortableList } from "@slashsuite/ui-react";
|
|
12
|
+
|
|
13
|
+
function Example() {
|
|
14
|
+
const [tasks, setTasks] = useState([
|
|
15
|
+
"Ship the invoice export",
|
|
16
|
+
"Book the car service",
|
|
17
|
+
"Review the quote",
|
|
18
|
+
]);
|
|
19
|
+
return (
|
|
20
|
+
<SortableList
|
|
21
|
+
label="Queue"
|
|
22
|
+
onReorder={(move) => {
|
|
23
|
+
const rest = tasks.filter((task) => task !== move.id);
|
|
24
|
+
const after = move.target?.position === "after" ? 1 : 0;
|
|
25
|
+
const at = move.target ? rest.indexOf(move.target.id) + after : rest.length;
|
|
26
|
+
setTasks([...rest.slice(0, at), move.id, ...rest.slice(at)]);
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
{tasks.map((task) => (
|
|
30
|
+
<SortableItem key={task} id={task} title={task} />
|
|
31
|
+
))}
|
|
32
|
+
</SortableList>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Do
|
|
38
|
+
- Map your data straight to the parts: a `SortableList` with a `label`, a `SortableSection` per group (`id`, `title`) and a `SortableItem` per row (`id`, `title`). Each item is a direct child of its section, and each section a direct child of the list; an item wrapped in your own component is not counted or placed.
|
|
39
|
+
- `onReorder` reports each drop as `{ id, section, target }`: the item that moved, the section it lands in, and `{ id, position }`, the item it was dropped before or after. Apply it to your own data and render again. The list never reorders itself.
|
|
40
|
+
- Moving an item into another section is how the user changes its group, such as a ticket's priority: read `section`, not the old one.
|
|
41
|
+
- An empty section shows a quiet "Drop here" row and still takes a drop. A drop there reports `{ id, section }` with no `target`.
|
|
42
|
+
- Put a meta line in a `SortableItem`'s children: `Pill`s, an `Avatar`. The row is the drag target, so do not put buttons or links in it.
|
|
43
|
+
- A list with no groups takes `SortableItem`s directly, and its moves have no `section`. Two lists on one page never take each other's items.
|
|
44
|
+
|
|
45
|
+
### Don't
|
|
46
|
+
- Do not add up and down buttons to rows: the drag and the keyboard already move an item, and buttons cannot move it into another section.
|
|
47
|
+
|
|
48
|
+
Up and down buttons on every row are a wall of controls, and they cannot move a task into another band.
|
|
49
|
+
```tsx
|
|
50
|
+
import { Button, Card, ListRow } from "@slashsuite/ui-react";
|
|
51
|
+
|
|
52
|
+
<Card flush>
|
|
53
|
+
{["Ship the invoice export", "Book the car service", "Review the quote"].map(
|
|
54
|
+
(task, index) => (
|
|
55
|
+
<ListRow
|
|
56
|
+
key={task}
|
|
57
|
+
divided={index > 0}
|
|
58
|
+
actions={
|
|
59
|
+
<>
|
|
60
|
+
<Button size="sm" variant="outline">
|
|
61
|
+
Up
|
|
62
|
+
</Button>
|
|
63
|
+
<Button size="sm" variant="outline">
|
|
64
|
+
Down
|
|
65
|
+
</Button>
|
|
66
|
+
</>
|
|
67
|
+
}
|
|
68
|
+
>
|
|
69
|
+
{task}
|
|
70
|
+
</ListRow>
|
|
71
|
+
),
|
|
72
|
+
)}
|
|
73
|
+
</Card>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Accessibility
|
|
77
|
+
- The list is a grid with one row per item. Tab moves into it, and the arrow keys move between rows.
|
|
78
|
+
- To move an item from the keyboard: on its row, press the Right arrow to reach its grip handle, named "Reorder <title>", and press Enter. Each Up or Down arrow moves the drop line one gap, across section headings and into an empty section's "Drop here" row, and Enter drops. Escape cancels, leaves the order as it was and puts focus back on the handle. Tab does not leave the list during a move: it steps between the page's drop areas, and only Enter or Escape ends it.
|
|
79
|
+
- While an item is moved, a screen reader announces it by its `title` and announces each drop position.
|
|
80
|
+
- A pointer drags the row itself, and on a touch screen a long press starts the drag; the handle is for the keyboard and screen readers.
|
|
81
|
+
- Section headings are row headers with the section's title, and the "Drop here" row cannot be focused or dragged.
|
|
82
|
+
|
|
83
|
+
### Props
|
|
84
|
+
### SortableList
|
|
85
|
+
A list the user puts in order: items under section headings, moved by dragging a row or from the keyboard (each row's grip handle, Enter, the arrow keys, Enter to drop, Escape to cancel). A drop reports `onReorder` with the item, the section it lands in and the item it lands next to; the app applies it to its own data. The list never reorders itself: it shows what its children say. Its children are `SortableSection`s, or `SortableItem`s directly for a list with no sections, each a direct child (map your data straight to them). Moving an item into another section is how the app changes its group, such as a ticket's priority. Two lists on one page never take each other's items.
|
|
86
|
+
- children: ReactNode (required). `SortableSection`s, or `SortableItem`s for a list with no sections.
|
|
87
|
+
- id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
88
|
+
- label: string (required). The list's accessible name, read by a screen reader.
|
|
89
|
+
- onReorder: (move: SortableMove) => void (required). Called once per drop with the move; apply it to your data.
|
|
90
|
+
|
|
91
|
+
### SortableSection
|
|
92
|
+
One group of a `SortableList` under a heading that shows its title and how many items it holds. An empty section still takes a drop: it shows a quiet "Drop here" row in place of items.
|
|
93
|
+
- children: ReactNode. Its `SortableItem`s, each a direct child. With none it shows a quiet `emptyLabel` row.
|
|
94
|
+
- emptyLabel: string (default Drop here). The quiet row an empty section shows, where a drop lands.
|
|
95
|
+
- id: string. The section's id, reported as `section` in a move that lands in it.
|
|
96
|
+
The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
97
|
+
- title: string (required). The heading over its items.
|
|
98
|
+
|
|
99
|
+
### SortableItem
|
|
100
|
+
One row of a `SortableList`: a grip handle, the title, and an optional meta line under it. A pointer drags the row itself; the handle ("Reorder <title>") is how a keyboard or screen reader starts a move.
|
|
101
|
+
- children: ReactNode. A meta line under the title: `Pill`s, an `Avatar`.
|
|
102
|
+
- id: string. The item's id, reported in a move.
|
|
103
|
+
The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
|
|
104
|
+
- title: string (required). Its one line; also what a screen reader announces while it is dragged.
|
|
105
|
+
|
|
106
|
+
### Types
|
|
107
|
+
- SortableMove: `{ id: string; section?: string; target?: { id: string; position: "before" | "after" } }`. A move the user made: which item, the section it lands in, and the item it lands next to.
|