@voidable/ui 0.8.1 → 0.9.0
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 +8 -0
- package/dist/chunks/{modal-D_YVy2vg.js → modal-hivQ4YoU.js} +1 -1
- package/dist/chunks/{parts-D30c8OoG.js → parts-CMQQop0D.js} +4 -1
- package/dist/chunks/secret-value-CmTtVkMg.js +14 -0
- package/dist/chunks/value-list-CH6GjYXM.js +28 -0
- package/dist/components/accordion.js +1 -1
- package/dist/components/action-input.d.ts +6 -2
- package/dist/components/action-input.js +55 -45
- package/dist/components/alert.js +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/carousel.js +1 -1
- package/dist/components/checkbox-group.d.ts +10 -0
- package/dist/components/checkbox-group.js +30 -18
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/collapsible.js +1 -1
- package/dist/components/color-picker.d.ts +2 -2
- package/dist/components/combobox.d.ts +4 -2
- package/dist/components/combobox.js +8 -5
- package/dist/components/compose-input.d.ts +1 -1
- package/dist/components/compose-input.js +4 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/editable.d.ts +1 -1
- package/dist/components/error-fallback.js +1 -1
- package/dist/components/gauge.js +4 -1
- package/dist/components/hover-card.js +1 -1
- package/dist/components/input.d.ts +6 -2
- package/dist/components/input.js +43 -33
- package/dist/components/menu.js +1 -1
- package/dist/components/multiselect.d.ts +9 -0
- package/dist/components/multiselect.js +47 -38
- package/dist/components/nav-menu.js +1 -1
- package/dist/components/number-input.d.ts +2 -2
- package/dist/components/panel.js +1 -1
- package/dist/components/pin-input.d.ts +6 -2
- package/dist/components/pin-input.js +27 -17
- package/dist/components/popover.js +1 -1
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +4 -1
- package/dist/components/segmented-control.d.ts +1 -1
- package/dist/components/select.d.ts +67 -16
- package/dist/components/select.js +172 -47
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +4 -1
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tags-input.d.ts +1 -1
- package/dist/components/tags-input.js +22 -18
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +4 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle.js +4 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components.json +3 -3
- package/dist/custom-elements.json +85 -49
- package/dist/dev/types.d.ts +2 -3
- package/dist/dev.js +50 -48
- package/dist/llms.txt +125 -0
- package/dist/parts.d.ts +3 -1
- package/dist/reference.md +4575 -0
- package/dist/secret-value.d.ts +17 -0
- package/dist/types/elements.d.ts +2 -2
- package/dist/value-list.d.ts +14 -0
- package/dist/vscode.html-custom-data.json +33 -19
- package/dist/web-types.json +57 -37
- package/package.json +5 -3
|
@@ -0,0 +1,4575 @@
|
|
|
1
|
+
# @voidable/ui 0.9.0: element reference
|
|
2
|
+
|
|
3
|
+
Generated from the package's Custom Elements Manifest. 164 elements (78 registered by JavaScript, 86 CSS-only parts and patterns). Each section gives the parts, attributes with their allowed values, events with their `detail`, where the element may sit and a correct example. Start at `llms.txt` for the rules that apply to all of them.
|
|
4
|
+
|
|
5
|
+
## `<void-accordion>`
|
|
6
|
+
|
|
7
|
+
Collapsible section container for FAQs, settings panels, and long-form content organized into expandable items.
|
|
8
|
+
|
|
9
|
+
Holds `<void-accordion-item>`s; each item holds a `<void-accordion-trigger>` (the heading text that toggles it)
|
|
10
|
+
and a `<void-accordion-content>`. All of them are written by the author and never moved.
|
|
11
|
+
|
|
12
|
+
Parts (only these parts as children):
|
|
13
|
+
|
|
14
|
+
| Part | | Description |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| `<void-accordion-item>` | required, any number | One collapsible item. |
|
|
17
|
+
|  `<void-accordion-trigger>` | required, one, CSS-only | Heading text of the item; becomes the button that opens and closes it. |
|
|
18
|
+
|  `<void-accordion-content>` | required, one, CSS-only | Content shown while the item is open. |
|
|
19
|
+
|
|
20
|
+
Markup: `<void-accordion><void-accordion-item open><void-accordion-trigger>Question</void-accordion-trigger><void-accordion-content>Answer</void-accordion-content></void-accordion-item></void-accordion>`
|
|
21
|
+
|
|
22
|
+
| Attribute | Values | Default | Description |
|
|
23
|
+
|---|---|---|---|
|
|
24
|
+
| `multiple` | `boolean` | `false` | Let several items stay open at once. Without it, opening an item closes the others in the accordion. |
|
|
25
|
+
|
|
26
|
+
Example:
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<void-accordion>
|
|
30
|
+
<void-accordion-item open>
|
|
31
|
+
<void-accordion-trigger>Shipping</void-accordion-trigger>
|
|
32
|
+
<void-accordion-content>Orders ship within two business days.</void-accordion-content>
|
|
33
|
+
</void-accordion-item>
|
|
34
|
+
<void-accordion-item>
|
|
35
|
+
<void-accordion-trigger>Returns</void-accordion-trigger>
|
|
36
|
+
<void-accordion-content>Return unworn items within 30 days for a full refund.</void-accordion-content>
|
|
37
|
+
</void-accordion-item>
|
|
38
|
+
<void-accordion-item>
|
|
39
|
+
<void-accordion-trigger>Warranty</void-accordion-trigger>
|
|
40
|
+
<void-accordion-content>Every product carries a one-year warranty.</void-accordion-content>
|
|
41
|
+
</void-accordion-item>
|
|
42
|
+
</void-accordion>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## `<void-accordion-content>`
|
|
46
|
+
|
|
47
|
+
Content shown while the item is open.
|
|
48
|
+
|
|
49
|
+
CSS-only part of `<void-accordion-item>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
50
|
+
|
|
51
|
+
Allowed inside: `<void-accordion-item>`.
|
|
52
|
+
|
|
53
|
+
Example:
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<void-accordion>
|
|
57
|
+
<void-accordion-item open>
|
|
58
|
+
<void-accordion-trigger>Shipping</void-accordion-trigger>
|
|
59
|
+
<void-accordion-content>Orders ship within two business days.</void-accordion-content>
|
|
60
|
+
</void-accordion-item>
|
|
61
|
+
<void-accordion-item>
|
|
62
|
+
<void-accordion-trigger>Returns</void-accordion-trigger>
|
|
63
|
+
<void-accordion-content>Return unworn items within 30 days for a full refund.</void-accordion-content>
|
|
64
|
+
</void-accordion-item>
|
|
65
|
+
<void-accordion-item>
|
|
66
|
+
<void-accordion-trigger>Warranty</void-accordion-trigger>
|
|
67
|
+
<void-accordion-content>Every product carries a one-year warranty.</void-accordion-content>
|
|
68
|
+
</void-accordion-item>
|
|
69
|
+
</void-accordion>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## `<void-accordion-item>`
|
|
73
|
+
|
|
74
|
+
One collapsible item of a `<void-accordion>`: a `<void-accordion-trigger>` followed by a
|
|
75
|
+
`<void-accordion-content>`. The trigger becomes the button that toggles the item (`role="button"`, a tab stop,
|
|
76
|
+
Enter and Space, `aria-expanded`, `aria-controls`); the content is the region it names. Closed content is hidden
|
|
77
|
+
by the theme from the item's `open` attribute, before the script loads as well, and opens and closes with a height
|
|
78
|
+
animation (a grid row, no measuring; off under `prefers-reduced-motion` and when `--void-anim-scale` is 0). Where the
|
|
79
|
+
browser supports `hidden="until-found"` the closed content carries it, so it is out of the accessibility tree and
|
|
80
|
+
find-in-page opens the item when it finds text inside.
|
|
81
|
+
|
|
82
|
+
| Attribute | Values | Default | Description |
|
|
83
|
+
|---|---|---|---|
|
|
84
|
+
| `open` | `boolean` | `false` | Whether the content is shown. Add the attribute to start open; it is updated when the user toggles the item. |
|
|
85
|
+
|
|
86
|
+
| Event | `detail` | Description |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| `void-close` | `{ reason: 'trigger' \| 'keyboard' \| 'outside' }` | The item is closing: the user closed it (cancelable: `preventDefault()` keeps it open), or another item opened in a single-open accordion (`outside`). Does not bubble. |
|
|
89
|
+
| `void-open` | `{ reason: 'trigger' \| 'keyboard' \| 'find' }` | The item opened: a click on the trigger, Enter or Space on it, or find-in-page found text inside. Does not bubble. |
|
|
90
|
+
|
|
91
|
+
Allowed inside: `<void-accordion>`.
|
|
92
|
+
|
|
93
|
+
Attributes that do not exist (and what to write instead):
|
|
94
|
+
|
|
95
|
+
- `heading`: write the heading as <void-accordion-trigger>...</void-accordion-trigger> and the content in <void-accordion-content> after it
|
|
96
|
+
|
|
97
|
+
Example:
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<void-accordion multiple>
|
|
101
|
+
<void-accordion-item open>
|
|
102
|
+
<void-accordion-trigger>Shipping</void-accordion-trigger>
|
|
103
|
+
<void-accordion-content>Orders ship within two business days.</void-accordion-content>
|
|
104
|
+
</void-accordion-item>
|
|
105
|
+
<void-accordion-item>
|
|
106
|
+
<void-accordion-trigger>Returns</void-accordion-trigger>
|
|
107
|
+
<void-accordion-content>Return unworn items within 30 days for a full refund.</void-accordion-content>
|
|
108
|
+
</void-accordion-item>
|
|
109
|
+
</void-accordion>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## `<void-accordion-trigger>`
|
|
113
|
+
|
|
114
|
+
Heading text of the item; becomes the button that opens and closes it.
|
|
115
|
+
|
|
116
|
+
CSS-only part of `<void-accordion-item>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
117
|
+
|
|
118
|
+
Allowed inside: `<void-accordion-item>`.
|
|
119
|
+
|
|
120
|
+
Example:
|
|
121
|
+
|
|
122
|
+
```html
|
|
123
|
+
<void-accordion>
|
|
124
|
+
<void-accordion-item open>
|
|
125
|
+
<void-accordion-trigger>Shipping</void-accordion-trigger>
|
|
126
|
+
<void-accordion-content>Orders ship within two business days.</void-accordion-content>
|
|
127
|
+
</void-accordion-item>
|
|
128
|
+
<void-accordion-item>
|
|
129
|
+
<void-accordion-trigger>Returns</void-accordion-trigger>
|
|
130
|
+
<void-accordion-content>Return unworn items within 30 days for a full refund.</void-accordion-content>
|
|
131
|
+
</void-accordion-item>
|
|
132
|
+
<void-accordion-item>
|
|
133
|
+
<void-accordion-trigger>Warranty</void-accordion-trigger>
|
|
134
|
+
<void-accordion-content>Every product carries a one-year warranty.</void-accordion-content>
|
|
135
|
+
</void-accordion-item>
|
|
136
|
+
</void-accordion>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## `<void-action-input>`
|
|
140
|
+
|
|
141
|
+
Input field with an attached icon button — used for copy-to-clipboard inputs, search boxes, and similar patterns.
|
|
142
|
+
|
|
143
|
+
| Attribute | Values | Default | Description |
|
|
144
|
+
|---|---|---|---|
|
|
145
|
+
| `value` | `string` | | The text in the field. Reflected to the `value` attribute as it changes, and setting the attribute sets it; the form's reset target stays the value the field started with. A `type="password"` field does not reflect: its attribute is only ever the initial value. |
|
|
146
|
+
| `placeholder` | `string` | | Hint text shown while the field is empty. It also names the field for assistive technology when there is no `aria-label`. |
|
|
147
|
+
| `disabled` | `boolean` | `false` | Stop the field and its button reacting and exclude the value from the form submission. |
|
|
148
|
+
| `readonly` | `boolean` | `false` | Show the value but do not let the user edit it; the field is still focusable and submitted. The action button still works, which is what a copy-to-clipboard field wants. |
|
|
149
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
150
|
+
| `name` | `string` | | Key the value is submitted under in the form's `FormData`. Without a name the field submits nothing. |
|
|
151
|
+
| `autocomplete` | `string` | | Autofill hint forwarded to the native control (`autocomplete`), e.g. `current-password`, `one-time-code`, `email`. |
|
|
152
|
+
| `minlength` | `number \| undefined` | | Minimum number of characters, enforced by the native control (`minlength`) and reported through validity. |
|
|
153
|
+
| `maxlength` | `number \| undefined` | | Maximum number of characters accepted by the native control (`maxlength`). |
|
|
154
|
+
| `pattern` | `string` | | Regular expression the value must match (`pattern`), reported through validity. |
|
|
155
|
+
| `inputmode` | `\|none\|text\|decimal\|numeric\|tel\|search\|email\|url` | | Virtual keyboard hint forwarded to the native control (`inputmode`). |
|
|
156
|
+
| `enterkeyhint` | `\|enter\|done\|go\|next\|previous\|search\|send` | | Label of the mobile keyboard's enter key (`enterkeyhint`). |
|
|
157
|
+
| `autocapitalize` | `\|off\|none\|on\|sentences\|words\|characters` | | Capitalisation behaviour of virtual keyboards (`autocapitalize`). |
|
|
158
|
+
| `spellcheck` | `string \| null` | | The host's `spellcheck` attribute as written (`"true"`, `"false"`, `""`, or absent for the browser default), forwarded to the native control: the native enumerated attribute, not a boolean. |
|
|
159
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
160
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the action button: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
161
|
+
| `type` | `text\|password\|search\|email\|tel\|url` | `text` | Native input type; any text-like type is forwarded to the native control. |
|
|
162
|
+
| `icon` | `string` | `search` | Icon on the button: `search` (default), `copy`, `clipboard`, `send`, `eye`, `eye-off`, `check`, `x` or `arrow-right`. Any other value draws the search icon. |
|
|
163
|
+
| `action-label` | `string` | `Action` | Accessible name of the button and its tooltip. Defaults to `Action`; say what it does (`Copy link`). |
|
|
164
|
+
| `icon-side` | `left\|right` | `right` | Which side of the field the button sits on: `right` (default) or `left`. |
|
|
165
|
+
| `tooltip-side` | `top\|bottom\|left\|right` | `top` | Where the button's tooltip appears: `top` (default), `bottom`, `left` or `right`. |
|
|
166
|
+
| `form` | `string \| null` | | `id` of a `<form>` elsewhere in the page that this control belongs to, as on a native control. Without it the control belongs to the form it sits inside. |
|
|
167
|
+
|
|
168
|
+
| Event | `detail` | Description |
|
|
169
|
+
|---|---|---|
|
|
170
|
+
| `void-input` | `{ value: string }` | |
|
|
171
|
+
| `void-change` | `{ value: string }` | |
|
|
172
|
+
| `void-action` | `{ value: string }` | |
|
|
173
|
+
|
|
174
|
+
Example:
|
|
175
|
+
|
|
176
|
+
```html
|
|
177
|
+
<void-field label="Share link">
|
|
178
|
+
<void-action-input name="link" value="https://voidable.dev/s/4f9c2" readonly icon="copy" action-label="Copy link"></void-action-input>
|
|
179
|
+
</void-field>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## `<void-actions>`
|
|
183
|
+
|
|
184
|
+
Row of buttons that wraps: page actions, form buttons, row actions in a table cell.
|
|
185
|
+
|
|
186
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
187
|
+
|
|
188
|
+
| Attribute | Values | Default | Description |
|
|
189
|
+
|---|---|---|---|
|
|
190
|
+
| `justify` | `start\|end\|center` | `start` | where the buttons sit in the row (end for the buttons of a form) |
|
|
191
|
+
|
|
192
|
+
Example:
|
|
193
|
+
|
|
194
|
+
```html
|
|
195
|
+
<void-actions justify="end">
|
|
196
|
+
<void-button variant="ghost">Cancel</void-button>
|
|
197
|
+
<void-button variant="filled" type="submit">Save</void-button>
|
|
198
|
+
</void-actions>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## `<void-alert>`
|
|
202
|
+
|
|
203
|
+
Inline contextual message for form validation feedback, permission warnings, and system status notices.
|
|
204
|
+
|
|
205
|
+
Its text is written as parts: an optional `<void-alert-title>`, the `<void-alert-description>` and an optional
|
|
206
|
+
`<void-alert-close>`. The parts are never moved. The close part wraps the one control the author writes (a
|
|
207
|
+
`<button type="button" aria-label="Dismiss">`); pressing it fires `void-close` and, unless that is cancelled, removes the alert (focus inside
|
|
208
|
+
it moves on to the next focusable element). Without a close part the alert cannot be dismissed.
|
|
209
|
+
|
|
210
|
+
Parts (only these parts as children, in this order):
|
|
211
|
+
|
|
212
|
+
| Part | | Description |
|
|
213
|
+
|---|---|---|
|
|
214
|
+
| `<void-alert-title>` | one, CSS-only | Short title of the message. |
|
|
215
|
+
| `<void-alert-description>` | required, one, CSS-only | The message. |
|
|
216
|
+
| `<void-alert-close>` | one, wraps one control, CSS-only | Wraps the one control that dismisses the alert (a <button aria-label="Dismiss">); pressing it fires void-close and removes the alert. Without it the alert cannot be dismissed. |
|
|
217
|
+
|
|
218
|
+
Markup: `<void-alert color="warning"><void-alert-title>Title</void-alert-title><void-alert-description>What happened and what to do.</void-alert-description><void-alert-close><button type="button" aria-label="Dismiss">×</button></void-alert-close></void-alert>`
|
|
219
|
+
|
|
220
|
+
| Attribute | Values | Default | Description |
|
|
221
|
+
|---|---|---|---|
|
|
222
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the message: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. Pick the one that matches the meaning (error for a failure, success for a confirmation). |
|
|
223
|
+
| `variant` | `subtle\|filled` | `subtle` | `subtle` (default) tints the background; `filled` fills it with the status colour for a louder message. |
|
|
224
|
+
|
|
225
|
+
| Event | `detail` | Description |
|
|
226
|
+
|---|---|---|
|
|
227
|
+
| `void-close` | `{ reason: 'close-button' }` | The close control was pressed. Cancelable: `preventDefault()` keeps the alert; otherwise it removes itself afterwards. Does not bubble. |
|
|
228
|
+
|
|
229
|
+
Attributes that do not exist (and what to write instead):
|
|
230
|
+
|
|
231
|
+
- `dismissible`: add <void-alert-close><button type="button" aria-label="Dismiss">×</button></void-alert-close> as the last child; without it the alert is not dismissible
|
|
232
|
+
|
|
233
|
+
Example:
|
|
234
|
+
|
|
235
|
+
```html
|
|
236
|
+
<void-alert color="warning">
|
|
237
|
+
<void-alert-title>Your trial ends in 3 days</void-alert-title>
|
|
238
|
+
<void-alert-description>Add a payment method to keep your projects.</void-alert-description>
|
|
239
|
+
<void-alert-close><button type="button" aria-label="Dismiss">×</button></void-alert-close>
|
|
240
|
+
</void-alert>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## `<void-alert-close>`
|
|
244
|
+
|
|
245
|
+
Wraps the one control that dismisses the alert (a <button aria-label="Dismiss">); pressing it fires void-close and removes the alert. Without it the alert cannot be dismissed.
|
|
246
|
+
|
|
247
|
+
CSS-only part of `<void-alert>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
248
|
+
|
|
249
|
+
Allowed inside: `<void-alert>`.
|
|
250
|
+
|
|
251
|
+
Example:
|
|
252
|
+
|
|
253
|
+
```html
|
|
254
|
+
<void-alert color="warning">
|
|
255
|
+
<void-alert-title>Your trial ends in 3 days</void-alert-title>
|
|
256
|
+
<void-alert-description>Add a payment method to keep your projects.</void-alert-description>
|
|
257
|
+
<void-alert-close><button type="button" aria-label="Dismiss">×</button></void-alert-close>
|
|
258
|
+
</void-alert>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## `<void-alert-description>`
|
|
262
|
+
|
|
263
|
+
The message.
|
|
264
|
+
|
|
265
|
+
CSS-only part of `<void-alert>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
266
|
+
|
|
267
|
+
Allowed inside: `<void-alert>`.
|
|
268
|
+
|
|
269
|
+
Example:
|
|
270
|
+
|
|
271
|
+
```html
|
|
272
|
+
<void-alert color="warning">
|
|
273
|
+
<void-alert-title>Your trial ends in 3 days</void-alert-title>
|
|
274
|
+
<void-alert-description>Add a payment method to keep your projects.</void-alert-description>
|
|
275
|
+
<void-alert-close><button type="button" aria-label="Dismiss">×</button></void-alert-close>
|
|
276
|
+
</void-alert>
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## `<void-alert-title>`
|
|
280
|
+
|
|
281
|
+
Short title of the message.
|
|
282
|
+
|
|
283
|
+
CSS-only part of `<void-alert>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
284
|
+
|
|
285
|
+
Allowed inside: `<void-alert>`.
|
|
286
|
+
|
|
287
|
+
Example:
|
|
288
|
+
|
|
289
|
+
```html
|
|
290
|
+
<void-alert color="warning">
|
|
291
|
+
<void-alert-title>Your trial ends in 3 days</void-alert-title>
|
|
292
|
+
<void-alert-description>Add a payment method to keep your projects.</void-alert-description>
|
|
293
|
+
<void-alert-close><button type="button" aria-label="Dismiss">×</button></void-alert-close>
|
|
294
|
+
</void-alert>
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
## `<void-avatar>`
|
|
298
|
+
|
|
299
|
+
User identity display for comment threads, user lists, and profile cards; falls back to initials when no image is provided.
|
|
300
|
+
|
|
301
|
+
| Attribute | Values | Default | Description |
|
|
302
|
+
|---|---|---|---|
|
|
303
|
+
| `src` | `string` | | URL of the image. When it is empty, or the image fails to load, the avatar shows `initials` instead. |
|
|
304
|
+
| `alt` | `string` | | Accessible name of the avatar, normally the person's name. Without it the name falls back to `initials`. |
|
|
305
|
+
| `initials` | `string` | | One to three letters shown when there is no image. Used as the accessible name when `alt` is empty. |
|
|
306
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
307
|
+
|
|
308
|
+
Example:
|
|
309
|
+
|
|
310
|
+
```html
|
|
311
|
+
<void-avatar initials="AM" alt="Alice Morgan" size="lg"></void-avatar>
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## `<void-badge>`
|
|
315
|
+
|
|
316
|
+
Small status chip for issue trackers, tag systems, and categorization UIs where color conveys state at a glance.
|
|
317
|
+
|
|
318
|
+
| Attribute | Values | Default | Description |
|
|
319
|
+
|---|---|---|---|
|
|
320
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. Colour carries the state, so also say the state in the badge text. |
|
|
321
|
+
| `variant` | `filled\|outline` | `filled` | `filled` (default) fills the badge with its colour; `outline` draws only a border and tinted text. |
|
|
322
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
323
|
+
|
|
324
|
+
Example:
|
|
325
|
+
|
|
326
|
+
```html
|
|
327
|
+
<void-badge color="success">Active</void-badge>
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
## `<void-banner>`
|
|
331
|
+
|
|
332
|
+
Full-width site-level announcement for maintenance windows, cookie consent, and promotional messaging.
|
|
333
|
+
|
|
334
|
+
Its text is written as parts: an optional `<void-banner-title>`, the `<void-banner-description>`, an optional
|
|
335
|
+
`<void-banner-actions>` (buttons or links) and an optional `<void-banner-close>`. The parts are never moved. The
|
|
336
|
+
close part wraps the one control the author writes (a `<void-button aria-label="Dismiss">`); pressing it fires
|
|
337
|
+
`void-close` and removes the banner (focus inside it moves on to the next focusable element). Without a close part the banner cannot be dismissed.
|
|
338
|
+
|
|
339
|
+
Parts (only these parts as children, in this order):
|
|
340
|
+
|
|
341
|
+
| Part | | Description |
|
|
342
|
+
|---|---|---|
|
|
343
|
+
| `<void-banner-title>` | one, CSS-only | Short title of the announcement. |
|
|
344
|
+
| `<void-banner-description>` | required, one, CSS-only | The announcement. |
|
|
345
|
+
| `<void-banner-actions>` | one, CSS-only | Buttons or links for the announcement, at the trailing edge. |
|
|
346
|
+
| `<void-banner-close>` | one, wraps one control, CSS-only | Wraps the one control that dismisses the banner (a <button aria-label="Dismiss">); pressing it fires void-close and removes the banner. Without it the banner cannot be dismissed. |
|
|
347
|
+
|
|
348
|
+
Markup: `<void-banner color="info"><void-banner-title>Maintenance</void-banner-title><void-banner-description>Saturday 02:00 to 04:00 UTC.</void-banner-description><void-banner-actions><void-button size="sm">Details</void-button></void-banner-actions><void-banner-close><button type="button" aria-label="Dismiss">×</button></void-banner-close></void-banner>`
|
|
349
|
+
|
|
350
|
+
| Attribute | Values | Default | Description |
|
|
351
|
+
|---|---|---|---|
|
|
352
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the announcement: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
353
|
+
| `variant` | `subtle\|filled` | `subtle` | `subtle` (default) tints the background; `filled` fills it with the status colour. |
|
|
354
|
+
|
|
355
|
+
| Event | `detail` | Description |
|
|
356
|
+
|---|---|---|
|
|
357
|
+
| `void-close` | `{ reason: 'close-button' }` | The close part was pressed; the banner removes itself afterwards unless a listener cancels the event. Does not bubble. |
|
|
358
|
+
|
|
359
|
+
Attributes that do not exist (and what to write instead):
|
|
360
|
+
|
|
361
|
+
- `dismissable`: add <void-banner-close><button type="button" aria-label="Dismiss">×</button></void-banner-close> as the last child; without it the banner is not dismissible
|
|
362
|
+
|
|
363
|
+
Example:
|
|
364
|
+
|
|
365
|
+
```html
|
|
366
|
+
<void-banner color="info">
|
|
367
|
+
<void-banner-description>Scheduled maintenance on Saturday from 02:00 to 04:00 UTC.</void-banner-description>
|
|
368
|
+
<void-banner-close><button type="button" aria-label="Dismiss">×</button></void-banner-close>
|
|
369
|
+
</void-banner>
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## `<void-banner-actions>`
|
|
373
|
+
|
|
374
|
+
Buttons or links for the announcement, at the trailing edge.
|
|
375
|
+
|
|
376
|
+
CSS-only part of `<void-banner>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
377
|
+
|
|
378
|
+
Allowed inside: `<void-banner>`.
|
|
379
|
+
|
|
380
|
+
Example:
|
|
381
|
+
|
|
382
|
+
```html
|
|
383
|
+
<void-banner color="info">
|
|
384
|
+
<void-banner-description>Scheduled maintenance on Saturday from 02:00 to 04:00 UTC.</void-banner-description>
|
|
385
|
+
<void-banner-close><button type="button" aria-label="Dismiss">×</button></void-banner-close>
|
|
386
|
+
</void-banner>
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
## `<void-banner-close>`
|
|
390
|
+
|
|
391
|
+
Wraps the one control that dismisses the banner (a <button aria-label="Dismiss">); pressing it fires void-close and removes the banner. Without it the banner cannot be dismissed.
|
|
392
|
+
|
|
393
|
+
CSS-only part of `<void-banner>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
394
|
+
|
|
395
|
+
Allowed inside: `<void-banner>`.
|
|
396
|
+
|
|
397
|
+
Example:
|
|
398
|
+
|
|
399
|
+
```html
|
|
400
|
+
<void-banner color="info">
|
|
401
|
+
<void-banner-description>Scheduled maintenance on Saturday from 02:00 to 04:00 UTC.</void-banner-description>
|
|
402
|
+
<void-banner-close><button type="button" aria-label="Dismiss">×</button></void-banner-close>
|
|
403
|
+
</void-banner>
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
## `<void-banner-description>`
|
|
407
|
+
|
|
408
|
+
The announcement.
|
|
409
|
+
|
|
410
|
+
CSS-only part of `<void-banner>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
411
|
+
|
|
412
|
+
Allowed inside: `<void-banner>`.
|
|
413
|
+
|
|
414
|
+
Example:
|
|
415
|
+
|
|
416
|
+
```html
|
|
417
|
+
<void-banner color="info">
|
|
418
|
+
<void-banner-description>Scheduled maintenance on Saturday from 02:00 to 04:00 UTC.</void-banner-description>
|
|
419
|
+
<void-banner-close><button type="button" aria-label="Dismiss">×</button></void-banner-close>
|
|
420
|
+
</void-banner>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
## `<void-banner-title>`
|
|
424
|
+
|
|
425
|
+
Short title of the announcement.
|
|
426
|
+
|
|
427
|
+
CSS-only part of `<void-banner>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
428
|
+
|
|
429
|
+
Allowed inside: `<void-banner>`.
|
|
430
|
+
|
|
431
|
+
Example:
|
|
432
|
+
|
|
433
|
+
```html
|
|
434
|
+
<void-banner color="info">
|
|
435
|
+
<void-banner-description>Scheduled maintenance on Saturday from 02:00 to 04:00 UTC.</void-banner-description>
|
|
436
|
+
<void-banner-close><button type="button" aria-label="Dismiss">×</button></void-banner-close>
|
|
437
|
+
</void-banner>
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
## `<void-bar-chart>`
|
|
441
|
+
|
|
442
|
+
Bar chart for comparing categories and series, drawn in SVG with animated bars. Give it `data`
|
|
443
|
+
(`{ series: [{ name, values }], labels }`) from script; it has no children. The chart is an image to
|
|
444
|
+
assistive technology, so set `aria-label` and state the key figures in the surrounding text.
|
|
445
|
+
|
|
446
|
+
| Attribute | Values | Default | Description |
|
|
447
|
+
|---|---|---|---|
|
|
448
|
+
| `height` | `number` | `220` | Height of the chart in pixels. Defaults to 220. The width fills the container. |
|
|
449
|
+
| `show-value` | `boolean` | `false` | Print each bar's value above it (below it for a negative value), abbreviated above 1000 (`1.2k`). |
|
|
450
|
+
| `variant` | `filled\|outline\|wireframe` | `filled` | How bars are drawn: `filled` (default, solid), `outline` (tinted fill with a border) or `wireframe` (border only). |
|
|
451
|
+
| `aria-label` | `string` | | Accessible name of the chart, such as `Revenue by quarter`. The chart is an image to assistive technology, so set it and put the key figures in the text around it. |
|
|
452
|
+
| `stagger` | `number \| null` | | Delay in milliseconds between the bars as they animate in, one after another. Without it the theme's `--void-stagger-chart-bars` applies; `stagger="0"` animates them together. |
|
|
453
|
+
|
|
454
|
+
Properties with no attribute (set in JavaScript):
|
|
455
|
+
|
|
456
|
+
| Property | Type | Description |
|
|
457
|
+
|---|---|---|
|
|
458
|
+
| `data` | `BarChartData` | The chart's data: `{ series: [{ name, values, color?, colors? }], labels? }`. `values` are aligned with `labels` (the category names along the axis); `color` colours a whole series and `colors` overrides single bars. Negative values are bars below a zero baseline: the value axis then spans the lowest value as well, and a baseline is drawn at zero. Property only: assign a new object to update the chart and animate to it. |
|
|
459
|
+
|
|
460
|
+
Example:
|
|
461
|
+
|
|
462
|
+
```html
|
|
463
|
+
<void-bar-chart aria-label="Revenue by quarter" height="240" show-value></void-bar-chart>
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
## `<void-brand>`
|
|
467
|
+
|
|
468
|
+
Product name (and mark) in a nav bar or sidebar; put an <a> inside to link it home.
|
|
469
|
+
|
|
470
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
471
|
+
|
|
472
|
+
Example:
|
|
473
|
+
|
|
474
|
+
```html
|
|
475
|
+
<void-brand><a href="/">Meridian</a></void-brand>
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
## `<void-breadcrumbs>`
|
|
479
|
+
|
|
480
|
+
Navigation trail for deep page hierarchies in dashboards, e-commerce category trees, and file browsers.
|
|
481
|
+
|
|
482
|
+
A navigation landmark named "Breadcrumb" holding an ordered list, as in the ARIA Authoring Practices breadcrumb
|
|
483
|
+
pattern: write one `<void-breadcrumbs-list>` and, in it, one `<void-breadcrumbs-item>` per crumb, each holding a
|
|
484
|
+
link (or plain text for the page you are on). Mark the current page with `aria-current="page"` on its item. The
|
|
485
|
+
list and the items are CSS-only parts; the component gives them `role="list"` and `role="listitem"` (so a screen
|
|
486
|
+
reader says "list, 3 items" and "2 of 3"), also for items added, removed or reordered later. It renders nothing of
|
|
487
|
+
its own: the separators are drawn by the theme between the items and are not exposed to assistive technology.
|
|
488
|
+
|
|
489
|
+
Parts (only these parts as children):
|
|
490
|
+
|
|
491
|
+
| Part | | Description |
|
|
492
|
+
|---|---|---|
|
|
493
|
+
| `<void-breadcrumbs-list>` | required, one, CSS-only | The list of crumbs (role="list"): the navigation landmark holds a list, as the ARIA breadcrumb pattern has it. |
|
|
494
|
+
|  `<void-breadcrumbs-item>` | required, any number, CSS-only | One crumb (role="listitem"): a link, or the current page as text. Mark the current page with aria-current="page"; the theme draws the separators between items. |
|
|
495
|
+
|
|
496
|
+
Markup: `<void-breadcrumbs><void-breadcrumbs-list><void-breadcrumbs-item><a href="/">Home</a></void-breadcrumbs-item><void-breadcrumbs-item><a href="/docs">Docs</a></void-breadcrumbs-item><void-breadcrumbs-item aria-current="page">Page</void-breadcrumbs-item></void-breadcrumbs-list></void-breadcrumbs>`
|
|
497
|
+
|
|
498
|
+
| Attribute | Values | Default | Description |
|
|
499
|
+
|---|---|---|---|
|
|
500
|
+
| `separator` | `string` | `/` | Character drawn between the crumbs. Defaults to `/`. It is drawn by CSS and hidden from assistive technology. |
|
|
501
|
+
|
|
502
|
+
Example:
|
|
503
|
+
|
|
504
|
+
```html
|
|
505
|
+
<void-breadcrumbs>
|
|
506
|
+
<void-breadcrumbs-list>
|
|
507
|
+
<void-breadcrumbs-item><a href="/">Home</a></void-breadcrumbs-item>
|
|
508
|
+
<void-breadcrumbs-item><a href="/projects">Projects</a></void-breadcrumbs-item>
|
|
509
|
+
<void-breadcrumbs-item aria-current="page">Orbital</void-breadcrumbs-item>
|
|
510
|
+
</void-breadcrumbs-list>
|
|
511
|
+
</void-breadcrumbs>
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
## `<void-breadcrumbs-item>`
|
|
515
|
+
|
|
516
|
+
One crumb (role="listitem"): a link, or the current page as text. Mark the current page with aria-current="page"; the theme draws the separators between items.
|
|
517
|
+
|
|
518
|
+
CSS-only part of `<void-breadcrumbs-list>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
519
|
+
|
|
520
|
+
Allowed inside: `<void-breadcrumbs-list>`.
|
|
521
|
+
|
|
522
|
+
Example:
|
|
523
|
+
|
|
524
|
+
```html
|
|
525
|
+
<void-breadcrumbs>
|
|
526
|
+
<void-breadcrumbs-list>
|
|
527
|
+
<void-breadcrumbs-item><a href="/">Home</a></void-breadcrumbs-item>
|
|
528
|
+
<void-breadcrumbs-item><a href="/projects">Projects</a></void-breadcrumbs-item>
|
|
529
|
+
<void-breadcrumbs-item aria-current="page">Orbital</void-breadcrumbs-item>
|
|
530
|
+
</void-breadcrumbs-list>
|
|
531
|
+
</void-breadcrumbs>
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
## `<void-breadcrumbs-list>`
|
|
535
|
+
|
|
536
|
+
The list of crumbs (role="list"): the navigation landmark holds a list, as the ARIA breadcrumb pattern has it.
|
|
537
|
+
|
|
538
|
+
CSS-only part of `<void-breadcrumbs>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
539
|
+
|
|
540
|
+
Parts (only these parts as children):
|
|
541
|
+
|
|
542
|
+
| Part | | Description |
|
|
543
|
+
|---|---|---|
|
|
544
|
+
| `<void-breadcrumbs-item>` | required, any number, CSS-only | One crumb (role="listitem"): a link, or the current page as text. Mark the current page with aria-current="page"; the theme draws the separators between items. |
|
|
545
|
+
|
|
546
|
+
Allowed inside: `<void-breadcrumbs>`.
|
|
547
|
+
|
|
548
|
+
Example:
|
|
549
|
+
|
|
550
|
+
```html
|
|
551
|
+
<void-breadcrumbs>
|
|
552
|
+
<void-breadcrumbs-list>
|
|
553
|
+
<void-breadcrumbs-item><a href="/">Home</a></void-breadcrumbs-item>
|
|
554
|
+
<void-breadcrumbs-item><a href="/projects">Projects</a></void-breadcrumbs-item>
|
|
555
|
+
<void-breadcrumbs-item aria-current="page">Orbital</void-breadcrumbs-item>
|
|
556
|
+
</void-breadcrumbs-list>
|
|
557
|
+
</void-breadcrumbs>
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
## `<void-button>`
|
|
561
|
+
|
|
562
|
+
Action trigger for forms, dialogs, and toolbars; supports semantic color variants.
|
|
563
|
+
|
|
564
|
+
Holding a link or a native button (`<void-button><a href="/docs">Docs</a></void-button>`) makes it a link
|
|
565
|
+
button: the inner element is then the one control, so the host is presentational (no role, no tab stop, no key
|
|
566
|
+
handling) and the theme draws the button's focus ring when the inner element has focus. `disabled` on a link
|
|
567
|
+
button sets `aria-disabled="true"` and `tabindex="-1"` on the link and stops it navigating (a link cannot be
|
|
568
|
+
disabled); on an inner `<button>` it disables that button.
|
|
569
|
+
|
|
570
|
+
| Attribute | Values | Default | Description |
|
|
571
|
+
|---|---|---|---|
|
|
572
|
+
| `variant` | `outline\|filled\|ghost` | `outline` | Visual weight. `outline` (default) is a bordered button, `filled` is the primary action, and `ghost` draws no border or fill until hovered: use it for row actions, toolbars and the quiet button beside a primary one. |
|
|
573
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. Use `error` for a destructive action such as Delete. |
|
|
574
|
+
| `disabled` | `boolean` | `false` | Stop the button reacting: clicks and Enter or Space do nothing and it leaves the tab order. A button inside a `<fieldset disabled>` is disabled too. |
|
|
575
|
+
| `type` | `button\|submit\|reset` | `button` | What it does to the surrounding form: `button` (default) nothing, `submit` submits the form (running validation), `reset` resets it. Set `submit` on the primary action of a form. |
|
|
576
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. Controls of the same step share one height. |
|
|
577
|
+
|
|
578
|
+
| Event | `detail` | Description |
|
|
579
|
+
|---|---|---|
|
|
580
|
+
| `void-click` | `(no detail)` | |
|
|
581
|
+
|
|
582
|
+
Example:
|
|
583
|
+
|
|
584
|
+
```html
|
|
585
|
+
<void-button variant="filled" type="submit">Save changes</void-button>
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
## `<void-calendar>`
|
|
589
|
+
|
|
590
|
+
Date selection for booking flows, scheduling UIs, and form fields with locale-aware formatting and min/max constraints.
|
|
591
|
+
|
|
592
|
+
| Attribute | Values | Default | Description |
|
|
593
|
+
|---|---|---|---|
|
|
594
|
+
| `value` | `string` | | Selected date as an ISO `YYYY-MM-DD` string. Empty means no selection. It is what the form submits and the reset target; picking a day updates it and fires `void-change`. |
|
|
595
|
+
| `min` | `string` | | Earliest selectable date, as `YYYY-MM-DD`. Earlier days are disabled. |
|
|
596
|
+
| `max` | `string` | | Latest selectable date, as `YYYY-MM-DD`. Later days are disabled. |
|
|
597
|
+
| `disabled` | `boolean` | `false` | Stop the calendar reacting and exclude the value from the form submission. |
|
|
598
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
599
|
+
| `locale` | `string` | `en-US` | BCP 47 language tag for month and weekday names and the long date announced for each day, such as `de-DE`. Defaults to `en-US`. |
|
|
600
|
+
| `first-day` | `number` | `0` | Day the week starts on, as a number from 0 (Sunday, the default) to 6 (Saturday). Use 1 for Monday. |
|
|
601
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
602
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
603
|
+
|
|
604
|
+
| Event | `detail` | Description |
|
|
605
|
+
|---|---|---|
|
|
606
|
+
| `void-change` | `{ value: string; date: Date }` | |
|
|
607
|
+
|
|
608
|
+
Example:
|
|
609
|
+
|
|
610
|
+
```html
|
|
611
|
+
<void-calendar name="arrival" value="2026-03-14" min="2026-03-01" max="2026-03-31"></void-calendar>
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
## `<void-card>`
|
|
615
|
+
|
|
616
|
+
Content grouping container for dashboard widgets, product listings, and media previews.
|
|
617
|
+
|
|
618
|
+
Its regions are parts, in this order: an optional `<void-card-header>` (holding a `<void-card-title>` and an
|
|
619
|
+
optional `<void-card-description>`), the `<void-card-body>`, and an optional `<void-card-footer>`. The parts are
|
|
620
|
+
CSS-only and the card renders nothing of its own, so the markup looks the same before and after the script
|
|
621
|
+
loads and survives any morph or re-render.
|
|
622
|
+
|
|
623
|
+
Parts (only these parts as children, in this order):
|
|
624
|
+
|
|
625
|
+
| Part | | Description |
|
|
626
|
+
|---|---|---|
|
|
627
|
+
| `<void-card-header>` | one, CSS-only | Top row of the card, divided from the body by a hairline: the title, an optional description, and anything that sits at the far end (a badge, void-actions). |
|
|
628
|
+
|  `<void-card-title>` | one, CSS-only | Title of the card. |
|
|
629
|
+
|  `<void-card-description>` | one, CSS-only | One line under the title. |
|
|
630
|
+
| `<void-card-body>` | required, one, CSS-only | Content of the card, padded by the card's `padding`. |
|
|
631
|
+
| `<void-card-footer>` | one, CSS-only | Bottom row of the card: actions or a summary line. |
|
|
632
|
+
|
|
633
|
+
Markup: `<void-card><void-card-header><void-card-title>Title</void-card-title><void-card-description>One line.</void-card-description></void-card-header><void-card-body>...</void-card-body><void-card-footer>...</void-card-footer></void-card>`
|
|
634
|
+
|
|
635
|
+
| Attribute | Values | Default | Description |
|
|
636
|
+
|---|---|---|---|
|
|
637
|
+
| `variant` | `default\|elevated\|bordered` | `default` | Surface style: `default`, `elevated` (lifted, with a shadow) or `bordered` (a visible border). |
|
|
638
|
+
| `padding` | `none\|sm\|md\|lg` | `md` | Space around the card's parts: `none`, `sm`, `md` (default) or `lg`. Use `none` for edge-to-edge content such as a table or an image. |
|
|
639
|
+
| `scrollable` | `boolean` | | Let the card shrink and scroll its content inside a height-constrained flex or grid parent. Without it the card keeps its content height and never scrolls. |
|
|
640
|
+
|
|
641
|
+
Attributes that do not exist (and what to write instead):
|
|
642
|
+
|
|
643
|
+
- `heading`: write <void-card-header><void-card-title>...</void-card-title></void-card-header> as the first child
|
|
644
|
+
|
|
645
|
+
Example:
|
|
646
|
+
|
|
647
|
+
```html
|
|
648
|
+
<void-card variant="bordered">
|
|
649
|
+
<void-card-header>
|
|
650
|
+
<void-card-title>Monthly revenue</void-card-title>
|
|
651
|
+
</void-card-header>
|
|
652
|
+
<void-card-body>
|
|
653
|
+
<p>$48,200, up 12% on last month.</p>
|
|
654
|
+
</void-card-body>
|
|
655
|
+
</void-card>
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
## `<void-card-body>`
|
|
659
|
+
|
|
660
|
+
Content of the card, padded by the card's `padding`.
|
|
661
|
+
|
|
662
|
+
CSS-only part of `<void-card>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
663
|
+
|
|
664
|
+
Allowed inside: `<void-card>`.
|
|
665
|
+
|
|
666
|
+
Example:
|
|
667
|
+
|
|
668
|
+
```html
|
|
669
|
+
<void-card variant="bordered">
|
|
670
|
+
<void-card-header>
|
|
671
|
+
<void-card-title>Monthly revenue</void-card-title>
|
|
672
|
+
</void-card-header>
|
|
673
|
+
<void-card-body>
|
|
674
|
+
<p>$48,200, up 12% on last month.</p>
|
|
675
|
+
</void-card-body>
|
|
676
|
+
</void-card>
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
## `<void-card-description>`
|
|
680
|
+
|
|
681
|
+
One line under the title.
|
|
682
|
+
|
|
683
|
+
CSS-only part of `<void-card-header>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
684
|
+
|
|
685
|
+
Allowed inside: `<void-card-header>`.
|
|
686
|
+
|
|
687
|
+
Example:
|
|
688
|
+
|
|
689
|
+
```html
|
|
690
|
+
<void-card variant="bordered">
|
|
691
|
+
<void-card-header>
|
|
692
|
+
<void-card-title>Monthly revenue</void-card-title>
|
|
693
|
+
</void-card-header>
|
|
694
|
+
<void-card-body>
|
|
695
|
+
<p>$48,200, up 12% on last month.</p>
|
|
696
|
+
</void-card-body>
|
|
697
|
+
</void-card>
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
## `<void-card-footer>`
|
|
701
|
+
|
|
702
|
+
Bottom row of the card: actions or a summary line.
|
|
703
|
+
|
|
704
|
+
CSS-only part of `<void-card>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
705
|
+
|
|
706
|
+
Allowed inside: `<void-card>`.
|
|
707
|
+
|
|
708
|
+
Example:
|
|
709
|
+
|
|
710
|
+
```html
|
|
711
|
+
<void-card variant="bordered">
|
|
712
|
+
<void-card-header>
|
|
713
|
+
<void-card-title>Monthly revenue</void-card-title>
|
|
714
|
+
</void-card-header>
|
|
715
|
+
<void-card-body>
|
|
716
|
+
<p>$48,200, up 12% on last month.</p>
|
|
717
|
+
</void-card-body>
|
|
718
|
+
</void-card>
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
## `<void-card-header>`
|
|
722
|
+
|
|
723
|
+
Top row of the card, divided from the body by a hairline: the title, an optional description, and anything that sits at the far end (a badge, void-actions).
|
|
724
|
+
|
|
725
|
+
CSS-only part of `<void-card>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
726
|
+
|
|
727
|
+
Parts (parts mixed with other content):
|
|
728
|
+
|
|
729
|
+
| Part | | Description |
|
|
730
|
+
|---|---|---|
|
|
731
|
+
| `<void-card-title>` | one, CSS-only | Title of the card. |
|
|
732
|
+
| `<void-card-description>` | one, CSS-only | One line under the title. |
|
|
733
|
+
|
|
734
|
+
Allowed inside: `<void-card>`.
|
|
735
|
+
|
|
736
|
+
Example:
|
|
737
|
+
|
|
738
|
+
```html
|
|
739
|
+
<void-card variant="bordered">
|
|
740
|
+
<void-card-header>
|
|
741
|
+
<void-card-title>Monthly revenue</void-card-title>
|
|
742
|
+
</void-card-header>
|
|
743
|
+
<void-card-body>
|
|
744
|
+
<p>$48,200, up 12% on last month.</p>
|
|
745
|
+
</void-card-body>
|
|
746
|
+
</void-card>
|
|
747
|
+
```
|
|
748
|
+
|
|
749
|
+
## `<void-card-title>`
|
|
750
|
+
|
|
751
|
+
Title of the card.
|
|
752
|
+
|
|
753
|
+
CSS-only part of `<void-card-header>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
754
|
+
|
|
755
|
+
Allowed inside: `<void-card-header>`.
|
|
756
|
+
|
|
757
|
+
Example:
|
|
758
|
+
|
|
759
|
+
```html
|
|
760
|
+
<void-card variant="bordered">
|
|
761
|
+
<void-card-header>
|
|
762
|
+
<void-card-title>Monthly revenue</void-card-title>
|
|
763
|
+
</void-card-header>
|
|
764
|
+
<void-card-body>
|
|
765
|
+
<p>$48,200, up 12% on last month.</p>
|
|
766
|
+
</void-card-body>
|
|
767
|
+
</void-card>
|
|
768
|
+
```
|
|
769
|
+
|
|
770
|
+
## `<void-carousel>`
|
|
771
|
+
|
|
772
|
+
Scrollable content gallery for product photo viewers, onboarding flows, and featured content sliders.
|
|
773
|
+
|
|
774
|
+
Its regions are parts, in this order: the `<void-carousel-content>` holding the `<void-carousel-item>`s (the
|
|
775
|
+
slides), then the optional controls: `<void-carousel-previous>` and `<void-carousel-next>` (arrows) and
|
|
776
|
+
`<void-carousel-indicators>` (a row of dots). A control is shown when you write it and absent when you do not.
|
|
777
|
+
The component moves nothing: the content and the items are CSS-only parts the theme slides with a custom
|
|
778
|
+
property, and the dots are the only nodes it creates, inside your empty `<void-carousel-indicators>`.
|
|
779
|
+
|
|
780
|
+
Parts (only these parts as children, in this order):
|
|
781
|
+
|
|
782
|
+
| Part | | Description |
|
|
783
|
+
|---|---|---|
|
|
784
|
+
| `<void-carousel-content>` | required, one, CSS-only | The window the slides move in. |
|
|
785
|
+
|  `<void-carousel-item>` | required, any number, CSS-only | One slide (role="group"); the carousel marks the slide being shown with active. |
|
|
786
|
+
| `<void-carousel-previous>` | one | Arrow button to the previous slide. Empty, it shows the theme arrow; give it an aria-label. |
|
|
787
|
+
| `<void-carousel-next>` | one | Arrow button to the next slide. Empty, it shows the theme arrow; give it an aria-label. |
|
|
788
|
+
| `<void-carousel-indicators>` | one, CSS-only | Leave it empty: the carousel fills it with one dot button per slide. |
|
|
789
|
+
|
|
790
|
+
Markup: `<void-carousel><void-carousel-content><void-carousel-item>One</void-carousel-item><void-carousel-item>Two</void-carousel-item></void-carousel-content><void-carousel-previous aria-label="Previous slide"></void-carousel-previous><void-carousel-next aria-label="Next slide"></void-carousel-next><void-carousel-indicators></void-carousel-indicators></void-carousel>`
|
|
791
|
+
|
|
792
|
+
| Attribute | Values | Default | Description |
|
|
793
|
+
|---|---|---|---|
|
|
794
|
+
| `index` | `number` | `0` | Zero-based index of the slide being shown. Set it to jump to a slide; the arrows, indicators and arrow keys update it and fire `void-change`. |
|
|
795
|
+
| `loop` | `boolean` | `false` | Wrap around: Next on the last slide goes to the first, and Previous on the first goes to the last. Without it the arrows stop at the ends. |
|
|
796
|
+
| `autoplay` | `boolean` | `false` | Advance to the next slide every `interval` milliseconds. It pauses while the pointer is over the carousel. |
|
|
797
|
+
| `interval` | `number` | `5000` | Milliseconds between slides when `autoplay` is on. Defaults to 5000. |
|
|
798
|
+
| `size` | `sm\|md\|lg` | `md` | Size step of the carousel: `sm`, `md` (default) or `lg`. |
|
|
799
|
+
| `orientation` | `horizontal\|vertical` | `horizontal` | Direction slides advance: `horizontal` (default, Left and Right arrow keys) or `vertical` (Up and Down). |
|
|
800
|
+
|
|
801
|
+
| Event | `detail` | Description |
|
|
802
|
+
|---|---|---|
|
|
803
|
+
| `void-change` | `{ value: number; index: number; previous: number }` | The shown slide changed; `value` and `index` are both the new slide's index. |
|
|
804
|
+
|
|
805
|
+
Attributes that do not exist (and what to write instead):
|
|
806
|
+
|
|
807
|
+
- `controls`: write <void-carousel-previous aria-label="Previous slide"></void-carousel-previous> and <void-carousel-next aria-label="Next slide"></void-carousel-next> after the content; leave them out for no arrows
|
|
808
|
+
- `indicators`: write an empty <void-carousel-indicators></void-carousel-indicators> after the content; leave it out for no dots
|
|
809
|
+
|
|
810
|
+
Example:
|
|
811
|
+
|
|
812
|
+
```html
|
|
813
|
+
<void-carousel loop>
|
|
814
|
+
<void-carousel-content>
|
|
815
|
+
<void-carousel-item>Step 1: Create a project</void-carousel-item>
|
|
816
|
+
<void-carousel-item>Step 2: Invite your team</void-carousel-item>
|
|
817
|
+
<void-carousel-item>Step 3: Ship</void-carousel-item>
|
|
818
|
+
</void-carousel-content>
|
|
819
|
+
<void-carousel-previous aria-label="Previous slide"></void-carousel-previous>
|
|
820
|
+
<void-carousel-next aria-label="Next slide"></void-carousel-next>
|
|
821
|
+
<void-carousel-indicators></void-carousel-indicators>
|
|
822
|
+
</void-carousel>
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
## `<void-carousel-content>`
|
|
826
|
+
|
|
827
|
+
The window the slides move in.
|
|
828
|
+
|
|
829
|
+
CSS-only part of `<void-carousel>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
830
|
+
|
|
831
|
+
Parts (only these parts as children):
|
|
832
|
+
|
|
833
|
+
| Part | | Description |
|
|
834
|
+
|---|---|---|
|
|
835
|
+
| `<void-carousel-item>` | required, any number, CSS-only | One slide (role="group"); the carousel marks the slide being shown with active. |
|
|
836
|
+
|
|
837
|
+
Allowed inside: `<void-carousel>`.
|
|
838
|
+
|
|
839
|
+
Example:
|
|
840
|
+
|
|
841
|
+
```html
|
|
842
|
+
<void-carousel loop>
|
|
843
|
+
<void-carousel-content>
|
|
844
|
+
<void-carousel-item>Step 1: Create a project</void-carousel-item>
|
|
845
|
+
<void-carousel-item>Step 2: Invite your team</void-carousel-item>
|
|
846
|
+
<void-carousel-item>Step 3: Ship</void-carousel-item>
|
|
847
|
+
</void-carousel-content>
|
|
848
|
+
<void-carousel-previous aria-label="Previous slide"></void-carousel-previous>
|
|
849
|
+
<void-carousel-next aria-label="Next slide"></void-carousel-next>
|
|
850
|
+
<void-carousel-indicators></void-carousel-indicators>
|
|
851
|
+
</void-carousel>
|
|
852
|
+
```
|
|
853
|
+
|
|
854
|
+
## `<void-carousel-indicators>`
|
|
855
|
+
|
|
856
|
+
Leave it empty: the carousel fills it with one dot button per slide.
|
|
857
|
+
|
|
858
|
+
CSS-only part of `<void-carousel>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
859
|
+
|
|
860
|
+
Allowed inside: `<void-carousel>`.
|
|
861
|
+
|
|
862
|
+
Example:
|
|
863
|
+
|
|
864
|
+
```html
|
|
865
|
+
<void-carousel loop>
|
|
866
|
+
<void-carousel-content>
|
|
867
|
+
<void-carousel-item>Step 1: Create a project</void-carousel-item>
|
|
868
|
+
<void-carousel-item>Step 2: Invite your team</void-carousel-item>
|
|
869
|
+
<void-carousel-item>Step 3: Ship</void-carousel-item>
|
|
870
|
+
</void-carousel-content>
|
|
871
|
+
<void-carousel-previous aria-label="Previous slide"></void-carousel-previous>
|
|
872
|
+
<void-carousel-next aria-label="Next slide"></void-carousel-next>
|
|
873
|
+
<void-carousel-indicators></void-carousel-indicators>
|
|
874
|
+
</void-carousel>
|
|
875
|
+
```
|
|
876
|
+
|
|
877
|
+
## `<void-carousel-item>`
|
|
878
|
+
|
|
879
|
+
One slide (role="group"); the carousel marks the slide being shown with active.
|
|
880
|
+
|
|
881
|
+
CSS-only part of `<void-carousel-content>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
882
|
+
|
|
883
|
+
| Attribute | Values | Default | Description |
|
|
884
|
+
|---|---|---|---|
|
|
885
|
+
| `active` | `boolean` | | Set by <void-carousel> on the slide being shown. |
|
|
886
|
+
|
|
887
|
+
Allowed inside: `<void-carousel-content>`.
|
|
888
|
+
|
|
889
|
+
Example:
|
|
890
|
+
|
|
891
|
+
```html
|
|
892
|
+
<void-carousel loop>
|
|
893
|
+
<void-carousel-content>
|
|
894
|
+
<void-carousel-item>Step 1: Create a project</void-carousel-item>
|
|
895
|
+
<void-carousel-item>Step 2: Invite your team</void-carousel-item>
|
|
896
|
+
<void-carousel-item>Step 3: Ship</void-carousel-item>
|
|
897
|
+
</void-carousel-content>
|
|
898
|
+
<void-carousel-previous aria-label="Previous slide"></void-carousel-previous>
|
|
899
|
+
<void-carousel-next aria-label="Next slide"></void-carousel-next>
|
|
900
|
+
<void-carousel-indicators></void-carousel-indicators>
|
|
901
|
+
</void-carousel>
|
|
902
|
+
```
|
|
903
|
+
|
|
904
|
+
## `<void-carousel-next>`
|
|
905
|
+
|
|
906
|
+
Next-slide control of a `<void-carousel>`: a button the theme draws as an arrow over the slides. Write it as an
|
|
907
|
+
empty element with an `aria-label` ("Next slide"); any content you put inside replaces the arrow. It is
|
|
908
|
+
aria-disabled on the last slide unless the carousel has `loop`.
|
|
909
|
+
|
|
910
|
+
Allowed inside: `<void-carousel>`.
|
|
911
|
+
|
|
912
|
+
Example:
|
|
913
|
+
|
|
914
|
+
```html
|
|
915
|
+
<void-carousel>
|
|
916
|
+
<void-carousel-content>
|
|
917
|
+
<void-carousel-item>Step 1: Create a project</void-carousel-item>
|
|
918
|
+
<void-carousel-item>Step 2: Invite your team</void-carousel-item>
|
|
919
|
+
</void-carousel-content>
|
|
920
|
+
<void-carousel-previous aria-label="Previous slide"></void-carousel-previous>
|
|
921
|
+
<void-carousel-next aria-label="Next slide"></void-carousel-next>
|
|
922
|
+
</void-carousel>
|
|
923
|
+
```
|
|
924
|
+
|
|
925
|
+
## `<void-carousel-previous>`
|
|
926
|
+
|
|
927
|
+
Previous-slide control of a `<void-carousel>`: a button the theme draws as an arrow over the slides. Write it
|
|
928
|
+
as an empty element with an `aria-label` ("Previous slide"); any content you put inside replaces the arrow.
|
|
929
|
+
It is aria-disabled on the first slide unless the carousel has `loop`.
|
|
930
|
+
|
|
931
|
+
Allowed inside: `<void-carousel>`.
|
|
932
|
+
|
|
933
|
+
Example:
|
|
934
|
+
|
|
935
|
+
```html
|
|
936
|
+
<void-carousel>
|
|
937
|
+
<void-carousel-content>
|
|
938
|
+
<void-carousel-item>Step 1: Create a project</void-carousel-item>
|
|
939
|
+
<void-carousel-item>Step 2: Invite your team</void-carousel-item>
|
|
940
|
+
</void-carousel-content>
|
|
941
|
+
<void-carousel-previous aria-label="Previous slide"></void-carousel-previous>
|
|
942
|
+
<void-carousel-next aria-label="Next slide"></void-carousel-next>
|
|
943
|
+
</void-carousel>
|
|
944
|
+
```
|
|
945
|
+
|
|
946
|
+
## `<void-checkbox>`
|
|
947
|
+
|
|
948
|
+
Binary or indeterminate selection for form fields, data table row selection, and toggle-able settings.
|
|
949
|
+
|
|
950
|
+
| Attribute | Values | Default | Description |
|
|
951
|
+
|---|---|---|---|
|
|
952
|
+
| `checked` | `boolean` | `false` | Whether the box is checked. Reflected to the attribute as the user toggles it or a script sets it; the form's reset target stays the state it started with. |
|
|
953
|
+
| `disabled` | `boolean` | `false` | Stop the box reacting and exclude it from the form submission. Also disabled by a `<fieldset disabled>` or a disabled `void-checkbox-group` around it. |
|
|
954
|
+
| `indeterminate` | `boolean` | `false` | Show the mixed state (a dash) for a parent box whose children are partly checked. It is purely visual and cleared when the user toggles the box. |
|
|
955
|
+
| `name` | `string` | | Key the value is submitted under while the box is checked. Within a `void-checkbox-group` the group's `name` is used. |
|
|
956
|
+
| `value` | `string` | `on` | Submitted under `name` while checked; defaults to "on" like a native checkbox. |
|
|
957
|
+
| `required` | `boolean` | `false` | Must be checked. Forwarded to the native checkbox, which the browser validates; when it focuses that (aria-hidden) input, focus moves to the host. |
|
|
958
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the checked box: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
959
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
960
|
+
| `form` | `string \| null` | | `id` of a `<form>` elsewhere in the page that this control belongs to, as on a native control. Without it the control belongs to the form it sits inside. |
|
|
961
|
+
|
|
962
|
+
| Event | `detail` | Description |
|
|
963
|
+
|---|---|---|
|
|
964
|
+
| `void-change` | `{ value: string; checked: boolean }` | |
|
|
965
|
+
|
|
966
|
+
Example:
|
|
967
|
+
|
|
968
|
+
```html
|
|
969
|
+
<void-checkbox name="terms" required>I accept the terms of service</void-checkbox>
|
|
970
|
+
```
|
|
971
|
+
|
|
972
|
+
## `<void-checkbox-group>`
|
|
973
|
+
|
|
974
|
+
Grouped multi-option selection for preference forms, filter panels, and permission editors.
|
|
975
|
+
|
|
976
|
+
Form strategy: pass-through. `name` is forwarded to the child void-checkbox
|
|
977
|
+
elements, whose native checkboxes submit one entry per checked box; the
|
|
978
|
+
group itself submits nothing and each checkbox resets itself. `required`
|
|
979
|
+
means "at least one checked", enforced with setCustomValidity on the first
|
|
980
|
+
enabled checkbox's native input. `disabled` and `form` are forwarded.
|
|
981
|
+
|
|
982
|
+
| Attribute | Values | Default | Description |
|
|
983
|
+
|---|---|---|---|
|
|
984
|
+
| `label` | `string` | | Name of the group, shown above the boxes and used as its accessible name. |
|
|
985
|
+
| `orientation` | `vertical\|horizontal` | `vertical` | Lay the checkboxes out in a `vertical` column (default) or a `horizontal` row. |
|
|
986
|
+
| `name` | `string` | | Field name forwarded to every child checkbox. |
|
|
987
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
988
|
+
| `disabled` | `boolean` | `false` | Disables every checkbox in the group (like a fieldset). |
|
|
989
|
+
| `value` | `string[]` | `[]` | Check exactly the child checkboxes whose value is listed. Does not fire void-change. |
|
|
990
|
+
| `form` | `string \| null` | | `id` of a `<form>` elsewhere in the page that this control belongs to, as on a native control. Without it the control belongs to the form it sits inside. |
|
|
991
|
+
|
|
992
|
+
| Event | `detail` | Description |
|
|
993
|
+
|---|---|---|
|
|
994
|
+
| `void-change` | `{ value: string[] }` | |
|
|
995
|
+
|
|
996
|
+
Example:
|
|
997
|
+
|
|
998
|
+
```html
|
|
999
|
+
<void-checkbox-group label="Notify me about" name="notify">
|
|
1000
|
+
<void-checkbox value="comments" checked>Comments</void-checkbox>
|
|
1001
|
+
<void-checkbox value="mentions">Mentions</void-checkbox>
|
|
1002
|
+
<void-checkbox value="releases">Releases</void-checkbox>
|
|
1003
|
+
</void-checkbox-group>
|
|
1004
|
+
```
|
|
1005
|
+
|
|
1006
|
+
## `<void-collapsible>`
|
|
1007
|
+
|
|
1008
|
+
Simple expand/collapse panel for FAQ sections, spoiler text, and progressive disclosure of secondary content.
|
|
1009
|
+
|
|
1010
|
+
Written as two parts: a `<void-collapsible-trigger>` (the heading text that toggles it) followed by a
|
|
1011
|
+
`<void-collapsible-content>`. Both are written by the author and never moved. The trigger becomes the button
|
|
1012
|
+
(`role="button"`, a tab stop, Enter and Space, `aria-expanded`, `aria-controls`); the content is the region it
|
|
1013
|
+
names. Closed content is hidden by the theme from the host's `open` attribute, before the script loads as well, and
|
|
1014
|
+
opens and closes with a height animation (a grid row, no measuring; off under `prefers-reduced-motion` and when
|
|
1015
|
+
`--void-anim-scale` is 0). Where the browser supports `hidden="until-found"` the closed content carries it, so it is
|
|
1016
|
+
out of the accessibility tree and find-in-page opens the panel when it finds text inside.
|
|
1017
|
+
|
|
1018
|
+
Parts (only these parts as children, in this order):
|
|
1019
|
+
|
|
1020
|
+
| Part | | Description |
|
|
1021
|
+
|---|---|---|
|
|
1022
|
+
| `<void-collapsible-trigger>` | required, one, CSS-only | Heading text of the panel; becomes the button that opens and closes it. |
|
|
1023
|
+
| `<void-collapsible-content>` | required, one, CSS-only | Content shown while the panel is open. |
|
|
1024
|
+
|
|
1025
|
+
Markup: `<void-collapsible open><void-collapsible-trigger>Advanced options</void-collapsible-trigger><void-collapsible-content>...</void-collapsible-content></void-collapsible>`
|
|
1026
|
+
|
|
1027
|
+
| Attribute | Values | Default | Description |
|
|
1028
|
+
|---|---|---|---|
|
|
1029
|
+
| `open` | `boolean` | `false` | Whether the content is shown. Add the attribute to start open; it follows the user's toggling. |
|
|
1030
|
+
| `disabled` | `boolean` | `false` | Stop the panel from toggling. The trigger ignores clicks and Enter or Space. |
|
|
1031
|
+
|
|
1032
|
+
| Event | `detail` | Description |
|
|
1033
|
+
|---|---|---|
|
|
1034
|
+
| `void-close` | `{ reason: 'trigger' \| 'keyboard' }` | The user is closing the panel. Cancelable: `preventDefault()` keeps it open. Does not bubble. |
|
|
1035
|
+
| `void-open` | `{ reason: 'trigger' \| 'keyboard' \| 'find' }` | The panel opened: a click on the trigger, Enter or Space on it, or find-in-page found text inside. Does not bubble. |
|
|
1036
|
+
|
|
1037
|
+
Attributes that do not exist (and what to write instead):
|
|
1038
|
+
|
|
1039
|
+
- `heading`: write the heading as <void-collapsible-trigger>...</void-collapsible-trigger> and the content in <void-collapsible-content> after it
|
|
1040
|
+
|
|
1041
|
+
Example:
|
|
1042
|
+
|
|
1043
|
+
```html
|
|
1044
|
+
<void-collapsible>
|
|
1045
|
+
<void-collapsible-trigger>Advanced options</void-collapsible-trigger>
|
|
1046
|
+
<void-collapsible-content>
|
|
1047
|
+
<p>Retry failed jobs automatically, up to three times.</p>
|
|
1048
|
+
</void-collapsible-content>
|
|
1049
|
+
</void-collapsible>
|
|
1050
|
+
```
|
|
1051
|
+
|
|
1052
|
+
## `<void-collapsible-content>`
|
|
1053
|
+
|
|
1054
|
+
Content shown while the panel is open.
|
|
1055
|
+
|
|
1056
|
+
CSS-only part of `<void-collapsible>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1057
|
+
|
|
1058
|
+
Allowed inside: `<void-collapsible>`.
|
|
1059
|
+
|
|
1060
|
+
Example:
|
|
1061
|
+
|
|
1062
|
+
```html
|
|
1063
|
+
<void-collapsible>
|
|
1064
|
+
<void-collapsible-trigger>Advanced options</void-collapsible-trigger>
|
|
1065
|
+
<void-collapsible-content>
|
|
1066
|
+
<p>Retry failed jobs automatically, up to three times.</p>
|
|
1067
|
+
</void-collapsible-content>
|
|
1068
|
+
</void-collapsible>
|
|
1069
|
+
```
|
|
1070
|
+
|
|
1071
|
+
## `<void-collapsible-trigger>`
|
|
1072
|
+
|
|
1073
|
+
Heading text of the panel; becomes the button that opens and closes it.
|
|
1074
|
+
|
|
1075
|
+
CSS-only part of `<void-collapsible>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1076
|
+
|
|
1077
|
+
Allowed inside: `<void-collapsible>`.
|
|
1078
|
+
|
|
1079
|
+
Example:
|
|
1080
|
+
|
|
1081
|
+
```html
|
|
1082
|
+
<void-collapsible>
|
|
1083
|
+
<void-collapsible-trigger>Advanced options</void-collapsible-trigger>
|
|
1084
|
+
<void-collapsible-content>
|
|
1085
|
+
<p>Retry failed jobs automatically, up to three times.</p>
|
|
1086
|
+
</void-collapsible-content>
|
|
1087
|
+
</void-collapsible>
|
|
1088
|
+
```
|
|
1089
|
+
|
|
1090
|
+
## `<void-color-picker>`
|
|
1091
|
+
|
|
1092
|
+
Color selection control with spectrum area, hue slider, hex input, and preset swatches for theme customization and design tools.
|
|
1093
|
+
|
|
1094
|
+
| Attribute | Values | Default | Description |
|
|
1095
|
+
|---|---|---|---|
|
|
1096
|
+
| `value` | `string` | `#000000` | Selected colour as a hex string (six digits after the hash). Defaults to black. Reflected to the attribute as it changes; the form's reset target stays the value it started with. |
|
|
1097
|
+
| `disabled` | `boolean` | `false` | Stop the picker reacting and exclude the value from the form submission. |
|
|
1098
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
1099
|
+
| `swatches` | `string[]` | `[]` | Preset colours as an array of hex strings shown under the spectrum. Set it as a property from script (`el.swatches = [red, green]`, each a hex string) or as a JSON array in the attribute. |
|
|
1100
|
+
| `hide-input` | `boolean` | `false` | Leave out the hex text field under the spectrum (it is shown by default). |
|
|
1101
|
+
| `compact` | `boolean` | `false` | Show only a swatch button that opens the picker in a popup, instead of the full picker inline. |
|
|
1102
|
+
| `open` | `boolean` | `false` | Whether the compact variant's picker is open. Only meaningful with `compact`. |
|
|
1103
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
1104
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
1105
|
+
|
|
1106
|
+
| Event | `detail` | Description |
|
|
1107
|
+
|---|---|---|
|
|
1108
|
+
| `void-change` | `{ value: string }` | |
|
|
1109
|
+
|
|
1110
|
+
Example:
|
|
1111
|
+
|
|
1112
|
+
```html
|
|
1113
|
+
<void-field label="Brand colour">
|
|
1114
|
+
<void-color-picker name="brand" value="#3366ff"></void-color-picker>
|
|
1115
|
+
</void-field>
|
|
1116
|
+
```
|
|
1117
|
+
|
|
1118
|
+
## `<void-combobox>`
|
|
1119
|
+
|
|
1120
|
+
Filterable dropdown for long option lists like country selectors, user assignment fields, and tag pickers.
|
|
1121
|
+
|
|
1122
|
+
One part, `<void-combobox-content>`, holding the `<void-option>`s: it is the list (`role="listbox"`) shown in the
|
|
1123
|
+
top layer under the field. The component renders the text field itself (after the content part) and never
|
|
1124
|
+
moves, copies or wraps the options: each `<void-option>` is the `role="option"` the browser and assistive
|
|
1125
|
+
technology see.
|
|
1126
|
+
|
|
1127
|
+
Follows the WAI-ARIA "editable combobox with list autocomplete" pattern (manual selection): the rendered input
|
|
1128
|
+
carries `role="combobox"` and keeps DOM focus; the highlighted option is exposed with `aria-activedescendant`
|
|
1129
|
+
and drawn with the `active` attribute; the chosen option has `aria-selected="true"`.
|
|
1130
|
+
|
|
1131
|
+
Keyboard (focus in the input): ArrowDown opens the list and highlights the chosen option, else the first one
|
|
1132
|
+
(open: the next option, wrapping); ArrowUp the same towards the last; Alt+ArrowDown opens it without
|
|
1133
|
+
highlighting; Enter chooses the highlighted option and closes the list (with nothing highlighted it closes the
|
|
1134
|
+
list and lets a surrounding form submit); Escape closes the list (a second Escape reaches the surrounding
|
|
1135
|
+
dialog); ArrowLeft, ArrowRight, Home and End move the text cursor and take the highlight off the list; typing
|
|
1136
|
+
filters the options; Tab closes the list. Disabled options are skipped.
|
|
1137
|
+
|
|
1138
|
+
The list is shown in the top layer (never clipped by an `overflow` or `transform` ancestor) and placed under the
|
|
1139
|
+
input with CSS anchor positioning, flipping above it near the bottom of the viewport. A press outside closes it
|
|
1140
|
+
too; focus stays in the input.
|
|
1141
|
+
|
|
1142
|
+
Parts (only these parts as children):
|
|
1143
|
+
|
|
1144
|
+
| Part | | Description |
|
|
1145
|
+
|---|---|---|
|
|
1146
|
+
| `<void-combobox-content>` | required, one, CSS-only | The option list (role="listbox") shown in the top layer under the field; holds the `<void-option>`s, which stay where they are. |
|
|
1147
|
+
|
|
1148
|
+
Markup: `<void-combobox name="country" placeholder="Search countries"><void-combobox-content><void-option value="de">Germany</void-option><void-option value="fr">France</void-option></void-combobox-content></void-combobox>`
|
|
1149
|
+
|
|
1150
|
+
| Attribute | Values | Default | Description |
|
|
1151
|
+
|---|---|---|---|
|
|
1152
|
+
| `value` | `string` | | `value` of the chosen `void-option`. Reflected to the attribute as the choice changes. Written in markup it is the initial choice (without it, an option marked `selected` is), which a form reset restores. |
|
|
1153
|
+
| `placeholder` | `string` | `Search...` | Hint shown in the search field while it is empty. Defaults to `Search...`. It is also the field's accessible name when no `void-field` label names it. |
|
|
1154
|
+
| `disabled` | `boolean` | `false` | Stop the field opening and exclude the value from the form submission. |
|
|
1155
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
1156
|
+
| `error` | `string` | | Mark the field invalid: it gets the error styling and `aria-invalid`. The message itself is shown by the wrapping `void-field`. |
|
|
1157
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
1158
|
+
| `open` | `boolean` | `false` | Whether the option list is showing. Reflected, so it can be read (and set) from markup. |
|
|
1159
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
1160
|
+
|
|
1161
|
+
| Event | `detail` | Description |
|
|
1162
|
+
|---|---|---|
|
|
1163
|
+
| `void-change` | `{ value: string }` | |
|
|
1164
|
+
| `void-open` | `{ reason: 'keyboard' \| 'focus' \| 'api' }` | The option list opened. |
|
|
1165
|
+
| `void-close` | `{ reason: 'escape' \| 'outside' \| 'blur' \| 'select' \| 'parent' \| 'api' }` | The option list is closing. |
|
|
1166
|
+
|
|
1167
|
+
Example:
|
|
1168
|
+
|
|
1169
|
+
```html
|
|
1170
|
+
<void-field label="Country">
|
|
1171
|
+
<void-combobox name="country" placeholder="Search countries">
|
|
1172
|
+
<void-combobox-content>
|
|
1173
|
+
<void-option value="ca">Canada</void-option>
|
|
1174
|
+
<void-option value="fr">France</void-option>
|
|
1175
|
+
<void-option value="jp">Japan</void-option>
|
|
1176
|
+
<void-option value="no">Norway</void-option>
|
|
1177
|
+
</void-combobox-content>
|
|
1178
|
+
</void-combobox>
|
|
1179
|
+
</void-field>
|
|
1180
|
+
```
|
|
1181
|
+
|
|
1182
|
+
## `<void-combobox-content>`
|
|
1183
|
+
|
|
1184
|
+
The option list (role="listbox") shown in the top layer under the field; holds the `<void-option>`s, which stay where they are.
|
|
1185
|
+
|
|
1186
|
+
CSS-only part of `<void-combobox>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1187
|
+
|
|
1188
|
+
| Attribute | Values | Default | Description |
|
|
1189
|
+
|---|---|---|---|
|
|
1190
|
+
| `empty` | `boolean` | | Set by the combobox while no option matches the typed text; the theme then shows "No options found". |
|
|
1191
|
+
|
|
1192
|
+
Allowed inside: `<void-combobox>`.
|
|
1193
|
+
|
|
1194
|
+
Example:
|
|
1195
|
+
|
|
1196
|
+
```html
|
|
1197
|
+
<void-field label="Country">
|
|
1198
|
+
<void-combobox name="country" placeholder="Search countries">
|
|
1199
|
+
<void-combobox-content>
|
|
1200
|
+
<void-option value="ca">Canada</void-option>
|
|
1201
|
+
<void-option value="fr">France</void-option>
|
|
1202
|
+
<void-option value="jp">Japan</void-option>
|
|
1203
|
+
<void-option value="no">Norway</void-option>
|
|
1204
|
+
</void-combobox-content>
|
|
1205
|
+
</void-combobox>
|
|
1206
|
+
</void-field>
|
|
1207
|
+
```
|
|
1208
|
+
|
|
1209
|
+
## `<void-compose-input>`
|
|
1210
|
+
|
|
1211
|
+
Rich text entry area for messaging UIs, comment boxes, and social post composers.
|
|
1212
|
+
|
|
1213
|
+
| Attribute | Values | Default | Description |
|
|
1214
|
+
|---|---|---|---|
|
|
1215
|
+
| `value` | `string` | | The draft text, reflected to the `value` attribute as it changes. It is cleared after each send. |
|
|
1216
|
+
| `placeholder` | `string` | `Type a message...` | Hint shown while the box is empty. Defaults to `Type a message...`. |
|
|
1217
|
+
| `disabled` | `boolean` | `false` | Stop the box and the send button reacting. |
|
|
1218
|
+
| `maxlength` | `number` | `0` | Maximum number of characters. 0 (the default) means no limit. |
|
|
1219
|
+
|
|
1220
|
+
| Event | `detail` | Description |
|
|
1221
|
+
|---|---|---|
|
|
1222
|
+
| `void-input` | `{ value: string }` | |
|
|
1223
|
+
| `void-submit` | `{ value: string }` | |
|
|
1224
|
+
|
|
1225
|
+
Example:
|
|
1226
|
+
|
|
1227
|
+
```html
|
|
1228
|
+
<void-compose-input aria-label="Reply" placeholder="Reply to the thread" maxlength="500"></void-compose-input>
|
|
1229
|
+
```
|
|
1230
|
+
|
|
1231
|
+
## `<void-date-picker>`
|
|
1232
|
+
|
|
1233
|
+
Input-anchored date picker that combines a text field with a VoidCalendar dropdown for form date selection.
|
|
1234
|
+
|
|
1235
|
+
The calendar opens in a non-modal popup dialog in the top layer, placed under the input with CSS anchor
|
|
1236
|
+
positioning (flipping above near the bottom of the viewport). A click on the field opens it and leaves focus
|
|
1237
|
+
in the field (ArrowDown then moves into the calendar); the calendar button, Enter, Space or ArrowDown on the
|
|
1238
|
+
field open it with focus on the selected (or current) day. Choosing a day, Escape, or a press outside closes
|
|
1239
|
+
it and focus returns to the input.
|
|
1240
|
+
|
|
1241
|
+
| Attribute | Values | Default | Description |
|
|
1242
|
+
|---|---|---|---|
|
|
1243
|
+
| `value` | `string` | | Selected date as an ISO `YYYY-MM-DD` string, whatever `format` shows. It is what the form submits and the reset target. |
|
|
1244
|
+
| `min` | `string` | | Earliest selectable date, as `YYYY-MM-DD`. |
|
|
1245
|
+
| `max` | `string` | | Latest selectable date, as `YYYY-MM-DD`. |
|
|
1246
|
+
| `disabled` | `boolean` | `false` | Stop the field and its calendar reacting and exclude the value from the form submission. |
|
|
1247
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
1248
|
+
| `locale` | `string` | `en-US` | BCP 47 language tag for the calendar's month and weekday names, such as `de-DE`. Defaults to `en-US`. It does not change `format`. |
|
|
1249
|
+
| `first-day` | `number` | `0` | Day the calendar week starts on, as a number from 0 (Sunday, the default) to 6 (Saturday). |
|
|
1250
|
+
| `open` | `boolean` | `false` | Whether the calendar dropdown is showing. Clicking the field or button toggles it; Escape closes it. |
|
|
1251
|
+
| `placeholder` | `string` | `Select date` | Hint shown in the field while no date is chosen. Defaults to `Select date`. |
|
|
1252
|
+
| `format` | `string` | `MM/DD/YYYY` | How the chosen date is written in the field, using `YYYY`, `MM` and `DD`. Defaults to `MM/DD/YYYY`. Display only; the value stays `YYYY-MM-DD`. |
|
|
1253
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the field: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
1254
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
1255
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
1256
|
+
|
|
1257
|
+
| Event | `detail` | Description |
|
|
1258
|
+
|---|---|---|
|
|
1259
|
+
| `void-open` | `{ reason: 'trigger' \| 'focus' \| 'keyboard' \| 'api' }` | The calendar popup opened: `trigger` from the calendar button, `focus` from a click on the field, `keyboard` from a key. |
|
|
1260
|
+
| `void-close` | `{ reason: 'trigger' \| 'select' \| 'escape' \| 'outside' \| 'blur' \| 'parent' \| 'api' }` | The calendar popup is closing. Cancelable when the user caused it. |
|
|
1261
|
+
| `void-change` | `{ value: string; date: Date }` | |
|
|
1262
|
+
|
|
1263
|
+
Example:
|
|
1264
|
+
|
|
1265
|
+
```html
|
|
1266
|
+
<void-field label="Check-in">
|
|
1267
|
+
<void-date-picker name="checkin" value="2026-03-14" min="2026-03-01" format="DD/MM/YYYY"></void-date-picker>
|
|
1268
|
+
</void-field>
|
|
1269
|
+
```
|
|
1270
|
+
|
|
1271
|
+
## `<void-delta>`
|
|
1272
|
+
|
|
1273
|
+
A change with its direction: an arrow and a colour around the text ("4.2%").
|
|
1274
|
+
|
|
1275
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
1276
|
+
|
|
1277
|
+
| Attribute | Values | Default | Description |
|
|
1278
|
+
|---|---|---|---|
|
|
1279
|
+
| `trend` | `up\|down\|flat` | `flat` | direction of the change |
|
|
1280
|
+
| `invert` | `boolean` | | less is better: down is green and up is red |
|
|
1281
|
+
|
|
1282
|
+
Example:
|
|
1283
|
+
|
|
1284
|
+
```html
|
|
1285
|
+
<void-delta trend="up">4.2%</void-delta>
|
|
1286
|
+
```
|
|
1287
|
+
|
|
1288
|
+
## `<void-description-list>`
|
|
1289
|
+
|
|
1290
|
+
Labels and their values. Wraps a native <dl> whose pairs are each a <div> holding a <dt> and a <dd>.
|
|
1291
|
+
|
|
1292
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
1293
|
+
|
|
1294
|
+
| Attribute | Values | Default | Description |
|
|
1295
|
+
|---|---|---|---|
|
|
1296
|
+
| `layout` | `rows\|grid` | `rows` | rows: label left, value right, a hairline between pairs. grid: label over value, pairs side by side |
|
|
1297
|
+
| `columns` | `1\|2\|3\|4` | | columns of pairs (rows: 1 or 2; grid: 1 to 4, default 2) |
|
|
1298
|
+
|
|
1299
|
+
Example:
|
|
1300
|
+
|
|
1301
|
+
```html
|
|
1302
|
+
<void-description-list>
|
|
1303
|
+
<dl>
|
|
1304
|
+
<div><dt>Region</dt><dd>eu-north-2</dd></div>
|
|
1305
|
+
<div><dt>Antenna</dt><dd>7.3 m</dd></div>
|
|
1306
|
+
<div><dt>Bands</dt><dd>S, X, Ka</dd></div>
|
|
1307
|
+
</dl>
|
|
1308
|
+
</void-description-list>
|
|
1309
|
+
```
|
|
1310
|
+
|
|
1311
|
+
## `<void-dialog>`
|
|
1312
|
+
|
|
1313
|
+
Modal overlay for confirmations, detail views, and multi-step forms that require user attention before continuing.
|
|
1314
|
+
|
|
1315
|
+
Write its regions as parts: `<void-dialog-title>` (required: it names the dialog), then optionally
|
|
1316
|
+
`<void-dialog-description>`, `<void-dialog-body>` and `<void-dialog-actions>`. The parts are the final DOM: the
|
|
1317
|
+
dialog never moves them. It opens as a native modal dialog (`showModal()`): in the top layer above everything, the
|
|
1318
|
+
page behind it inert (Tab and assistive technology cannot reach it), scrolling locked while any modal is open.
|
|
1319
|
+
Focus moves to the first `[autofocus]` element, else the first focusable element of its parts, else the close
|
|
1320
|
+
button, and returns to the element that had it when the dialog closes. A `<form method="dialog">` inside closes
|
|
1321
|
+
it; the parts may sit inside such a form.
|
|
1322
|
+
|
|
1323
|
+
Parts (only these parts as children, in this order (a form may wrap them)):
|
|
1324
|
+
|
|
1325
|
+
| Part | | Description |
|
|
1326
|
+
|---|---|---|
|
|
1327
|
+
| `<void-dialog-title>` | required, one, CSS-only | Title of the dialog; names it and is its heading. |
|
|
1328
|
+
| `<void-dialog-description>` | one, CSS-only | One or two sentences under the title; describes the dialog to assistive technology. |
|
|
1329
|
+
| `<void-dialog-body>` | one, CSS-only | Main content of the dialog. |
|
|
1330
|
+
| `<void-dialog-actions>` | one, CSS-only | Row of buttons at the end, at the trailing edge. |
|
|
1331
|
+
|
|
1332
|
+
Markup: `<void-dialog open><void-dialog-title>Title</void-dialog-title><void-dialog-description>One line.</void-dialog-description><void-dialog-body>...</void-dialog-body><void-dialog-actions><void-button>Cancel</void-button><void-button variant="filled">OK</void-button></void-dialog-actions></void-dialog>`
|
|
1333
|
+
|
|
1334
|
+
| Attribute | Values | Default | Description |
|
|
1335
|
+
|---|---|---|---|
|
|
1336
|
+
| `aria-label` | `string` | | Accessible name when there is no `<void-dialog-title>` (prefer the title). |
|
|
1337
|
+
| `size` | `sm\|md\|lg` | `md` | Width of the dialog panel: `sm`, `md` (default) or `lg`. |
|
|
1338
|
+
| `open` | `boolean` | `false` | Whether it is open. Set or remove the attribute (or property) to open and close it; the server may do the same through a morph. |
|
|
1339
|
+
| `hide-close` | `boolean` | `false` | Leave out the close button, and ignore Escape and presses on the backdrop: the user closes it only with a button you put in its actions part (a forced choice). |
|
|
1340
|
+
|
|
1341
|
+
| Event | `detail` | Description |
|
|
1342
|
+
|---|---|---|
|
|
1343
|
+
| `void-open` | `{ reason: 'api' }` | The dialog opened. `detail.reason` is `api` (attribute or property). |
|
|
1344
|
+
| `void-close` | `{ reason: 'escape' \| 'outside' \| 'close-button' \| 'form' \| 'parent' \| 'api' }` | The dialog is closing. Cancelable (`preventDefault()` keeps it open) when the user caused it: `escape`, `outside` (a press on the backdrop) or `close-button`. Not cancelable for `form` (a `method="dialog"` form), `parent` (an enclosing overlay closed) or `api` (the `open` attribute or property changed, including a server re-render). |
|
|
1345
|
+
|
|
1346
|
+
Attributes that do not exist (and what to write instead):
|
|
1347
|
+
|
|
1348
|
+
- `heading`: write the title as the first child: <void-dialog-title>...</void-dialog-title>
|
|
1349
|
+
|
|
1350
|
+
Example:
|
|
1351
|
+
|
|
1352
|
+
```html
|
|
1353
|
+
<void-dialog size="sm">
|
|
1354
|
+
<void-dialog-title>Delete project</void-dialog-title>
|
|
1355
|
+
<void-dialog-description>This cannot be undone.</void-dialog-description>
|
|
1356
|
+
<void-dialog-actions>
|
|
1357
|
+
<void-button>Cancel</void-button>
|
|
1358
|
+
<void-button color="error" variant="filled">Delete</void-button>
|
|
1359
|
+
</void-dialog-actions>
|
|
1360
|
+
</void-dialog>
|
|
1361
|
+
```
|
|
1362
|
+
|
|
1363
|
+
## `<void-dialog-actions>`
|
|
1364
|
+
|
|
1365
|
+
Row of buttons at the end, at the trailing edge.
|
|
1366
|
+
|
|
1367
|
+
CSS-only part of `<void-dialog>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1368
|
+
|
|
1369
|
+
Allowed inside: `<void-dialog>`.
|
|
1370
|
+
|
|
1371
|
+
Example:
|
|
1372
|
+
|
|
1373
|
+
```html
|
|
1374
|
+
<void-dialog size="sm">
|
|
1375
|
+
<void-dialog-title>Delete project</void-dialog-title>
|
|
1376
|
+
<void-dialog-description>This cannot be undone.</void-dialog-description>
|
|
1377
|
+
<void-dialog-actions>
|
|
1378
|
+
<void-button>Cancel</void-button>
|
|
1379
|
+
<void-button color="error" variant="filled">Delete</void-button>
|
|
1380
|
+
</void-dialog-actions>
|
|
1381
|
+
</void-dialog>
|
|
1382
|
+
```
|
|
1383
|
+
|
|
1384
|
+
## `<void-dialog-body>`
|
|
1385
|
+
|
|
1386
|
+
Main content of the dialog.
|
|
1387
|
+
|
|
1388
|
+
CSS-only part of `<void-dialog>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1389
|
+
|
|
1390
|
+
Allowed inside: `<void-dialog>`.
|
|
1391
|
+
|
|
1392
|
+
Example:
|
|
1393
|
+
|
|
1394
|
+
```html
|
|
1395
|
+
<void-dialog size="sm">
|
|
1396
|
+
<void-dialog-title>Delete project</void-dialog-title>
|
|
1397
|
+
<void-dialog-description>This cannot be undone.</void-dialog-description>
|
|
1398
|
+
<void-dialog-actions>
|
|
1399
|
+
<void-button>Cancel</void-button>
|
|
1400
|
+
<void-button color="error" variant="filled">Delete</void-button>
|
|
1401
|
+
</void-dialog-actions>
|
|
1402
|
+
</void-dialog>
|
|
1403
|
+
```
|
|
1404
|
+
|
|
1405
|
+
## `<void-dialog-description>`
|
|
1406
|
+
|
|
1407
|
+
One or two sentences under the title; describes the dialog to assistive technology.
|
|
1408
|
+
|
|
1409
|
+
CSS-only part of `<void-dialog>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1410
|
+
|
|
1411
|
+
Allowed inside: `<void-dialog>`.
|
|
1412
|
+
|
|
1413
|
+
Example:
|
|
1414
|
+
|
|
1415
|
+
```html
|
|
1416
|
+
<void-dialog size="sm">
|
|
1417
|
+
<void-dialog-title>Delete project</void-dialog-title>
|
|
1418
|
+
<void-dialog-description>This cannot be undone.</void-dialog-description>
|
|
1419
|
+
<void-dialog-actions>
|
|
1420
|
+
<void-button>Cancel</void-button>
|
|
1421
|
+
<void-button color="error" variant="filled">Delete</void-button>
|
|
1422
|
+
</void-dialog-actions>
|
|
1423
|
+
</void-dialog>
|
|
1424
|
+
```
|
|
1425
|
+
|
|
1426
|
+
## `<void-dialog-title>`
|
|
1427
|
+
|
|
1428
|
+
Title of the dialog; names it and is its heading.
|
|
1429
|
+
|
|
1430
|
+
CSS-only part of `<void-dialog>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1431
|
+
|
|
1432
|
+
Allowed inside: `<void-dialog>`.
|
|
1433
|
+
|
|
1434
|
+
Example:
|
|
1435
|
+
|
|
1436
|
+
```html
|
|
1437
|
+
<void-dialog size="sm">
|
|
1438
|
+
<void-dialog-title>Delete project</void-dialog-title>
|
|
1439
|
+
<void-dialog-description>This cannot be undone.</void-dialog-description>
|
|
1440
|
+
<void-dialog-actions>
|
|
1441
|
+
<void-button>Cancel</void-button>
|
|
1442
|
+
<void-button color="error" variant="filled">Delete</void-button>
|
|
1443
|
+
</void-dialog-actions>
|
|
1444
|
+
</void-dialog>
|
|
1445
|
+
```
|
|
1446
|
+
|
|
1447
|
+
## `<void-divider>`
|
|
1448
|
+
|
|
1449
|
+
Visual separator between sections in forms, sidebars, and content layouts; supports optional label text.
|
|
1450
|
+
|
|
1451
|
+
| Attribute | Values | Default | Description |
|
|
1452
|
+
|---|---|---|---|
|
|
1453
|
+
| `label` | `string \| undefined` | | Optional text drawn in the line, for a labelled break such as `or`. Also the separator's accessible name. |
|
|
1454
|
+
| `orientation` | `horizontal\|vertical` | `horizontal` | `horizontal` (default) draws a rule across the available width; `vertical` draws one the height of its container, for use between inline items. |
|
|
1455
|
+
|
|
1456
|
+
Example:
|
|
1457
|
+
|
|
1458
|
+
```html
|
|
1459
|
+
<void-divider label="or"></void-divider>
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
## `<void-donut-chart>`
|
|
1463
|
+
|
|
1464
|
+
Donut chart for part-to-whole breakdowns, drawn in SVG with animated segments and an optional total in the
|
|
1465
|
+
centre. Give it `data` (`{ segments: [{ name, value }] }`) from script; it has no children. The chart is an
|
|
1466
|
+
image to assistive technology, so set `aria-label` and state the key figures in the surrounding text.
|
|
1467
|
+
|
|
1468
|
+
| Attribute | Values | Default | Description |
|
|
1469
|
+
|---|---|---|---|
|
|
1470
|
+
| `size` | `number` | `220` | Width and height of the chart in pixels. Defaults to 220. |
|
|
1471
|
+
| `inner` | `number` | `0.6` | Inner radius as a fraction of the outer radius, from 0 (a pie) to just under 1 (a thin ring). Defaults to 0.6. |
|
|
1472
|
+
| `gaps` | `boolean \| number` | `false` | Visible gap between segments. `false`/`0` = seamless (segments touch). `true` = 1% of the total arc consumed by gaps (the sensible default when you want visible separation). A number = explicit percent of the total arc consumed by gaps. Higher % = clearer segmentation but more arc sacrificed to whitespace; the precision-vs-clarity tradeoff. |
|
|
1473
|
+
| `variant` | `filled\|outline\|wireframe` | `filled` | How segments are drawn: `filled` (default), `outline` (tinted with a border) or `wireframe` (border only). |
|
|
1474
|
+
| `show-value` | `boolean` | `false` | Print each segment's value on its arc, abbreviated above 1000 (`1.2k`). |
|
|
1475
|
+
| `show-total` | `boolean` | `false` | Print the sum of the segments in the centre of the ring. |
|
|
1476
|
+
| `aria-label` | `string` | | Accessible name of the chart, such as `Traffic by source`. The chart is an image to assistive technology, so set it and put the key figures in the text around it. |
|
|
1477
|
+
|
|
1478
|
+
Properties with no attribute (set in JavaScript):
|
|
1479
|
+
|
|
1480
|
+
| Property | Type | Description |
|
|
1481
|
+
|---|---|---|
|
|
1482
|
+
| `data` | `DonutChartData` | The chart's data: `{ segments: [{ name, value, color? }] }`. Each segment's share of the ring is its `value` over the sum of all values. Property only: assign a new object to update the chart and animate to it. |
|
|
1483
|
+
|
|
1484
|
+
Example:
|
|
1485
|
+
|
|
1486
|
+
```html
|
|
1487
|
+
<void-donut-chart aria-label="Traffic by source" show-total show-value></void-donut-chart>
|
|
1488
|
+
```
|
|
1489
|
+
|
|
1490
|
+
## `<void-drawer>`
|
|
1491
|
+
|
|
1492
|
+
Slide-out overlay panel for filters, detail views, and navigation menus; opens from any screen edge.
|
|
1493
|
+
|
|
1494
|
+
A modal like `<void-dialog>`, with the same parts: `<void-drawer-title>` (required: it names the drawer), then
|
|
1495
|
+
optionally `<void-drawer-description>`, `<void-drawer-body>` and `<void-drawer-actions>`. The parts are the final
|
|
1496
|
+
DOM; the native `<dialog>` opened with `showModal()` (top layer, inert page, counted scroll lock) is internal to
|
|
1497
|
+
the drawer. Focus moves in on open and returns on close.
|
|
1498
|
+
|
|
1499
|
+
Parts (only these parts as children, in this order (a form may wrap them)):
|
|
1500
|
+
|
|
1501
|
+
| Part | | Description |
|
|
1502
|
+
|---|---|---|
|
|
1503
|
+
| `<void-drawer-title>` | required, one, CSS-only | Title of the drawer; names it and is its heading. |
|
|
1504
|
+
| `<void-drawer-description>` | one, CSS-only | One or two sentences under the title; describes the drawer to assistive technology. |
|
|
1505
|
+
| `<void-drawer-body>` | one, CSS-only | Main content of the drawer. |
|
|
1506
|
+
| `<void-drawer-actions>` | one, CSS-only | Row of buttons at the end, at the trailing edge. |
|
|
1507
|
+
|
|
1508
|
+
Markup: `<void-drawer open><void-drawer-title>Title</void-drawer-title><void-drawer-description>One line.</void-drawer-description><void-drawer-body>...</void-drawer-body><void-drawer-actions><void-button>Cancel</void-button><void-button variant="filled">OK</void-button></void-drawer-actions></void-drawer>`
|
|
1509
|
+
|
|
1510
|
+
| Attribute | Values | Default | Description |
|
|
1511
|
+
|---|---|---|---|
|
|
1512
|
+
| `aria-label` | `string` | | Accessible name when there is no `<void-drawer-title>` (prefer the title). |
|
|
1513
|
+
| `side` | `left\|right\|top\|bottom` | `right` | Screen edge the drawer slides in from: `right` (default), `left`, `top` or `bottom`. |
|
|
1514
|
+
| `size` | `sm\|md\|lg` | `md` | Width of a side drawer, or height of a top or bottom one: `sm`, `md` (default) or `lg`. |
|
|
1515
|
+
| `open` | `boolean` | `false` | Whether it is open. Set or remove the attribute (or property) to open and close it; the server may do the same through a morph. |
|
|
1516
|
+
| `hide-close` | `boolean` | `false` | Leave out the close button, and ignore Escape and presses on the backdrop: the user closes it only with a button you put in its actions part (a forced choice). |
|
|
1517
|
+
|
|
1518
|
+
| Event | `detail` | Description |
|
|
1519
|
+
|---|---|---|
|
|
1520
|
+
| `void-open` | `{ reason: 'api' }` | The drawer opened. |
|
|
1521
|
+
| `void-close` | `{ reason: 'escape' \| 'outside' \| 'close-button' \| 'form' \| 'parent' \| 'api' }` | The drawer is closing. Cancelable when the user caused it (`escape`, `outside`, `close-button`). |
|
|
1522
|
+
|
|
1523
|
+
Attributes that do not exist (and what to write instead):
|
|
1524
|
+
|
|
1525
|
+
- `heading`: write the title as the first child: <void-drawer-title>...</void-drawer-title>
|
|
1526
|
+
|
|
1527
|
+
Example:
|
|
1528
|
+
|
|
1529
|
+
```html
|
|
1530
|
+
<void-drawer side="right">
|
|
1531
|
+
<void-drawer-title>Filters</void-drawer-title>
|
|
1532
|
+
<void-drawer-body>
|
|
1533
|
+
<p>Narrow the list by status and owner.</p>
|
|
1534
|
+
</void-drawer-body>
|
|
1535
|
+
<void-drawer-actions>
|
|
1536
|
+
<void-button variant="filled">Apply filters</void-button>
|
|
1537
|
+
</void-drawer-actions>
|
|
1538
|
+
</void-drawer>
|
|
1539
|
+
```
|
|
1540
|
+
|
|
1541
|
+
## `<void-drawer-actions>`
|
|
1542
|
+
|
|
1543
|
+
Row of buttons at the end, at the trailing edge.
|
|
1544
|
+
|
|
1545
|
+
CSS-only part of `<void-drawer>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1546
|
+
|
|
1547
|
+
Allowed inside: `<void-drawer>`.
|
|
1548
|
+
|
|
1549
|
+
Example:
|
|
1550
|
+
|
|
1551
|
+
```html
|
|
1552
|
+
<void-drawer side="right">
|
|
1553
|
+
<void-drawer-title>Filters</void-drawer-title>
|
|
1554
|
+
<void-drawer-body>
|
|
1555
|
+
<p>Narrow the list by status and owner.</p>
|
|
1556
|
+
</void-drawer-body>
|
|
1557
|
+
<void-drawer-actions>
|
|
1558
|
+
<void-button variant="filled">Apply filters</void-button>
|
|
1559
|
+
</void-drawer-actions>
|
|
1560
|
+
</void-drawer>
|
|
1561
|
+
```
|
|
1562
|
+
|
|
1563
|
+
## `<void-drawer-body>`
|
|
1564
|
+
|
|
1565
|
+
Main content of the drawer.
|
|
1566
|
+
|
|
1567
|
+
CSS-only part of `<void-drawer>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1568
|
+
|
|
1569
|
+
Allowed inside: `<void-drawer>`.
|
|
1570
|
+
|
|
1571
|
+
Example:
|
|
1572
|
+
|
|
1573
|
+
```html
|
|
1574
|
+
<void-drawer side="right">
|
|
1575
|
+
<void-drawer-title>Filters</void-drawer-title>
|
|
1576
|
+
<void-drawer-body>
|
|
1577
|
+
<p>Narrow the list by status and owner.</p>
|
|
1578
|
+
</void-drawer-body>
|
|
1579
|
+
<void-drawer-actions>
|
|
1580
|
+
<void-button variant="filled">Apply filters</void-button>
|
|
1581
|
+
</void-drawer-actions>
|
|
1582
|
+
</void-drawer>
|
|
1583
|
+
```
|
|
1584
|
+
|
|
1585
|
+
## `<void-drawer-description>`
|
|
1586
|
+
|
|
1587
|
+
One or two sentences under the title; describes the drawer to assistive technology.
|
|
1588
|
+
|
|
1589
|
+
CSS-only part of `<void-drawer>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1590
|
+
|
|
1591
|
+
Allowed inside: `<void-drawer>`.
|
|
1592
|
+
|
|
1593
|
+
Example:
|
|
1594
|
+
|
|
1595
|
+
```html
|
|
1596
|
+
<void-drawer side="right">
|
|
1597
|
+
<void-drawer-title>Filters</void-drawer-title>
|
|
1598
|
+
<void-drawer-body>
|
|
1599
|
+
<p>Narrow the list by status and owner.</p>
|
|
1600
|
+
</void-drawer-body>
|
|
1601
|
+
<void-drawer-actions>
|
|
1602
|
+
<void-button variant="filled">Apply filters</void-button>
|
|
1603
|
+
</void-drawer-actions>
|
|
1604
|
+
</void-drawer>
|
|
1605
|
+
```
|
|
1606
|
+
|
|
1607
|
+
## `<void-drawer-title>`
|
|
1608
|
+
|
|
1609
|
+
Title of the drawer; names it and is its heading.
|
|
1610
|
+
|
|
1611
|
+
CSS-only part of `<void-drawer>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1612
|
+
|
|
1613
|
+
Allowed inside: `<void-drawer>`.
|
|
1614
|
+
|
|
1615
|
+
Example:
|
|
1616
|
+
|
|
1617
|
+
```html
|
|
1618
|
+
<void-drawer side="right">
|
|
1619
|
+
<void-drawer-title>Filters</void-drawer-title>
|
|
1620
|
+
<void-drawer-body>
|
|
1621
|
+
<p>Narrow the list by status and owner.</p>
|
|
1622
|
+
</void-drawer-body>
|
|
1623
|
+
<void-drawer-actions>
|
|
1624
|
+
<void-button variant="filled">Apply filters</void-button>
|
|
1625
|
+
</void-drawer-actions>
|
|
1626
|
+
</void-drawer>
|
|
1627
|
+
```
|
|
1628
|
+
|
|
1629
|
+
## `<void-dropdown-menu>`
|
|
1630
|
+
|
|
1631
|
+
Trigger-anchored action menu for table row actions, toolbar overflow menus, and context menus.
|
|
1632
|
+
|
|
1633
|
+
Two parts: `<void-dropdown-menu-trigger>` around the control that opens the menu (one element: a
|
|
1634
|
+
`<void-button>`, a `<button>`), and `<void-dropdown-menu-content>` holding the `<void-dropdown-menu-item>`s
|
|
1635
|
+
(and `<void-dropdown-menu-separator>`s between groups). The parts are the final DOM.
|
|
1636
|
+
|
|
1637
|
+
Follows the WAI-ARIA menu button pattern: the trigger gets `aria-haspopup="menu"`, `aria-expanded` and
|
|
1638
|
+
`aria-controls`; the panel is a `role="menu"` of `menuitem`s that take focus one at a time. Keyboard on the
|
|
1639
|
+
trigger: Enter, Space and ArrowDown open the menu and focus the first item, ArrowUp opens it and focuses the
|
|
1640
|
+
last item. In the menu: ArrowDown and ArrowUp move between items (wrapping, skipping disabled ones), Home
|
|
1641
|
+
and End jump to the first and last, typing characters jumps to the next item starting with them, Enter or
|
|
1642
|
+
Space activate the item. Choosing an item closes the menu and returns focus to the trigger (add `keep-open`
|
|
1643
|
+
to an item, for example a checkbox-style toggle, to keep it open); Escape closes it and returns focus to the
|
|
1644
|
+
trigger; Tab or a press outside closes it. The panel is shown in the top layer and placed with CSS anchor
|
|
1645
|
+
positioning, flipping at viewport edges.
|
|
1646
|
+
|
|
1647
|
+
Parts (only these parts as children, in this order):
|
|
1648
|
+
|
|
1649
|
+
| Part | | Description |
|
|
1650
|
+
|---|---|---|
|
|
1651
|
+
| `<void-dropdown-menu-trigger>` | required, one, wraps one control, CSS-only | Wraps the one element that opens the menu (a <void-button>, a <button>); that element gets the menu-button ARIA. |
|
|
1652
|
+
| `<void-dropdown-menu-content>` | required, one, CSS-only | The menu (role="menu") shown in the top layer next to the trigger. |
|
|
1653
|
+
|  `<void-dropdown-menu-item>` | required, any number | One action of the menu. |
|
|
1654
|
+
|  `<void-dropdown-menu-separator>` | any number, CSS-only | Hairline between groups of items. |
|
|
1655
|
+
|
|
1656
|
+
Markup: `<void-dropdown-menu><void-dropdown-menu-trigger><void-button>Actions</void-button></void-dropdown-menu-trigger><void-dropdown-menu-content><void-dropdown-menu-item value="edit">Edit</void-dropdown-menu-item></void-dropdown-menu-content></void-dropdown-menu>`
|
|
1657
|
+
|
|
1658
|
+
| Attribute | Values | Default | Description |
|
|
1659
|
+
|---|---|---|---|
|
|
1660
|
+
| `open` | `boolean` | `false` | Whether the menu is open. A click on the trigger toggles it; choosing an item, Escape, Tab or a press outside closes it. |
|
|
1661
|
+
| `side` | `top\|bottom\|left\|right` | `bottom` | Side of the trigger the menu opens on; it flips to the opposite side when there is no room. |
|
|
1662
|
+
| `align` | `start\|center\|end` | `start` | Alignment with the trigger along that side. |
|
|
1663
|
+
|
|
1664
|
+
| Event | `detail` | Description |
|
|
1665
|
+
|---|---|---|
|
|
1666
|
+
| `void-open` | `{ reason: 'trigger' \| 'keyboard' \| 'api' }` | The menu opened. |
|
|
1667
|
+
| `void-close` | `{ reason: 'trigger' \| 'select' \| 'escape' \| 'outside' \| 'blur' \| 'parent' \| 'api' }` | The menu is closing. Cancelable when the user caused it (every reason but `parent` and `api`). |
|
|
1668
|
+
| `void-select` | `{ item: VoidDropdownMenuItem; value: string }` | Bubbles from a child `<void-dropdown-menu-item>`. |
|
|
1669
|
+
|
|
1670
|
+
Example:
|
|
1671
|
+
|
|
1672
|
+
```html
|
|
1673
|
+
<void-dropdown-menu align="end">
|
|
1674
|
+
<void-dropdown-menu-trigger><void-button>Actions</void-button></void-dropdown-menu-trigger>
|
|
1675
|
+
<void-dropdown-menu-content>
|
|
1676
|
+
<void-dropdown-menu-item value="rename">Rename</void-dropdown-menu-item>
|
|
1677
|
+
<void-dropdown-menu-separator></void-dropdown-menu-separator>
|
|
1678
|
+
<void-dropdown-menu-item value="delete" destructive>Delete</void-dropdown-menu-item>
|
|
1679
|
+
</void-dropdown-menu-content>
|
|
1680
|
+
</void-dropdown-menu>
|
|
1681
|
+
```
|
|
1682
|
+
|
|
1683
|
+
## `<void-dropdown-menu-content>`
|
|
1684
|
+
|
|
1685
|
+
The menu (role="menu") shown in the top layer next to the trigger.
|
|
1686
|
+
|
|
1687
|
+
CSS-only part of `<void-dropdown-menu>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1688
|
+
|
|
1689
|
+
Parts (only these parts as children):
|
|
1690
|
+
|
|
1691
|
+
| Part | | Description |
|
|
1692
|
+
|---|---|---|
|
|
1693
|
+
| `<void-dropdown-menu-item>` | required, any number | One action of the menu. |
|
|
1694
|
+
| `<void-dropdown-menu-separator>` | any number, CSS-only | Hairline between groups of items. |
|
|
1695
|
+
|
|
1696
|
+
Allowed inside: `<void-dropdown-menu>`.
|
|
1697
|
+
|
|
1698
|
+
Example:
|
|
1699
|
+
|
|
1700
|
+
```html
|
|
1701
|
+
<void-dropdown-menu align="end">
|
|
1702
|
+
<void-dropdown-menu-trigger><void-button>Actions</void-button></void-dropdown-menu-trigger>
|
|
1703
|
+
<void-dropdown-menu-content>
|
|
1704
|
+
<void-dropdown-menu-item value="rename">Rename</void-dropdown-menu-item>
|
|
1705
|
+
<void-dropdown-menu-separator></void-dropdown-menu-separator>
|
|
1706
|
+
<void-dropdown-menu-item value="delete" destructive>Delete</void-dropdown-menu-item>
|
|
1707
|
+
</void-dropdown-menu-content>
|
|
1708
|
+
</void-dropdown-menu>
|
|
1709
|
+
```
|
|
1710
|
+
|
|
1711
|
+
## `<void-dropdown-menu-item>`
|
|
1712
|
+
|
|
1713
|
+
An item of a `<void-dropdown-menu>`, inside its `<void-dropdown-menu-content>`. Choosing it (click, Enter or
|
|
1714
|
+
Space) dispatches `void-select` and closes the menu, unless it has `keep-open`.
|
|
1715
|
+
|
|
1716
|
+
| Attribute | Values | Default | Description |
|
|
1717
|
+
|---|---|---|---|
|
|
1718
|
+
| `value` | `string` | | What the item stands for, passed as `detail.value` of `void-select` (empty when not set). |
|
|
1719
|
+
| `disabled` | `boolean` | `false` | Dim the item, skip it in keyboard navigation and stop it firing `void-select`. |
|
|
1720
|
+
| `destructive` | `boolean` | `false` | Draw the item in the error colour, for an action that deletes or cannot be undone. |
|
|
1721
|
+
| `keep-open` | `boolean` | `false` | Keep the menu open when this item is chosen (checkbox-style or repeatable items). |
|
|
1722
|
+
|
|
1723
|
+
| Event | `detail` | Description |
|
|
1724
|
+
|---|---|---|
|
|
1725
|
+
| `void-select` | `{ item: VoidDropdownMenuItem; value: string }` | The item was chosen. |
|
|
1726
|
+
|
|
1727
|
+
Allowed inside: `<void-dropdown-menu-content>`.
|
|
1728
|
+
|
|
1729
|
+
Example:
|
|
1730
|
+
|
|
1731
|
+
```html
|
|
1732
|
+
<void-dropdown-menu>
|
|
1733
|
+
<void-dropdown-menu-trigger><void-button variant="ghost">Actions</void-button></void-dropdown-menu-trigger>
|
|
1734
|
+
<void-dropdown-menu-content>
|
|
1735
|
+
<void-dropdown-menu-item value="rename">Rename</void-dropdown-menu-item>
|
|
1736
|
+
<void-dropdown-menu-item value="duplicate">Duplicate</void-dropdown-menu-item>
|
|
1737
|
+
<void-dropdown-menu-item value="delete" destructive>Delete</void-dropdown-menu-item>
|
|
1738
|
+
</void-dropdown-menu-content>
|
|
1739
|
+
</void-dropdown-menu>
|
|
1740
|
+
```
|
|
1741
|
+
|
|
1742
|
+
## `<void-dropdown-menu-separator>`
|
|
1743
|
+
|
|
1744
|
+
Hairline between groups of items.
|
|
1745
|
+
|
|
1746
|
+
CSS-only part of `<void-dropdown-menu-content>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1747
|
+
|
|
1748
|
+
Allowed inside: `<void-dropdown-menu-content>`.
|
|
1749
|
+
|
|
1750
|
+
Example:
|
|
1751
|
+
|
|
1752
|
+
```html
|
|
1753
|
+
<void-dropdown-menu align="end">
|
|
1754
|
+
<void-dropdown-menu-trigger><void-button>Actions</void-button></void-dropdown-menu-trigger>
|
|
1755
|
+
<void-dropdown-menu-content>
|
|
1756
|
+
<void-dropdown-menu-item value="rename">Rename</void-dropdown-menu-item>
|
|
1757
|
+
<void-dropdown-menu-separator></void-dropdown-menu-separator>
|
|
1758
|
+
<void-dropdown-menu-item value="delete" destructive>Delete</void-dropdown-menu-item>
|
|
1759
|
+
</void-dropdown-menu-content>
|
|
1760
|
+
</void-dropdown-menu>
|
|
1761
|
+
```
|
|
1762
|
+
|
|
1763
|
+
## `<void-dropdown-menu-trigger>`
|
|
1764
|
+
|
|
1765
|
+
Wraps the one element that opens the menu (a <void-button>, a <button>); that element gets the menu-button ARIA.
|
|
1766
|
+
|
|
1767
|
+
CSS-only part of `<void-dropdown-menu>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1768
|
+
|
|
1769
|
+
Allowed inside: `<void-dropdown-menu>`.
|
|
1770
|
+
|
|
1771
|
+
Example:
|
|
1772
|
+
|
|
1773
|
+
```html
|
|
1774
|
+
<void-dropdown-menu align="end">
|
|
1775
|
+
<void-dropdown-menu-trigger><void-button>Actions</void-button></void-dropdown-menu-trigger>
|
|
1776
|
+
<void-dropdown-menu-content>
|
|
1777
|
+
<void-dropdown-menu-item value="rename">Rename</void-dropdown-menu-item>
|
|
1778
|
+
<void-dropdown-menu-separator></void-dropdown-menu-separator>
|
|
1779
|
+
<void-dropdown-menu-item value="delete" destructive>Delete</void-dropdown-menu-item>
|
|
1780
|
+
</void-dropdown-menu-content>
|
|
1781
|
+
</void-dropdown-menu>
|
|
1782
|
+
```
|
|
1783
|
+
|
|
1784
|
+
## `<void-editable>`
|
|
1785
|
+
|
|
1786
|
+
Inline editable text for renaming items, editing headings, and click-to-edit table cells.
|
|
1787
|
+
|
|
1788
|
+
Forms submit the committed `value`, never text still being edited. With
|
|
1789
|
+
`submit-mode="enter"` only Enter commits: leaving the field (blur, including
|
|
1790
|
+
clicking a submit button) cancels the edit by design, so the form submits
|
|
1791
|
+
the previous value. Use `both` (default) or `blur` to commit on blur.
|
|
1792
|
+
|
|
1793
|
+
| Attribute | Values | Default | Description |
|
|
1794
|
+
|---|---|---|---|
|
|
1795
|
+
| `value` | `string` | | The committed text. Reflected to the attribute as it changes; the form's reset target stays the value it started with. Text still being edited is not part of it until committed. |
|
|
1796
|
+
| `editing` | `boolean` | `false` | Whether the field is in edit mode (an input) rather than showing text. Clicking, Enter or Space starts editing; Escape cancels and `void-cancel` fires. |
|
|
1797
|
+
| `disabled` | `boolean` | `false` | Stop the field entering edit mode and exclude the value from the form submission. |
|
|
1798
|
+
| `placeholder` | `string` | `Click to edit` | Text shown while the value is empty and the field is not being edited. Defaults to `Click to edit`. |
|
|
1799
|
+
| `submit-mode` | `blur\|enter\|both` | `both` | How an edit is committed: `enter` only on Enter (blur cancels), `blur` only when focus leaves, or `both` (default). |
|
|
1800
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
1801
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
1802
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
1803
|
+
|
|
1804
|
+
| Event | `detail` | Description |
|
|
1805
|
+
|---|---|---|
|
|
1806
|
+
| `void-change` | `{ value: string }` | |
|
|
1807
|
+
| `void-cancel` | `(no detail)` | |
|
|
1808
|
+
| `void-input` | `{ value: unknown }` | |
|
|
1809
|
+
|
|
1810
|
+
Example:
|
|
1811
|
+
|
|
1812
|
+
```html
|
|
1813
|
+
<void-editable name="title" value="Quarterly report" placeholder="Untitled" aria-label="Document title"></void-editable>
|
|
1814
|
+
```
|
|
1815
|
+
|
|
1816
|
+
## `<void-empty>`
|
|
1817
|
+
|
|
1818
|
+
Empty state: an optional icon (<svg> or <i>), a heading (<h3>), a <p>, and optional void-actions. Centred.
|
|
1819
|
+
|
|
1820
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
1821
|
+
|
|
1822
|
+
| Attribute | Values | Default | Description |
|
|
1823
|
+
|---|---|---|---|
|
|
1824
|
+
| `bordered` | `boolean` | | dashed hairline around it, for an empty area inside a page that is otherwise full |
|
|
1825
|
+
| `size` | `sm\|md` | `md` | sm has less padding |
|
|
1826
|
+
|
|
1827
|
+
Example:
|
|
1828
|
+
|
|
1829
|
+
```html
|
|
1830
|
+
<void-empty>
|
|
1831
|
+
<i class="ti ti-antenna-off"></i>
|
|
1832
|
+
<h3>No stations match</h3>
|
|
1833
|
+
<p>Try another region, or clear the filters.</p>
|
|
1834
|
+
<void-actions><void-button>Clear filters</void-button></void-actions>
|
|
1835
|
+
</void-empty>
|
|
1836
|
+
```
|
|
1837
|
+
|
|
1838
|
+
## `<void-error-fallback>`
|
|
1839
|
+
|
|
1840
|
+
Error state display for failed data fetches and unexpected runtime errors; includes an optional retry action.
|
|
1841
|
+
|
|
1842
|
+
Write it with parts: a `<void-error-fallback-title>`, an optional `<void-error-fallback-description>` and an
|
|
1843
|
+
optional `<void-error-fallback-actions>` (buttons). The parts are never moved.
|
|
1844
|
+
|
|
1845
|
+
It also has a built-in default for the common case. While the author writes no part, the component writes the
|
|
1846
|
+
parts itself from `heading` (default `Something went wrong`), `message`, `retryable` and `retry-label`
|
|
1847
|
+
(default `Try again`), and a click on its retry button fires `void-retry`. As soon as the author writes any
|
|
1848
|
+
part, the component takes its own parts away and the attributes `heading`, `message`, `retryable` and
|
|
1849
|
+
`retry-label` no longer apply: the author's parts replace the default, and the author's own buttons use their
|
|
1850
|
+
own listeners.
|
|
1851
|
+
|
|
1852
|
+
Parts (only these parts as children, in this order):
|
|
1853
|
+
|
|
1854
|
+
| Part | | Description |
|
|
1855
|
+
|---|---|---|
|
|
1856
|
+
| `<void-error-fallback-title>` | one, CSS-only | Headline. Without any part the component writes its own default headline (the heading attribute). |
|
|
1857
|
+
| `<void-error-fallback-description>` | one, CSS-only | What failed or what to try. |
|
|
1858
|
+
| `<void-error-fallback-actions>` | one, CSS-only | Buttons, such as a retry. Wire your own listener: void-retry comes only from the built-in default. |
|
|
1859
|
+
|
|
1860
|
+
Markup: `<void-error-fallback><void-error-fallback-title>Could not load invoices</void-error-fallback-title><void-error-fallback-description>The server did not respond.</void-error-fallback-description><void-error-fallback-actions><button type="button">Try again</button></void-error-fallback-actions></void-error-fallback>`
|
|
1861
|
+
|
|
1862
|
+
| Attribute | Values | Default | Description |
|
|
1863
|
+
|---|---|---|---|
|
|
1864
|
+
| `heading` | `string` | `Something went wrong` | Headline of the built-in default. Defaults to `Something went wrong`. Ignored when the author writes parts. |
|
|
1865
|
+
| `message` | `string` | | Detail shown under the headline in the built-in default, such as what failed or what to try. Optional. |
|
|
1866
|
+
| `retryable` | `boolean` | `false` | Show a retry button in the built-in default. Clicking it fires `void-retry`; the element does not retry anything itself, so listen for the event and reload. Ignored when the author writes parts. |
|
|
1867
|
+
| `retry-label` | `string` | `Try again` | Text of the built-in retry button. Defaults to `Try again`. Only used with `retryable`. |
|
|
1868
|
+
| `hide-icon` | `boolean` | `false` | Leave out the warning icon above the headline (it is drawn by default). |
|
|
1869
|
+
|
|
1870
|
+
| Event | `detail` | Description |
|
|
1871
|
+
|---|---|---|
|
|
1872
|
+
| `void-retry` | `(no detail)` | The built-in retry button was pressed (the element retries nothing itself). |
|
|
1873
|
+
|
|
1874
|
+
Example:
|
|
1875
|
+
|
|
1876
|
+
```html
|
|
1877
|
+
<void-error-fallback>
|
|
1878
|
+
<void-error-fallback-title>Could not load invoices</void-error-fallback-title>
|
|
1879
|
+
<void-error-fallback-description>The server did not respond. Check your connection and try again.</void-error-fallback-description>
|
|
1880
|
+
<void-error-fallback-actions>
|
|
1881
|
+
<button type="button">Try again</button>
|
|
1882
|
+
</void-error-fallback-actions>
|
|
1883
|
+
</void-error-fallback>
|
|
1884
|
+
```
|
|
1885
|
+
|
|
1886
|
+
## `<void-error-fallback-actions>`
|
|
1887
|
+
|
|
1888
|
+
Buttons, such as a retry. Wire your own listener: void-retry comes only from the built-in default.
|
|
1889
|
+
|
|
1890
|
+
CSS-only part of `<void-error-fallback>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1891
|
+
|
|
1892
|
+
Allowed inside: `<void-error-fallback>`.
|
|
1893
|
+
|
|
1894
|
+
Example:
|
|
1895
|
+
|
|
1896
|
+
```html
|
|
1897
|
+
<void-error-fallback>
|
|
1898
|
+
<void-error-fallback-title>Could not load invoices</void-error-fallback-title>
|
|
1899
|
+
<void-error-fallback-description>The server did not respond. Check your connection and try again.</void-error-fallback-description>
|
|
1900
|
+
<void-error-fallback-actions>
|
|
1901
|
+
<button type="button">Try again</button>
|
|
1902
|
+
</void-error-fallback-actions>
|
|
1903
|
+
</void-error-fallback>
|
|
1904
|
+
```
|
|
1905
|
+
|
|
1906
|
+
## `<void-error-fallback-description>`
|
|
1907
|
+
|
|
1908
|
+
What failed or what to try.
|
|
1909
|
+
|
|
1910
|
+
CSS-only part of `<void-error-fallback>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1911
|
+
|
|
1912
|
+
Allowed inside: `<void-error-fallback>`.
|
|
1913
|
+
|
|
1914
|
+
Example:
|
|
1915
|
+
|
|
1916
|
+
```html
|
|
1917
|
+
<void-error-fallback>
|
|
1918
|
+
<void-error-fallback-title>Could not load invoices</void-error-fallback-title>
|
|
1919
|
+
<void-error-fallback-description>The server did not respond. Check your connection and try again.</void-error-fallback-description>
|
|
1920
|
+
<void-error-fallback-actions>
|
|
1921
|
+
<button type="button">Try again</button>
|
|
1922
|
+
</void-error-fallback-actions>
|
|
1923
|
+
</void-error-fallback>
|
|
1924
|
+
```
|
|
1925
|
+
|
|
1926
|
+
## `<void-error-fallback-title>`
|
|
1927
|
+
|
|
1928
|
+
Headline. Without any part the component writes its own default headline (the heading attribute).
|
|
1929
|
+
|
|
1930
|
+
CSS-only part of `<void-error-fallback>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
1931
|
+
|
|
1932
|
+
Allowed inside: `<void-error-fallback>`.
|
|
1933
|
+
|
|
1934
|
+
Example:
|
|
1935
|
+
|
|
1936
|
+
```html
|
|
1937
|
+
<void-error-fallback>
|
|
1938
|
+
<void-error-fallback-title>Could not load invoices</void-error-fallback-title>
|
|
1939
|
+
<void-error-fallback-description>The server did not respond. Check your connection and try again.</void-error-fallback-description>
|
|
1940
|
+
<void-error-fallback-actions>
|
|
1941
|
+
<button type="button">Try again</button>
|
|
1942
|
+
</void-error-fallback-actions>
|
|
1943
|
+
</void-error-fallback>
|
|
1944
|
+
```
|
|
1945
|
+
|
|
1946
|
+
## `<void-field>`
|
|
1947
|
+
|
|
1948
|
+
Form field wrapper that pairs an input with its label, helper text, and validation error.
|
|
1949
|
+
|
|
1950
|
+
The label names the control as it appears: the native input, select or textarea (also inside Void
|
|
1951
|
+
components), else the widget a component renders inside itself (the multiselect trigger), else the first
|
|
1952
|
+
child. Controls that arrive after the field (a script that runs before the page is parsed, a framework)
|
|
1953
|
+
are wired when they do.
|
|
1954
|
+
|
|
1955
|
+
| Attribute | Values | Default | Description |
|
|
1956
|
+
|---|---|---|---|
|
|
1957
|
+
| `label` | `string` | | Visible label. It names the control inside (`for` on a native control, `aria-labelledby` otherwise), so use it instead of a `label` attribute on the control. |
|
|
1958
|
+
| `error` | `string` | | Validation message shown under the control in the error colour. While it is set the control inside is marked `aria-invalid` and described by the message. |
|
|
1959
|
+
| `helper` | `string` | | Hint shown under the control when there is no `error`. It describes the control for assistive technology. |
|
|
1960
|
+
| `required` | `boolean` | `false` | Draws an asterisk after the label. It is only the mark: put `required` on the control itself to make the browser enforce it. |
|
|
1961
|
+
|
|
1962
|
+
Example:
|
|
1963
|
+
|
|
1964
|
+
```html
|
|
1965
|
+
<void-field label="Email" helper="We never share it." required>
|
|
1966
|
+
<void-input type="email" name="email" required autocomplete="email"></void-input>
|
|
1967
|
+
</void-field>
|
|
1968
|
+
```
|
|
1969
|
+
|
|
1970
|
+
## `<void-figure>`
|
|
1971
|
+
|
|
1972
|
+
One number that matters. Children in order: a data-void-type="label" span, a data-void-type="value" span holding the number and a data-void-type="unit" span, an optional void-progress, a data-void-type="caption" span (which may hold a void-delta).
|
|
1973
|
+
|
|
1974
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
1975
|
+
|
|
1976
|
+
Example:
|
|
1977
|
+
|
|
1978
|
+
```html
|
|
1979
|
+
<void-figure>
|
|
1980
|
+
<span data-void-type="label">Downlink</span>
|
|
1981
|
+
<span data-void-type="value">79.6 <span data-void-type="unit">TB</span></span>
|
|
1982
|
+
<void-progress value="64" size="sm" aria-label="Downlink against the daily plan"></void-progress>
|
|
1983
|
+
<span data-void-type="caption"><void-delta trend="up">6%</void-delta> on yesterday</span>
|
|
1984
|
+
</void-figure>
|
|
1985
|
+
```
|
|
1986
|
+
|
|
1987
|
+
## `<void-figures>`
|
|
1988
|
+
|
|
1989
|
+
Row of void-figure children divided by hairlines. Two columns below 48rem.
|
|
1990
|
+
|
|
1991
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
1992
|
+
|
|
1993
|
+
| Attribute | Values | Default | Description |
|
|
1994
|
+
|---|---|---|---|
|
|
1995
|
+
| `columns` | `2\|3\|4` | `4` | figures per row |
|
|
1996
|
+
|
|
1997
|
+
Example:
|
|
1998
|
+
|
|
1999
|
+
```html
|
|
2000
|
+
<void-figures>
|
|
2001
|
+
<void-figure>
|
|
2002
|
+
<span data-void-type="label">Stations online</span>
|
|
2003
|
+
<span data-void-type="value">41 <span data-void-type="unit">of 44</span></span>
|
|
2004
|
+
<span data-void-type="caption">2 in maintenance, 1 degraded</span>
|
|
2005
|
+
</void-figure>
|
|
2006
|
+
<void-figure>
|
|
2007
|
+
<span data-void-type="label">Downlink</span>
|
|
2008
|
+
<span data-void-type="value">79.6 <span data-void-type="unit">TB</span></span>
|
|
2009
|
+
<void-progress value="64" size="sm" aria-label="Downlink against the daily plan"></void-progress>
|
|
2010
|
+
<span data-void-type="caption">64% of the daily plan</span>
|
|
2011
|
+
</void-figure>
|
|
2012
|
+
<void-figure>
|
|
2013
|
+
<span data-void-type="label">Median latency</span>
|
|
2014
|
+
<span data-void-type="value">38 <span data-void-type="unit">ms</span></span>
|
|
2015
|
+
<span data-void-type="caption"><void-delta trend="down" invert>4 ms</void-delta> on last week</span>
|
|
2016
|
+
</void-figure>
|
|
2017
|
+
</void-figures>
|
|
2018
|
+
```
|
|
2019
|
+
|
|
2020
|
+
## `<void-file-upload>`
|
|
2021
|
+
|
|
2022
|
+
Drag-and-drop file picker for document uploads, image attachment flows, and import wizards.
|
|
2023
|
+
|
|
2024
|
+
| Attribute | Values | Default | Description |
|
|
2025
|
+
|---|---|---|---|
|
|
2026
|
+
| `accept` | `string` | | Comma-separated file types the zone takes, as on a native file input: extensions (`.pdf`), MIME types (`image/png`) or wildcards (`image/*`). Other files are dropped without an error. |
|
|
2027
|
+
| `multiple` | `boolean` | `false` | Allow more than one file. Without it a new choice replaces the old one. |
|
|
2028
|
+
| `disabled` | `boolean` | `false` | Stop the zone reacting and exclude the files from the form submission. |
|
|
2029
|
+
| `max-size` | `number` | `0` | Largest allowed file in bytes. 0 (the default) means no limit. Larger files are dropped silently. |
|
|
2030
|
+
| `error` | `string` | | Message shown under the zone, such as a server-side upload failure. It does not set `aria-invalid`; the component never produces an error text itself. |
|
|
2031
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
2032
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
2033
|
+
|
|
2034
|
+
| Event | `detail` | Description |
|
|
2035
|
+
|---|---|---|
|
|
2036
|
+
| `void-change` | `{ value: File[]; files: File[] }` | |
|
|
2037
|
+
|
|
2038
|
+
Example:
|
|
2039
|
+
|
|
2040
|
+
```html
|
|
2041
|
+
<void-field label="Attachments">
|
|
2042
|
+
<void-file-upload name="attachments" accept=".pdf,image/*" multiple max-size="5242880"></void-file-upload>
|
|
2043
|
+
</void-field>
|
|
2044
|
+
```
|
|
2045
|
+
|
|
2046
|
+
## `<void-gauge>`
|
|
2047
|
+
|
|
2048
|
+
Radial gauge for a single value within a range (capacity, score, load) or for a few segments that share
|
|
2049
|
+
it, drawn in SVG as a full, semi or three-quarter arc with optional tick marks and colour zones. Set
|
|
2050
|
+
`value` between `min` and `max`, or give it `data.segments`; it has no children. The gauge is an image to
|
|
2051
|
+
assistive technology, so set `aria-label` and state the figure in the surrounding text.
|
|
2052
|
+
|
|
2053
|
+
| Attribute | Values | Default | Description |
|
|
2054
|
+
|---|---|---|---|
|
|
2055
|
+
| `unit` | `string` | | Text shown with the value, such as `%` or `MB/s`. Centered under the number, or right after it with `unit-inline`. |
|
|
2056
|
+
| `value` | `number` | `0` | The reading, between `min` and `max`, for a single-value gauge. For a gauge split into segments set `data.segments` instead. |
|
|
2057
|
+
| `min` | `number` | `0` | Value at the start of the arc. Defaults to 0. |
|
|
2058
|
+
| `max` | `number` | `100` | Value at the end of the arc. Defaults to 100. |
|
|
2059
|
+
| `size` | `number` | `220` | Width of the gauge in pixels. Defaults to 220; the height follows from `circular`. |
|
|
2060
|
+
| `thickness` | `number` | `14` | Width of the arc stroke in pixels. Defaults to 14. |
|
|
2061
|
+
| `circular` | `full\|semi\|triple` | `triple` | How much of a circle the arc covers: `triple` (270 degrees, default), `semi` (180) or `full` (360). |
|
|
2062
|
+
| `variant` | `filled\|outline\|wireframe` | `filled` | How the arc is drawn: `filled` (default, solid), `outline` (tinted with a border) or `wireframe` (thin lines only). |
|
|
2063
|
+
| `hide-value` | `boolean` | `false` | Leave the reading out of the centre (it is printed by default). |
|
|
2064
|
+
| `unit-inline` | `boolean` | `false` | When true, render the unit right next to the value (e.g. "75%"). When false (default), render it on the line below. Short units like % or ° look better inline; longer multi-char units often look better stacked. |
|
|
2065
|
+
| `tick-major` | `number` | `0` | Major tick interval in value units. 0 disables major ticks. Ticks are placed at every multiple of this value within (min, max], drawn as thicker, longer outward marks. Speedometer-style layout: pair with `tick-minor` for a major-grade-with-subdivisions look. |
|
|
2066
|
+
| `tick-minor` | `number` | `0` | Minor tick interval in value units. 0 disables minor ticks. Positions that are also major-tick positions are rendered as majors, not minors. For example, max=100 / tick-major=25 / tick-minor=5 yields 4 major ticks (25, 50, 75, 100) and 16 minor ticks (everything else divisible by 5 within the range). |
|
|
2067
|
+
| `hide-tick-min` | `boolean` | `false` | When true (default), force a major tick at `min` (the gauge start position). Independent of `tick-major` — useful when min isn't a multiple of the major interval but you still want an endpoint marker. Add `hide-tick-min` to leave it out. |
|
|
2068
|
+
| `hide-tick-max` | `boolean` | `false` | When true (default), force a major tick at `max` (the gauge end position). Useful when max doesn't naturally fall on a major-interval boundary (e.g. max=100 with tick-major=30) but you still want the endpoint marked. If max naturally falls on a step, this upgrades the classification to major. Add `hide-tick-max` to leave it out. |
|
|
2069
|
+
| `segments-sort` | `value\|manual` | `value` | Order of segments around the arc: `value` (default, largest first) or `manual` (the order of `data.segments`). |
|
|
2070
|
+
| `gaps` | `boolean \| number` | `false` | Visible gap between segments. `false`/`0` = seamless. `true` = 1% of the filled arc consumed by gaps. Number = explicit percent. Higher % = clearer segmentation but more arc sacrificed; the precision-vs-clarity tradeoff. |
|
|
2071
|
+
| `aria-label` | `string` | | Accessible name of the gauge, such as `Disk usage`. The gauge is an image to assistive technology, so set it and put the figure in the text around it. |
|
|
2072
|
+
|
|
2073
|
+
Properties with no attribute (set in JavaScript):
|
|
2074
|
+
|
|
2075
|
+
| Property | Type | Description |
|
|
2076
|
+
|---|---|---|
|
|
2077
|
+
| `zones` | `GaugeZone[]` | Colour bands over the value range. Assign an array of `{ from, to, color }`; the fill takes the colour of the zone containing the value. Property only. |
|
|
2078
|
+
| `data` | `GaugeData` | Segmented data: `{ segments: [{ name, value, color? }] }` splits the arc between named parts; the optional `value` is the headline reading. Property only: assign a new object to update the gauge and animate to it. For a single reading, set the `value` attribute instead. |
|
|
2079
|
+
|
|
2080
|
+
Example:
|
|
2081
|
+
|
|
2082
|
+
```html
|
|
2083
|
+
<void-gauge value="72" unit="%" circular="semi" aria-label="Disk usage"></void-gauge>
|
|
2084
|
+
```
|
|
2085
|
+
|
|
2086
|
+
## `<void-glass>`
|
|
2087
|
+
|
|
2088
|
+
Glass panel: a translucent, blurred surface for a form or status panel over an image: dark in both colour schemes inside void-media, in the page colour scheme elsewhere. Solid where backdrop-filter is unavailable or reduced transparency is requested. data-void-surface="glass" gives any component the same surface.
|
|
2089
|
+
|
|
2090
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
2091
|
+
|
|
2092
|
+
Example:
|
|
2093
|
+
|
|
2094
|
+
```html
|
|
2095
|
+
<void-media place="center" scrim="none">
|
|
2096
|
+
<img src="/hero.jpg" alt="">
|
|
2097
|
+
<void-media-content>
|
|
2098
|
+
<void-glass>
|
|
2099
|
+
<void-stack>
|
|
2100
|
+
<void-section-head>
|
|
2101
|
+
<h2>Link</h2>
|
|
2102
|
+
<void-badge color="success" variant="outline">Locked</void-badge>
|
|
2103
|
+
</void-section-head>
|
|
2104
|
+
<void-description-list>
|
|
2105
|
+
<dl>
|
|
2106
|
+
<div><dt>Signal</dt><dd>−84.2 dBm</dd></div>
|
|
2107
|
+
<div><dt>Rate</dt><dd>312 Mbit/s</dd></div>
|
|
2108
|
+
</dl>
|
|
2109
|
+
</void-description-list>
|
|
2110
|
+
</void-stack>
|
|
2111
|
+
</void-glass>
|
|
2112
|
+
</void-media-content>
|
|
2113
|
+
</void-media>
|
|
2114
|
+
```
|
|
2115
|
+
|
|
2116
|
+
## `<void-hamburger>`
|
|
2117
|
+
|
|
2118
|
+
Animated open/close toggle for mobile navigation menus and collapsible sidebars.
|
|
2119
|
+
|
|
2120
|
+
| Attribute | Values | Default | Description |
|
|
2121
|
+
|---|---|---|---|
|
|
2122
|
+
| `open` | `boolean` | `false` | Whether the menu it controls is open: draws the lines as a close cross and sets `aria-expanded`. It flips on every click and Enter or Space, firing `void-open` or `void-close`; set it yourself when the menu closes some other way. |
|
|
2123
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
2124
|
+
|
|
2125
|
+
| Event | `detail` | Description |
|
|
2126
|
+
|---|---|---|
|
|
2127
|
+
| `void-open` | `{ reason: 'trigger' }` | The user opened it (click, Enter or Space). Does not bubble. |
|
|
2128
|
+
| `void-close` | `{ reason: 'trigger' }` | The user closed it. Does not bubble. |
|
|
2129
|
+
|
|
2130
|
+
Example:
|
|
2131
|
+
|
|
2132
|
+
```html
|
|
2133
|
+
<void-hamburger></void-hamburger>
|
|
2134
|
+
```
|
|
2135
|
+
|
|
2136
|
+
## `<void-hover-card>`
|
|
2137
|
+
|
|
2138
|
+
Rich content preview card that appears on hover for user profiles, link previews, and contextual information panels.
|
|
2139
|
+
|
|
2140
|
+
Two parts: `<void-hover-card-trigger>` around the element that shows the card (one element: a link, a
|
|
2141
|
+
`<void-button>`), and `<void-hover-card-content>`, the card. The parts are the final DOM. The card opens after
|
|
2142
|
+
`open-delay` when the pointer rests on the trigger, or at once when the trigger receives keyboard focus, and
|
|
2143
|
+
closes after `close-delay` once pointer and focus have left both trigger and card, or on Escape. The card is
|
|
2144
|
+
supplementary: put nothing in it that is not also reachable without it. It is shown in the top layer and placed
|
|
2145
|
+
with CSS anchor positioning; while closed it is not rendered, so links inside it are neither visible nor tabbable.
|
|
2146
|
+
|
|
2147
|
+
Parts (only these parts as children, in this order):
|
|
2148
|
+
|
|
2149
|
+
| Part | | Description |
|
|
2150
|
+
|---|---|---|
|
|
2151
|
+
| `<void-hover-card-trigger>` | required, one, wraps one control, CSS-only | Wraps the one element that shows the card on hover and focus (a <void-button>, a <button>, a link); that element gets the ARIA. |
|
|
2152
|
+
| `<void-hover-card-content>` | required, one, CSS-only | Shown in the top layer next to the trigger. |
|
|
2153
|
+
|
|
2154
|
+
Markup: `<void-hover-card><void-hover-card-trigger><a href="/users/ada">@ada</a></void-hover-card-trigger><void-hover-card-content>...</void-hover-card-content></void-hover-card>`
|
|
2155
|
+
|
|
2156
|
+
| Attribute | Values | Default | Description |
|
|
2157
|
+
|---|---|---|---|
|
|
2158
|
+
| `open` | `boolean` | `false` | Whether the card is shown. It opens and closes itself from hover, focus and Escape; set it to drive it from script. |
|
|
2159
|
+
| `side` | `top\|bottom\|left\|right` | `bottom` | Side of the trigger the card opens on; it flips to the opposite side when there is no room. |
|
|
2160
|
+
| `align` | `start\|center\|end` | `center` | Alignment with the trigger along that side. |
|
|
2161
|
+
| `open-delay` | `number` | `300` | Milliseconds the pointer rests on the trigger before the card opens (keyboard focus opens it at once). Defaults to 300. |
|
|
2162
|
+
| `close-delay` | `number` | `300` | Milliseconds after pointer and focus have left the trigger and card before it closes. Defaults to 300. |
|
|
2163
|
+
|
|
2164
|
+
| Event | `detail` | Description |
|
|
2165
|
+
|---|---|---|
|
|
2166
|
+
| `void-open` | `{ reason: 'hover' \| 'focus' \| 'api' }` | The card opened. |
|
|
2167
|
+
| `void-close` | `{ reason: 'hover' \| 'blur' \| 'escape' \| 'parent' \| 'api' }` | The card is closing. Cancelable when the user caused it. |
|
|
2168
|
+
|
|
2169
|
+
Example:
|
|
2170
|
+
|
|
2171
|
+
```html
|
|
2172
|
+
<void-hover-card>
|
|
2173
|
+
<void-hover-card-trigger><a href="/users/ada">@ada</a></void-hover-card-trigger>
|
|
2174
|
+
<void-hover-card-content>
|
|
2175
|
+
<p>Ada Lovelace</p>
|
|
2176
|
+
</void-hover-card-content>
|
|
2177
|
+
</void-hover-card>
|
|
2178
|
+
```
|
|
2179
|
+
|
|
2180
|
+
## `<void-hover-card-content>`
|
|
2181
|
+
|
|
2182
|
+
Shown in the top layer next to the trigger.
|
|
2183
|
+
|
|
2184
|
+
CSS-only part of `<void-hover-card>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
2185
|
+
|
|
2186
|
+
Allowed inside: `<void-hover-card>`.
|
|
2187
|
+
|
|
2188
|
+
Example:
|
|
2189
|
+
|
|
2190
|
+
```html
|
|
2191
|
+
<void-hover-card>
|
|
2192
|
+
<void-hover-card-trigger><a href="/users/ada">@ada</a></void-hover-card-trigger>
|
|
2193
|
+
<void-hover-card-content>
|
|
2194
|
+
<p>Ada Lovelace</p>
|
|
2195
|
+
</void-hover-card-content>
|
|
2196
|
+
</void-hover-card>
|
|
2197
|
+
```
|
|
2198
|
+
|
|
2199
|
+
## `<void-hover-card-trigger>`
|
|
2200
|
+
|
|
2201
|
+
Wraps the one element that shows the card on hover and focus (a <void-button>, a <button>, a link); that element gets the ARIA.
|
|
2202
|
+
|
|
2203
|
+
CSS-only part of `<void-hover-card>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
2204
|
+
|
|
2205
|
+
Allowed inside: `<void-hover-card>`.
|
|
2206
|
+
|
|
2207
|
+
Example:
|
|
2208
|
+
|
|
2209
|
+
```html
|
|
2210
|
+
<void-hover-card>
|
|
2211
|
+
<void-hover-card-trigger><a href="/users/ada">@ada</a></void-hover-card-trigger>
|
|
2212
|
+
<void-hover-card-content>
|
|
2213
|
+
<p>Ada Lovelace</p>
|
|
2214
|
+
</void-hover-card-content>
|
|
2215
|
+
</void-hover-card>
|
|
2216
|
+
```
|
|
2217
|
+
|
|
2218
|
+
## `<void-indicator>`
|
|
2219
|
+
|
|
2220
|
+
Badge overlay for notification counts on icons and online presence signals on avatars.
|
|
2221
|
+
|
|
2222
|
+
| Attribute | Values | Default | Description |
|
|
2223
|
+
|---|---|---|---|
|
|
2224
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the dot: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
2225
|
+
| `placement` | `top-right\|top-left\|bottom-right\|bottom-left` | `top-right` | Which corner of the wrapped content the dot sits on: `top-right` (default), `top-left`, `bottom-right` or `bottom-left`. |
|
|
2226
|
+
| `count` | `number \| null` | | Number shown in the dot, such as unread notifications. Without it the dot is a plain presence marker. The accessible name becomes `N notifications`. |
|
|
2227
|
+
| `ping` | `boolean` | `false` | Draw an expanding ring around the dot to draw attention. It is not drawn when the user prefers reduced motion. |
|
|
2228
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
2229
|
+
|
|
2230
|
+
Example:
|
|
2231
|
+
|
|
2232
|
+
```html
|
|
2233
|
+
<void-indicator count="3" color="error">
|
|
2234
|
+
<void-button variant="ghost">Inbox</void-button>
|
|
2235
|
+
</void-indicator>
|
|
2236
|
+
```
|
|
2237
|
+
|
|
2238
|
+
## `<void-input>`
|
|
2239
|
+
|
|
2240
|
+
Single-line text entry for login forms, search fields, and structured data capture.
|
|
2241
|
+
|
|
2242
|
+
| Attribute | Values | Default | Description |
|
|
2243
|
+
|---|---|---|---|
|
|
2244
|
+
| `type` | `text\|email\|password\|number\|tel\|url\|search\|date\|datetime-local\|month\|time\|week` | `text` | Native input type. Every text-like type is forwarded to the native control. |
|
|
2245
|
+
| `value` | `string` | | The text in the field. Reflected to the `value` attribute as it changes, and setting the attribute sets it; the form's reset target stays the value the field started with. A `type="password"` field does not reflect: its attribute is only ever the initial value. |
|
|
2246
|
+
| `placeholder` | `string` | | Hint text shown while the field is empty. It is not a label: wrap the input in `void-field label="..."`. |
|
|
2247
|
+
| `disabled` | `boolean` | `false` | Stop the field accepting input and exclude it from the form submission. Also disabled by an enclosing `<fieldset disabled>`. |
|
|
2248
|
+
| `readonly` | `boolean` | `false` | Show the value but do not let the user edit it. Unlike `disabled`, a readonly field is focusable, selectable and still submitted. |
|
|
2249
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
2250
|
+
| `name` | `string` | | Key the value is submitted under in the form's `FormData`. Without a name the field submits nothing. |
|
|
2251
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. Buttons and selects of the same step share its height. |
|
|
2252
|
+
| `error` | `string` | | Mark the field invalid: it gets the error styling and `aria-invalid`. The message itself is shown by the wrapping `void-field`, whose own `error` attribute sets this one, so set `error` on the field rather than here. |
|
|
2253
|
+
| `autocomplete` | `string` | | Autofill hint forwarded to the native control (`autocomplete`), e.g. `current-password`, `one-time-code`, `email`. |
|
|
2254
|
+
| `minlength` | `number \| undefined` | | Minimum number of characters, enforced by the native control (`minlength`) and reported through validity. |
|
|
2255
|
+
| `maxlength` | `number \| undefined` | | Maximum number of characters accepted by the native control (`maxlength`). |
|
|
2256
|
+
| `pattern` | `string` | | Regular expression the value must match (`pattern`), reported through validity. |
|
|
2257
|
+
| `inputmode` | `\|none\|text\|decimal\|numeric\|tel\|search\|email\|url` | | Virtual keyboard hint forwarded to the native control (`inputmode`). |
|
|
2258
|
+
| `enterkeyhint` | `\|enter\|done\|go\|next\|previous\|search\|send` | | Label of the mobile keyboard's enter key (`enterkeyhint`). |
|
|
2259
|
+
| `autocapitalize` | `\|off\|none\|on\|sentences\|words\|characters` | | Capitalisation behaviour of virtual keyboards (`autocapitalize`). |
|
|
2260
|
+
| `spellcheck` | `string \| null` | | The host's `spellcheck` attribute as written (`"true"`, `"false"`, `""`, or absent for the browser default), forwarded to the native control: the native enumerated attribute, not a boolean. |
|
|
2261
|
+
| `form` | `string \| null` | | `id` of a `<form>` elsewhere in the page that this control belongs to, as on a native control. Without it the control belongs to the form it sits inside. |
|
|
2262
|
+
|
|
2263
|
+
| Event | `detail` | Description |
|
|
2264
|
+
|---|---|---|
|
|
2265
|
+
| `void-input` | `{ value: string }` | |
|
|
2266
|
+
| `void-change` | `{ value: string }` | |
|
|
2267
|
+
|
|
2268
|
+
Attributes that do not exist (and what to write instead):
|
|
2269
|
+
|
|
2270
|
+
- `label`: wrap the control in <void-field label="...">
|
|
2271
|
+
|
|
2272
|
+
Example:
|
|
2273
|
+
|
|
2274
|
+
```html
|
|
2275
|
+
<void-field label="Email" helper="We never share it.">
|
|
2276
|
+
<void-input type="email" name="email" placeholder="you@example.com" required></void-input>
|
|
2277
|
+
</void-field>
|
|
2278
|
+
```
|
|
2279
|
+
|
|
2280
|
+
## `<void-line-chart>`
|
|
2281
|
+
|
|
2282
|
+
Line chart for trends over time with one or more series, linear or stepped, drawn in SVG with an animated
|
|
2283
|
+
entry. Give it `data` (`{ series: [{ name, values }], labels }`) from script; it has no children. The chart
|
|
2284
|
+
is an image to assistive technology, so set `aria-label` and state the key figures in the surrounding text.
|
|
2285
|
+
|
|
2286
|
+
| Attribute | Values | Default | Description |
|
|
2287
|
+
|---|---|---|---|
|
|
2288
|
+
| `height` | `number` | `220` | Height of the chart in pixels. Defaults to 220. The width fills the container. |
|
|
2289
|
+
| `show-value` | `boolean` | `false` | Print each point's value above it, abbreviated above 1000 (`1.2k`). |
|
|
2290
|
+
| `variant` | `filled\|outline\|wireframe` | `outline` | How the area under each line is drawn: `outline` (default, a light tint), `filled` (a stronger tint) or `wireframe` (no area, just the line). |
|
|
2291
|
+
| `interpolation` | `linear\|step` | `linear` | How points are joined: `linear` (default, straight segments) or `step` (a horizontal run, then a vertical jump). |
|
|
2292
|
+
| `aria-label` | `string` | | Accessible name of the chart, such as `Visitors per day`. The chart is an image to assistive technology, so set it and put the key figures in the text around it. |
|
|
2293
|
+
|
|
2294
|
+
Properties with no attribute (set in JavaScript):
|
|
2295
|
+
|
|
2296
|
+
| Property | Type | Description |
|
|
2297
|
+
|---|---|---|
|
|
2298
|
+
| `data` | `LineChartData` | The chart's data: `{ series: [{ name, values, color? }], labels? }`. `values` are aligned with `labels` (the names along the horizontal axis); `color` overrides a series' colour. Property only: assign a new object to update the chart and animate to it. |
|
|
2299
|
+
|
|
2300
|
+
Example:
|
|
2301
|
+
|
|
2302
|
+
```html
|
|
2303
|
+
<void-line-chart aria-label="Visitors per day" height="240"></void-line-chart>
|
|
2304
|
+
```
|
|
2305
|
+
|
|
2306
|
+
## `<void-list>`
|
|
2307
|
+
|
|
2308
|
+
Structured item list for menus, option sets, and content feeds with consistent spacing and optional dividers.
|
|
2309
|
+
|
|
2310
|
+
| Attribute | Values | Default | Description |
|
|
2311
|
+
|---|---|---|---|
|
|
2312
|
+
| `dividers` | `boolean` | `false` | Draw a hairline between items. |
|
|
2313
|
+
|
|
2314
|
+
| Event | `detail` | Description |
|
|
2315
|
+
|---|---|---|
|
|
2316
|
+
| `void-click` | `(no detail)` | Bubbles from a child `<void-list-item>`. |
|
|
2317
|
+
|
|
2318
|
+
Example:
|
|
2319
|
+
|
|
2320
|
+
```html
|
|
2321
|
+
<void-list dividers>
|
|
2322
|
+
<void-list-item>Design review</void-list-item>
|
|
2323
|
+
<void-list-item selected>Sprint planning</void-list-item>
|
|
2324
|
+
<void-list-item>Retrospective</void-list-item>
|
|
2325
|
+
</void-list>
|
|
2326
|
+
```
|
|
2327
|
+
|
|
2328
|
+
## `<void-list-item>`
|
|
2329
|
+
|
|
2330
|
+
Individual selectable item within a VoidList.
|
|
2331
|
+
|
|
2332
|
+
| Attribute | Values | Default | Description |
|
|
2333
|
+
|---|---|---|---|
|
|
2334
|
+
| `selected` | `boolean` | `false` | Mark the item as the current choice: it is drawn highlighted. It is a visual state only; it is not exposed to assistive technology. |
|
|
2335
|
+
| `disabled` | `boolean` | `false` | Dim the item and stop it firing `void-click`. |
|
|
2336
|
+
| `interactive` | `boolean` | `false` | Make the item behave like a button: a hover and focus style, and a click fires `void-click`. Without it the item is static and fires nothing. |
|
|
2337
|
+
|
|
2338
|
+
| Event | `detail` | Description |
|
|
2339
|
+
|---|---|---|
|
|
2340
|
+
| `void-click` | `(no detail)` | |
|
|
2341
|
+
|
|
2342
|
+
Allowed inside: `<void-list>`.
|
|
2343
|
+
|
|
2344
|
+
Example:
|
|
2345
|
+
|
|
2346
|
+
```html
|
|
2347
|
+
<void-list dividers>
|
|
2348
|
+
<void-list-item interactive>Design review</void-list-item>
|
|
2349
|
+
<void-list-item interactive selected>Sprint planning</void-list-item>
|
|
2350
|
+
<void-list-item interactive disabled>Retrospective</void-list-item>
|
|
2351
|
+
</void-list>
|
|
2352
|
+
```
|
|
2353
|
+
|
|
2354
|
+
## `<void-media>`
|
|
2355
|
+
|
|
2356
|
+
Media surface: an <img>, <picture> or <video> that fills the box, with a void-media-content laid over it. Everything inside is on the on-media surface (off-white text in both colour schemes). For heroes, headers and feature sections, not application screens.
|
|
2357
|
+
|
|
2358
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
2359
|
+
|
|
2360
|
+
| Attribute | Values | Default | Description |
|
|
2361
|
+
|---|---|---|---|
|
|
2362
|
+
| `place` | `bottom\|top\|start\|end\|center` | `bottom` | where the content sits; the scrim follows it |
|
|
2363
|
+
| `height` | `sm\|md\|lg\|screen` | `md` | share of the viewport height |
|
|
2364
|
+
| `ratio` | `1:1\|4:3\|16:9\|21:9\|3:1` | | aspect ratio instead of a height |
|
|
2365
|
+
| `scrim` | `gradient\|flat\|none` | `gradient` | gradient: full strength behind the content, fading out beyond it. flat: the whole image. none: only for imagery you know is dark, or content in void-glass |
|
|
2366
|
+
| `focal` | `center\|top\|bottom\|start\|end` | `center` | which part of the image survives the crop; for an exact point set --void-media-focal: 65% 40% in style |
|
|
2367
|
+
| `stack` | `boolean` | | below 48rem the image sits on top and the content below it |
|
|
2368
|
+
|
|
2369
|
+
Example:
|
|
2370
|
+
|
|
2371
|
+
```html
|
|
2372
|
+
<void-media place="bottom" height="lg">
|
|
2373
|
+
<img src="/hero.jpg" alt="">
|
|
2374
|
+
<void-media-content>
|
|
2375
|
+
<h1>Every pass, on one screen</h1>
|
|
2376
|
+
<p>Text here is off-white in both colour schemes and sits on a scrim that keeps it at 4.5:1 over any image.</p>
|
|
2377
|
+
<void-actions>
|
|
2378
|
+
<void-button variant="filled" size="lg">Get started</void-button>
|
|
2379
|
+
<void-button size="lg">Read the docs</void-button>
|
|
2380
|
+
</void-actions>
|
|
2381
|
+
</void-media-content>
|
|
2382
|
+
</void-media>
|
|
2383
|
+
```
|
|
2384
|
+
|
|
2385
|
+
## `<void-media-content>`
|
|
2386
|
+
|
|
2387
|
+
Content region of a void-media: an <h1> (set large), a <p>, void-actions, a void-glass panel. Draws the scrim behind itself.
|
|
2388
|
+
|
|
2389
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
2390
|
+
|
|
2391
|
+
Allowed inside: `<void-media>`.
|
|
2392
|
+
|
|
2393
|
+
Example:
|
|
2394
|
+
|
|
2395
|
+
```html
|
|
2396
|
+
<void-media place="start">
|
|
2397
|
+
<img src="/hero.jpg" alt="">
|
|
2398
|
+
<void-media-content>
|
|
2399
|
+
<span data-void-type="label">Ground network</span>
|
|
2400
|
+
<h1>Forty-four stations</h1>
|
|
2401
|
+
<p>A column on one side; the image stays clear on the other.</p>
|
|
2402
|
+
</void-media-content>
|
|
2403
|
+
</void-media>
|
|
2404
|
+
```
|
|
2405
|
+
|
|
2406
|
+
## `<void-menu>`
|
|
2407
|
+
|
|
2408
|
+
Always-visible menu panel for command palettes, side panels, and searchable action lists.
|
|
2409
|
+
|
|
2410
|
+
Its regions are parts, in this order: an optional `<void-menu-search>` around one text field (present means
|
|
2411
|
+
the menu is searchable), the `<void-menu-content>` holding the `<void-menu-item>`s and
|
|
2412
|
+
`<void-menu-group>`s, and an optional `<void-menu-empty>` shown instead of the default "No results found" when
|
|
2413
|
+
a search matches nothing. The parts are the final DOM: the menu moves and renders nothing.
|
|
2414
|
+
|
|
2415
|
+
Follows the WAI-ARIA menu pattern: the content is the `role="menu"` (the host has no role, so the search
|
|
2416
|
+
field is not a menu child) and the items are `menuitem`s, one tab stop at a time (roving tabindex).
|
|
2417
|
+
Keys are handled on the menu itself, never on the document. Keyboard: ArrowDown and ArrowUp move between
|
|
2418
|
+
items (wrapping, skipping disabled and filtered-out ones; with a search field, ArrowDown from the field
|
|
2419
|
+
goes to the first item and ArrowUp from the first item returns to the field), Home and End jump to
|
|
2420
|
+
the first and last item, typing jumps to the next item starting with the characters (not in the search
|
|
2421
|
+
field), Enter or Space activate the item (`void-select`), Escape closes the menu.
|
|
2422
|
+
|
|
2423
|
+
Parts (only these parts as children, in this order):
|
|
2424
|
+
|
|
2425
|
+
| Part | | Description |
|
|
2426
|
+
|---|---|---|
|
|
2427
|
+
| `<void-menu-search>` | one, wraps one control, CSS-only | Wraps the one text field (an <input type="search">) that filters the items as the user types; present means the menu is searchable. |
|
|
2428
|
+
| `<void-menu-content>` | required, one, CSS-only | The list (role="menu"): the items, and groups of items. |
|
|
2429
|
+
|  `<void-menu-item>` | any number | One action of the menu. |
|
|
2430
|
+
|  `<void-menu-group>` | any number | A labelled group of items. |
|
|
2431
|
+
| `<void-menu-empty>` | one, CSS-only | Shown instead of the default "No results found" while a search matches no item. |
|
|
2432
|
+
|
|
2433
|
+
Markup: `<void-menu open><void-menu-search><input type="search" placeholder="Search..." aria-label="Search"></void-menu-search><void-menu-content><void-menu-item value="new">New</void-menu-item></void-menu-content></void-menu>`
|
|
2434
|
+
|
|
2435
|
+
| Attribute | Values | Default | Description |
|
|
2436
|
+
|---|---|---|---|
|
|
2437
|
+
| `open` | `boolean` | `false` | Whether the menu is shown. It starts hidden: add `open` to show it (the menu has no trigger of its own). Escape sets it back to false. |
|
|
2438
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
2439
|
+
|
|
2440
|
+
| Event | `detail` | Description |
|
|
2441
|
+
|---|---|---|
|
|
2442
|
+
| `void-select` | `{ item: VoidMenuItem; value: string }` | Bubbles from a child `<void-menu-item>`. |
|
|
2443
|
+
|
|
2444
|
+
Attributes that do not exist (and what to write instead):
|
|
2445
|
+
|
|
2446
|
+
- `searchable`: write a <void-menu-search> around an <input type="search"> before the content
|
|
2447
|
+
- `placeholder`: write placeholder and aria-label on the input inside <void-menu-search>
|
|
2448
|
+
|
|
2449
|
+
Example:
|
|
2450
|
+
|
|
2451
|
+
```html
|
|
2452
|
+
<void-menu open aria-label="Commands">
|
|
2453
|
+
<void-menu-search><input type="search" placeholder="Search..." aria-label="Search commands"></void-menu-search>
|
|
2454
|
+
<void-menu-content>
|
|
2455
|
+
<void-menu-group>
|
|
2456
|
+
<void-menu-group-label>File</void-menu-group-label>
|
|
2457
|
+
<void-menu-item value="new">New file<void-menu-item-shortcut>Ctrl+N</void-menu-item-shortcut></void-menu-item>
|
|
2458
|
+
<void-menu-item value="open">Open...<void-menu-item-shortcut>Ctrl+O</void-menu-item-shortcut></void-menu-item>
|
|
2459
|
+
</void-menu-group>
|
|
2460
|
+
<void-menu-group>
|
|
2461
|
+
<void-menu-group-label>Edit</void-menu-group-label>
|
|
2462
|
+
<void-menu-item value="copy">Copy<void-menu-item-shortcut>Ctrl+C</void-menu-item-shortcut></void-menu-item>
|
|
2463
|
+
<void-menu-item value="paste" disabled>Paste<void-menu-item-shortcut>Ctrl+V</void-menu-item-shortcut></void-menu-item>
|
|
2464
|
+
</void-menu-group>
|
|
2465
|
+
</void-menu-content>
|
|
2466
|
+
<void-menu-empty>No commands match.</void-menu-empty>
|
|
2467
|
+
</void-menu>
|
|
2468
|
+
```
|
|
2469
|
+
|
|
2470
|
+
## `<void-menu-content>`
|
|
2471
|
+
|
|
2472
|
+
The list (role="menu"): the items, and groups of items.
|
|
2473
|
+
|
|
2474
|
+
CSS-only part of `<void-menu>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
2475
|
+
|
|
2476
|
+
Parts (only these parts as children):
|
|
2477
|
+
|
|
2478
|
+
| Part | | Description |
|
|
2479
|
+
|---|---|---|
|
|
2480
|
+
| `<void-menu-item>` | any number | One action of the menu. |
|
|
2481
|
+
| `<void-menu-group>` | any number | A labelled group of items. |
|
|
2482
|
+
|
|
2483
|
+
Allowed inside: `<void-menu>`.
|
|
2484
|
+
|
|
2485
|
+
Example:
|
|
2486
|
+
|
|
2487
|
+
```html
|
|
2488
|
+
<void-menu open aria-label="Commands">
|
|
2489
|
+
<void-menu-search><input type="search" placeholder="Search..." aria-label="Search commands"></void-menu-search>
|
|
2490
|
+
<void-menu-content>
|
|
2491
|
+
<void-menu-group>
|
|
2492
|
+
<void-menu-group-label>File</void-menu-group-label>
|
|
2493
|
+
<void-menu-item value="new">New file<void-menu-item-shortcut>Ctrl+N</void-menu-item-shortcut></void-menu-item>
|
|
2494
|
+
<void-menu-item value="open">Open...<void-menu-item-shortcut>Ctrl+O</void-menu-item-shortcut></void-menu-item>
|
|
2495
|
+
</void-menu-group>
|
|
2496
|
+
<void-menu-group>
|
|
2497
|
+
<void-menu-group-label>Edit</void-menu-group-label>
|
|
2498
|
+
<void-menu-item value="copy">Copy<void-menu-item-shortcut>Ctrl+C</void-menu-item-shortcut></void-menu-item>
|
|
2499
|
+
<void-menu-item value="paste" disabled>Paste<void-menu-item-shortcut>Ctrl+V</void-menu-item-shortcut></void-menu-item>
|
|
2500
|
+
</void-menu-group>
|
|
2501
|
+
</void-menu-content>
|
|
2502
|
+
<void-menu-empty>No commands match.</void-menu-empty>
|
|
2503
|
+
</void-menu>
|
|
2504
|
+
```
|
|
2505
|
+
|
|
2506
|
+
## `<void-menu-empty>`
|
|
2507
|
+
|
|
2508
|
+
Shown instead of the default "No results found" while a search matches no item.
|
|
2509
|
+
|
|
2510
|
+
CSS-only part of `<void-menu>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
2511
|
+
|
|
2512
|
+
Allowed inside: `<void-menu>`.
|
|
2513
|
+
|
|
2514
|
+
Example:
|
|
2515
|
+
|
|
2516
|
+
```html
|
|
2517
|
+
<void-menu open aria-label="Commands">
|
|
2518
|
+
<void-menu-search><input type="search" placeholder="Search..." aria-label="Search commands"></void-menu-search>
|
|
2519
|
+
<void-menu-content>
|
|
2520
|
+
<void-menu-group>
|
|
2521
|
+
<void-menu-group-label>File</void-menu-group-label>
|
|
2522
|
+
<void-menu-item value="new">New file<void-menu-item-shortcut>Ctrl+N</void-menu-item-shortcut></void-menu-item>
|
|
2523
|
+
<void-menu-item value="open">Open...<void-menu-item-shortcut>Ctrl+O</void-menu-item-shortcut></void-menu-item>
|
|
2524
|
+
</void-menu-group>
|
|
2525
|
+
<void-menu-group>
|
|
2526
|
+
<void-menu-group-label>Edit</void-menu-group-label>
|
|
2527
|
+
<void-menu-item value="copy">Copy<void-menu-item-shortcut>Ctrl+C</void-menu-item-shortcut></void-menu-item>
|
|
2528
|
+
<void-menu-item value="paste" disabled>Paste<void-menu-item-shortcut>Ctrl+V</void-menu-item-shortcut></void-menu-item>
|
|
2529
|
+
</void-menu-group>
|
|
2530
|
+
</void-menu-content>
|
|
2531
|
+
<void-menu-empty>No commands match.</void-menu-empty>
|
|
2532
|
+
</void-menu>
|
|
2533
|
+
```
|
|
2534
|
+
|
|
2535
|
+
## `<void-menu-group>`
|
|
2536
|
+
|
|
2537
|
+
Labelled group of `void-menu-item`s inside a `void-menu`. Its heading is a `<void-menu-group-label>` first in
|
|
2538
|
+
the group, which names the group.
|
|
2539
|
+
|
|
2540
|
+
Parts (parts mixed with other content):
|
|
2541
|
+
|
|
2542
|
+
| Part | | Description |
|
|
2543
|
+
|---|---|---|
|
|
2544
|
+
| `<void-menu-group-label>` | one, CSS-only | Heading of the group; names it for assistive technology. |
|
|
2545
|
+
|
|
2546
|
+
Markup: `<void-menu-group><void-menu-group-label>File</void-menu-group-label><void-menu-item value="new">New</void-menu-item></void-menu-group>`
|
|
2547
|
+
|
|
2548
|
+
| Event | `detail` | Description |
|
|
2549
|
+
|---|---|---|
|
|
2550
|
+
| `void-select` | `{ item: VoidMenuItem; value: string }` | Bubbles from a child `<void-menu-item>`. |
|
|
2551
|
+
|
|
2552
|
+
Allowed inside: `<void-menu-content>`.
|
|
2553
|
+
|
|
2554
|
+
Attributes that do not exist (and what to write instead):
|
|
2555
|
+
|
|
2556
|
+
- `label`: write the heading as <void-menu-group-label>...</void-menu-group-label> first in the group
|
|
2557
|
+
|
|
2558
|
+
Example:
|
|
2559
|
+
|
|
2560
|
+
```html
|
|
2561
|
+
<void-menu open aria-label="Commands">
|
|
2562
|
+
<void-menu-content>
|
|
2563
|
+
<void-menu-group>
|
|
2564
|
+
<void-menu-group-label>File</void-menu-group-label>
|
|
2565
|
+
<void-menu-item value="new">New file</void-menu-item>
|
|
2566
|
+
<void-menu-item value="open">Open...</void-menu-item>
|
|
2567
|
+
</void-menu-group>
|
|
2568
|
+
</void-menu-content>
|
|
2569
|
+
</void-menu>
|
|
2570
|
+
```
|
|
2571
|
+
|
|
2572
|
+
## `<void-menu-group-label>`
|
|
2573
|
+
|
|
2574
|
+
Heading of the group; names it for assistive technology.
|
|
2575
|
+
|
|
2576
|
+
CSS-only part of `<void-menu-group>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
2577
|
+
|
|
2578
|
+
Allowed inside: `<void-menu-group>`.
|
|
2579
|
+
|
|
2580
|
+
Example:
|
|
2581
|
+
|
|
2582
|
+
```html
|
|
2583
|
+
<void-menu open aria-label="Commands">
|
|
2584
|
+
<void-menu-search><input type="search" placeholder="Search..." aria-label="Search commands"></void-menu-search>
|
|
2585
|
+
<void-menu-content>
|
|
2586
|
+
<void-menu-group>
|
|
2587
|
+
<void-menu-group-label>File</void-menu-group-label>
|
|
2588
|
+
<void-menu-item value="new">New file<void-menu-item-shortcut>Ctrl+N</void-menu-item-shortcut></void-menu-item>
|
|
2589
|
+
<void-menu-item value="open">Open...<void-menu-item-shortcut>Ctrl+O</void-menu-item-shortcut></void-menu-item>
|
|
2590
|
+
</void-menu-group>
|
|
2591
|
+
<void-menu-group>
|
|
2592
|
+
<void-menu-group-label>Edit</void-menu-group-label>
|
|
2593
|
+
<void-menu-item value="copy">Copy<void-menu-item-shortcut>Ctrl+C</void-menu-item-shortcut></void-menu-item>
|
|
2594
|
+
<void-menu-item value="paste" disabled>Paste<void-menu-item-shortcut>Ctrl+V</void-menu-item-shortcut></void-menu-item>
|
|
2595
|
+
</void-menu-group>
|
|
2596
|
+
</void-menu-content>
|
|
2597
|
+
<void-menu-empty>No commands match.</void-menu-empty>
|
|
2598
|
+
</void-menu>
|
|
2599
|
+
```
|
|
2600
|
+
|
|
2601
|
+
## `<void-menu-item>`
|
|
2602
|
+
|
|
2603
|
+
One action in a `void-menu`: activating it (click, Enter or Space) fires `void-select` with its `value`. Its
|
|
2604
|
+
text is its label; an optional `<void-menu-item-icon>` before it and `<void-menu-item-shortcut>` after it are
|
|
2605
|
+
CSS-only parts.
|
|
2606
|
+
|
|
2607
|
+
Parts (parts mixed with other content, in this order):
|
|
2608
|
+
|
|
2609
|
+
| Part | | Description |
|
|
2610
|
+
|---|---|---|
|
|
2611
|
+
| `<void-menu-item-icon>` | one, CSS-only | A glyph or icon before the label; decorative (add aria-hidden="true"). |
|
|
2612
|
+
| `<void-menu-item-shortcut>` | one, CSS-only | Text at the end of the row that advertises a keyboard shortcut. Display only: it does not bind the key. |
|
|
2613
|
+
|
|
2614
|
+
Markup: `<void-menu-item value="save"><void-menu-item-icon>+</void-menu-item-icon>Save<void-menu-item-shortcut>Ctrl+S</void-menu-item-shortcut></void-menu-item>`
|
|
2615
|
+
|
|
2616
|
+
| Attribute | Values | Default | Description |
|
|
2617
|
+
|---|---|---|---|
|
|
2618
|
+
| `value` | `string` | | What the item stands for, passed as `detail.value` of `void-select` (empty when not set). Use it instead of matching on the item's text. |
|
|
2619
|
+
| `disabled` | `boolean` | `false` | Dim the item, skip it in keyboard navigation and stop it firing `void-select`. |
|
|
2620
|
+
|
|
2621
|
+
| Event | `detail` | Description |
|
|
2622
|
+
|---|---|---|
|
|
2623
|
+
| `void-select` | `{ item: VoidMenuItem; value: string }` | The item was chosen. |
|
|
2624
|
+
|
|
2625
|
+
Allowed inside: `<void-menu-group>`, `<void-menu-content>`.
|
|
2626
|
+
|
|
2627
|
+
Attributes that do not exist (and what to write instead):
|
|
2628
|
+
|
|
2629
|
+
- `icon`: write <void-menu-item-icon>...</void-menu-item-icon> first in the item
|
|
2630
|
+
- `shortcut`: write <void-menu-item-shortcut>Ctrl+S</void-menu-item-shortcut> last in the item
|
|
2631
|
+
|
|
2632
|
+
Example:
|
|
2633
|
+
|
|
2634
|
+
```html
|
|
2635
|
+
<void-menu open aria-label="Commands">
|
|
2636
|
+
<void-menu-content>
|
|
2637
|
+
<void-menu-item value="new"><void-menu-item-icon aria-hidden="true">+</void-menu-item-icon>New file<void-menu-item-shortcut>Ctrl+N</void-menu-item-shortcut></void-menu-item>
|
|
2638
|
+
<void-menu-item value="open">Open...<void-menu-item-shortcut>Ctrl+O</void-menu-item-shortcut></void-menu-item>
|
|
2639
|
+
<void-menu-item value="close" disabled>Close</void-menu-item>
|
|
2640
|
+
</void-menu-content>
|
|
2641
|
+
</void-menu>
|
|
2642
|
+
```
|
|
2643
|
+
|
|
2644
|
+
## `<void-menu-item-icon>`
|
|
2645
|
+
|
|
2646
|
+
A glyph or icon before the label; decorative (add aria-hidden="true").
|
|
2647
|
+
|
|
2648
|
+
CSS-only part of `<void-menu-item>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
2649
|
+
|
|
2650
|
+
Allowed inside: `<void-menu-item>`.
|
|
2651
|
+
|
|
2652
|
+
Example:
|
|
2653
|
+
|
|
2654
|
+
```html
|
|
2655
|
+
<void-menu open aria-label="Commands">
|
|
2656
|
+
<void-menu-search><input type="search" placeholder="Search..." aria-label="Search commands"></void-menu-search>
|
|
2657
|
+
<void-menu-content>
|
|
2658
|
+
<void-menu-group>
|
|
2659
|
+
<void-menu-group-label>File</void-menu-group-label>
|
|
2660
|
+
<void-menu-item value="new">New file<void-menu-item-shortcut>Ctrl+N</void-menu-item-shortcut></void-menu-item>
|
|
2661
|
+
<void-menu-item value="open">Open...<void-menu-item-shortcut>Ctrl+O</void-menu-item-shortcut></void-menu-item>
|
|
2662
|
+
</void-menu-group>
|
|
2663
|
+
<void-menu-group>
|
|
2664
|
+
<void-menu-group-label>Edit</void-menu-group-label>
|
|
2665
|
+
<void-menu-item value="copy">Copy<void-menu-item-shortcut>Ctrl+C</void-menu-item-shortcut></void-menu-item>
|
|
2666
|
+
<void-menu-item value="paste" disabled>Paste<void-menu-item-shortcut>Ctrl+V</void-menu-item-shortcut></void-menu-item>
|
|
2667
|
+
</void-menu-group>
|
|
2668
|
+
</void-menu-content>
|
|
2669
|
+
<void-menu-empty>No commands match.</void-menu-empty>
|
|
2670
|
+
</void-menu>
|
|
2671
|
+
```
|
|
2672
|
+
|
|
2673
|
+
## `<void-menu-item-shortcut>`
|
|
2674
|
+
|
|
2675
|
+
Text at the end of the row that advertises a keyboard shortcut. Display only: it does not bind the key.
|
|
2676
|
+
|
|
2677
|
+
CSS-only part of `<void-menu-item>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
2678
|
+
|
|
2679
|
+
Allowed inside: `<void-menu-item>`.
|
|
2680
|
+
|
|
2681
|
+
Example:
|
|
2682
|
+
|
|
2683
|
+
```html
|
|
2684
|
+
<void-menu open aria-label="Commands">
|
|
2685
|
+
<void-menu-search><input type="search" placeholder="Search..." aria-label="Search commands"></void-menu-search>
|
|
2686
|
+
<void-menu-content>
|
|
2687
|
+
<void-menu-group>
|
|
2688
|
+
<void-menu-group-label>File</void-menu-group-label>
|
|
2689
|
+
<void-menu-item value="new">New file<void-menu-item-shortcut>Ctrl+N</void-menu-item-shortcut></void-menu-item>
|
|
2690
|
+
<void-menu-item value="open">Open...<void-menu-item-shortcut>Ctrl+O</void-menu-item-shortcut></void-menu-item>
|
|
2691
|
+
</void-menu-group>
|
|
2692
|
+
<void-menu-group>
|
|
2693
|
+
<void-menu-group-label>Edit</void-menu-group-label>
|
|
2694
|
+
<void-menu-item value="copy">Copy<void-menu-item-shortcut>Ctrl+C</void-menu-item-shortcut></void-menu-item>
|
|
2695
|
+
<void-menu-item value="paste" disabled>Paste<void-menu-item-shortcut>Ctrl+V</void-menu-item-shortcut></void-menu-item>
|
|
2696
|
+
</void-menu-group>
|
|
2697
|
+
</void-menu-content>
|
|
2698
|
+
<void-menu-empty>No commands match.</void-menu-empty>
|
|
2699
|
+
</void-menu>
|
|
2700
|
+
```
|
|
2701
|
+
|
|
2702
|
+
## `<void-menu-search>`
|
|
2703
|
+
|
|
2704
|
+
Wraps the one text field (an <input type="search">) that filters the items as the user types; present means the menu is searchable.
|
|
2705
|
+
|
|
2706
|
+
CSS-only part of `<void-menu>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
2707
|
+
|
|
2708
|
+
Allowed inside: `<void-menu>`.
|
|
2709
|
+
|
|
2710
|
+
Example:
|
|
2711
|
+
|
|
2712
|
+
```html
|
|
2713
|
+
<void-menu open aria-label="Commands">
|
|
2714
|
+
<void-menu-search><input type="search" placeholder="Search..." aria-label="Search commands"></void-menu-search>
|
|
2715
|
+
<void-menu-content>
|
|
2716
|
+
<void-menu-group>
|
|
2717
|
+
<void-menu-group-label>File</void-menu-group-label>
|
|
2718
|
+
<void-menu-item value="new">New file<void-menu-item-shortcut>Ctrl+N</void-menu-item-shortcut></void-menu-item>
|
|
2719
|
+
<void-menu-item value="open">Open...<void-menu-item-shortcut>Ctrl+O</void-menu-item-shortcut></void-menu-item>
|
|
2720
|
+
</void-menu-group>
|
|
2721
|
+
<void-menu-group>
|
|
2722
|
+
<void-menu-group-label>Edit</void-menu-group-label>
|
|
2723
|
+
<void-menu-item value="copy">Copy<void-menu-item-shortcut>Ctrl+C</void-menu-item-shortcut></void-menu-item>
|
|
2724
|
+
<void-menu-item value="paste" disabled>Paste<void-menu-item-shortcut>Ctrl+V</void-menu-item-shortcut></void-menu-item>
|
|
2725
|
+
</void-menu-group>
|
|
2726
|
+
</void-menu-content>
|
|
2727
|
+
<void-menu-empty>No commands match.</void-menu-empty>
|
|
2728
|
+
</void-menu>
|
|
2729
|
+
```
|
|
2730
|
+
|
|
2731
|
+
## `<void-multiselect>`
|
|
2732
|
+
|
|
2733
|
+
Multi-value picker for tag selection, permission assignment, and filter fields that allow several simultaneous choices.
|
|
2734
|
+
|
|
2735
|
+
One part, `<void-multiselect-content>`, holding the `<void-option>`s: it is the list (`role="listbox"`,
|
|
2736
|
+
`aria-multiselectable`) shown in the top layer under the trigger. The component renders the trigger and its
|
|
2737
|
+
chips itself (after the content part) and never moves, copies or wraps the options.
|
|
2738
|
+
|
|
2739
|
+
Follows the WAI-ARIA select-only combobox pattern with a multiselectable listbox popup: the trigger is the
|
|
2740
|
+
`role="combobox"` element and keeps DOM focus; the highlighted option is exposed with `aria-activedescendant`
|
|
2741
|
+
and drawn with the `active` attribute; chosen options have `aria-selected="true"`. The trigger is described by
|
|
2742
|
+
the number of chosen options ("2 selected"). The popup stays open while options are toggled.
|
|
2743
|
+
|
|
2744
|
+
Keyboard (focus on the trigger): Enter, Space, ArrowDown and Alt+ArrowDown open the list on the first chosen
|
|
2745
|
+
option (else the first); ArrowUp opens it on the first option; Home and End open it on the first or last
|
|
2746
|
+
option; typing characters opens it on the next option starting with them. While open: ArrowDown and ArrowUp
|
|
2747
|
+
move the highlight (stopping at the ends), PageDown and PageUp by ten, Home and End to the first or last option,
|
|
2748
|
+
Enter or Space toggle the highlighted option, typing characters jumps to the next option starting with them,
|
|
2749
|
+
Escape and Alt+ArrowUp close the list (a second Escape reaches the surrounding dialog), Tab closes it and moves
|
|
2750
|
+
on. Disabled options are skipped.
|
|
2751
|
+
|
|
2752
|
+
The list is shown in the top layer (never clipped by an `overflow` or `transform` ancestor) and placed under the
|
|
2753
|
+
trigger with CSS anchor positioning, flipping above it near the bottom of the viewport. A press outside closes
|
|
2754
|
+
it too.
|
|
2755
|
+
|
|
2756
|
+
Parts (only these parts as children):
|
|
2757
|
+
|
|
2758
|
+
| Part | | Description |
|
|
2759
|
+
|---|---|---|
|
|
2760
|
+
| `<void-multiselect-content>` | required, one, CSS-only | The option list (role="listbox", aria-multiselectable) shown in the top layer under the trigger; holds the `<void-option>`s, which stay where they are. |
|
|
2761
|
+
|
|
2762
|
+
Markup: `<void-multiselect name="skills" placeholder="Choose skills"><void-multiselect-content><void-option value="js" selected>JavaScript</void-option><void-option value="go">Go</void-option></void-multiselect-content></void-multiselect>`
|
|
2763
|
+
|
|
2764
|
+
| Attribute | Values | Default | Description |
|
|
2765
|
+
|---|---|---|---|
|
|
2766
|
+
| `placeholder` | `string` | `Select...` | Text shown in the trigger while nothing is selected. Defaults to `Select...`. It is also the trigger's accessible name when no `void-field` label names it. |
|
|
2767
|
+
| `disabled` | `boolean` | `false` | Stop the trigger opening and exclude the values from the form submission. |
|
|
2768
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
2769
|
+
| `error` | `string` | | Mark the control invalid: it gets the error styling and `aria-invalid`. The message itself is shown by the wrapping `void-field`. |
|
|
2770
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
2771
|
+
| `open` | `boolean` | `false` | Whether the option list is showing. Reflected, so it can be read (and set) from markup. |
|
|
2772
|
+
| `value` | `string[]` | `[]` | Select exactly the options whose value is listed. Does not fire void-change. |
|
|
2773
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
2774
|
+
|
|
2775
|
+
| Event | `detail` | Description |
|
|
2776
|
+
|---|---|---|
|
|
2777
|
+
| `void-change` | `{ value: string[] }` | An option was chosen or unchosen; `value` is every chosen value. |
|
|
2778
|
+
| `void-open` | `{ reason: 'trigger' \| 'keyboard' \| 'api' }` | The option list opened. |
|
|
2779
|
+
| `void-close` | `{ reason: 'trigger' \| 'escape' \| 'outside' \| 'blur' \| 'parent' \| 'api' }` | The option list is closing. |
|
|
2780
|
+
|
|
2781
|
+
Example:
|
|
2782
|
+
|
|
2783
|
+
```html
|
|
2784
|
+
<void-field label="Labels">
|
|
2785
|
+
<void-multiselect name="labels" placeholder="Pick labels">
|
|
2786
|
+
<void-multiselect-content>
|
|
2787
|
+
<void-option value="bug">Bug</void-option>
|
|
2788
|
+
<void-option value="design">Design</void-option>
|
|
2789
|
+
<void-option value="docs" selected>Docs</void-option>
|
|
2790
|
+
</void-multiselect-content>
|
|
2791
|
+
</void-multiselect>
|
|
2792
|
+
</void-field>
|
|
2793
|
+
```
|
|
2794
|
+
|
|
2795
|
+
## `<void-multiselect-content>`
|
|
2796
|
+
|
|
2797
|
+
The option list (role="listbox", aria-multiselectable) shown in the top layer under the trigger; holds the `<void-option>`s, which stay where they are.
|
|
2798
|
+
|
|
2799
|
+
CSS-only part of `<void-multiselect>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
2800
|
+
|
|
2801
|
+
Allowed inside: `<void-multiselect>`.
|
|
2802
|
+
|
|
2803
|
+
Example:
|
|
2804
|
+
|
|
2805
|
+
```html
|
|
2806
|
+
<void-field label="Labels">
|
|
2807
|
+
<void-multiselect name="labels" placeholder="Pick labels">
|
|
2808
|
+
<void-multiselect-content>
|
|
2809
|
+
<void-option value="bug">Bug</void-option>
|
|
2810
|
+
<void-option value="design">Design</void-option>
|
|
2811
|
+
<void-option value="docs" selected>Docs</void-option>
|
|
2812
|
+
</void-multiselect-content>
|
|
2813
|
+
</void-multiselect>
|
|
2814
|
+
</void-field>
|
|
2815
|
+
```
|
|
2816
|
+
|
|
2817
|
+
## `<void-nav-bar>`
|
|
2818
|
+
|
|
2819
|
+
Top application navigation bar for branding, primary links, and user account controls.
|
|
2820
|
+
|
|
2821
|
+
The bar is a row: what you write inside it is laid out by the theme as it stands, with no part elements and
|
|
2822
|
+
nothing rendered. Use the patterns beside it for the usual contents: `<void-brand>` for the name or logo,
|
|
2823
|
+
`<void-nav-links>` for the links (mark the current page with `aria-current="page"`) and `<void-spacer>` to
|
|
2824
|
+
push what follows to the far end.
|
|
2825
|
+
|
|
2826
|
+
| Attribute | Values | Default | Description |
|
|
2827
|
+
|---|---|---|---|
|
|
2828
|
+
| `sticky` | `boolean` | `false` | Stay at the top of the viewport while the page scrolls. |
|
|
2829
|
+
| `hide-border` | `boolean` | `false` | Leave out the hairline under the bar (it is drawn by default). |
|
|
2830
|
+
| `variant` | `default\|elevated` | `default` | `default` sits on the page; `elevated` uses the raised surface colour. |
|
|
2831
|
+
|
|
2832
|
+
Example:
|
|
2833
|
+
|
|
2834
|
+
```html
|
|
2835
|
+
<void-nav-bar>
|
|
2836
|
+
<void-brand><a href="/">Orbital</a></void-brand>
|
|
2837
|
+
<void-nav-links>
|
|
2838
|
+
<a href="/stations" aria-current="page">Stations</a>
|
|
2839
|
+
<a href="/passes">Passes</a>
|
|
2840
|
+
</void-nav-links>
|
|
2841
|
+
<void-spacer></void-spacer>
|
|
2842
|
+
<void-button variant="ghost">Sign in</void-button>
|
|
2843
|
+
</void-nav-bar>
|
|
2844
|
+
```
|
|
2845
|
+
|
|
2846
|
+
## `<void-nav-links>`
|
|
2847
|
+
|
|
2848
|
+
Links of a void-nav-bar or void-sidebar: <a> children, the current one marked aria-current="page". A row that scrolls sideways when it runs out of room; a column in a sidebar.
|
|
2849
|
+
|
|
2850
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
2851
|
+
|
|
2852
|
+
| Attribute | Values | Default | Description |
|
|
2853
|
+
|---|---|---|---|
|
|
2854
|
+
| `orientation` | `horizontal\|vertical` | `horizontal` | vertical stacks the links (automatic inside void-sidebar) |
|
|
2855
|
+
|
|
2856
|
+
Example:
|
|
2857
|
+
|
|
2858
|
+
```html
|
|
2859
|
+
<void-nav-links>
|
|
2860
|
+
<a href="/" aria-current="page">Overview</a>
|
|
2861
|
+
<a href="/stations">Stations</a>
|
|
2862
|
+
<a href="/settings">Settings</a>
|
|
2863
|
+
</void-nav-links>
|
|
2864
|
+
```
|
|
2865
|
+
|
|
2866
|
+
## `<void-nav-menu>`
|
|
2867
|
+
|
|
2868
|
+
Horizontal navigation bar with dropdown sub-menus for site headers, application nav bars, and mega-menu layouts.
|
|
2869
|
+
|
|
2870
|
+
A row of `<void-nav-menu-item>`s. Arrow keys move between the items' triggers, Escape closes an open panel and
|
|
2871
|
+
returns focus to its trigger.
|
|
2872
|
+
|
|
2873
|
+
Parts (only these parts as children):
|
|
2874
|
+
|
|
2875
|
+
| Part | | Description |
|
|
2876
|
+
|---|---|---|
|
|
2877
|
+
| `<void-nav-menu-item>` | required, any number | One entry of the menu bar: a trigger, and for a dropdown a content panel after it. |
|
|
2878
|
+
|  `<void-nav-menu-trigger>` | required, one, wraps one control, CSS-only | Wraps the one element that is the entry: a <button> that opens a dropdown, or an <a href> that navigates; that element gets the menubar ARIA. |
|
|
2879
|
+
|  `<void-nav-menu-content>` | one, CSS-only | The dropdown panel (role="menu"), shown on hover, click or Enter on the trigger. |
|
|
2880
|
+
|
|
2881
|
+
Markup: `<void-nav-menu><void-nav-menu-item><void-nav-menu-trigger><button type="button">Products</button></void-nav-menu-trigger><void-nav-menu-content><a href="/products/a">Product A</a></void-nav-menu-content></void-nav-menu-item><void-nav-menu-item current><void-nav-menu-trigger><a href="/docs">Docs</a></void-nav-menu-trigger></void-nav-menu-item></void-nav-menu>`
|
|
2882
|
+
|
|
2883
|
+
| Attribute | Values | Default | Description |
|
|
2884
|
+
|---|---|---|---|
|
|
2885
|
+
| `orientation` | `horizontal\|vertical` | `horizontal` | `horizontal` (default) lays the items out in a row with Left and Right arrow keys; `vertical` stacks them. |
|
|
2886
|
+
| `width` | `string` | | CSS width of the menu, such as `100%` or `40rem`. By default it is as wide as its items. |
|
|
2887
|
+
|
|
2888
|
+
Example:
|
|
2889
|
+
|
|
2890
|
+
```html
|
|
2891
|
+
<void-nav-menu>
|
|
2892
|
+
<void-nav-menu-item>
|
|
2893
|
+
<void-nav-menu-trigger><button type="button">Products</button></void-nav-menu-trigger>
|
|
2894
|
+
<void-nav-menu-content>
|
|
2895
|
+
<a href="/analytics">Analytics</a>
|
|
2896
|
+
<a href="/automation">Automation</a>
|
|
2897
|
+
</void-nav-menu-content>
|
|
2898
|
+
</void-nav-menu-item>
|
|
2899
|
+
<void-nav-menu-item current>
|
|
2900
|
+
<void-nav-menu-trigger><a href="/pricing">Pricing</a></void-nav-menu-trigger>
|
|
2901
|
+
</void-nav-menu-item>
|
|
2902
|
+
</void-nav-menu>
|
|
2903
|
+
```
|
|
2904
|
+
|
|
2905
|
+
## `<void-nav-menu-content>`
|
|
2906
|
+
|
|
2907
|
+
The dropdown panel (role="menu"), shown on hover, click or Enter on the trigger.
|
|
2908
|
+
|
|
2909
|
+
CSS-only part of `<void-nav-menu-item>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
2910
|
+
|
|
2911
|
+
Allowed inside: `<void-nav-menu-item>`.
|
|
2912
|
+
|
|
2913
|
+
Example:
|
|
2914
|
+
|
|
2915
|
+
```html
|
|
2916
|
+
<void-nav-menu>
|
|
2917
|
+
<void-nav-menu-item>
|
|
2918
|
+
<void-nav-menu-trigger><button type="button">Products</button></void-nav-menu-trigger>
|
|
2919
|
+
<void-nav-menu-content>
|
|
2920
|
+
<a href="/analytics">Analytics</a>
|
|
2921
|
+
<a href="/automation">Automation</a>
|
|
2922
|
+
</void-nav-menu-content>
|
|
2923
|
+
</void-nav-menu-item>
|
|
2924
|
+
<void-nav-menu-item current>
|
|
2925
|
+
<void-nav-menu-trigger><a href="/pricing">Pricing</a></void-nav-menu-trigger>
|
|
2926
|
+
</void-nav-menu-item>
|
|
2927
|
+
</void-nav-menu>
|
|
2928
|
+
```
|
|
2929
|
+
|
|
2930
|
+
## `<void-nav-menu-item>`
|
|
2931
|
+
|
|
2932
|
+
One entry of a `<void-nav-menu>`: a `<void-nav-menu-trigger>` around one control (a `<button>` for an entry that
|
|
2933
|
+
opens a panel, an `<a href>` for one that navigates) and, for a panel, a `<void-nav-menu-content>` after it.
|
|
2934
|
+
|
|
2935
|
+
Hovering the item opens its panel after a short delay; a click, Enter or Space on a button trigger opens it
|
|
2936
|
+
too (the browser turns Enter and Space on a button into one `click`, so each key activates exactly once). A
|
|
2937
|
+
link trigger always navigates. The panel closes when the pointer leaves, on Escape, on a press outside or when
|
|
2938
|
+
focus leaves the item.
|
|
2939
|
+
|
|
2940
|
+
| Attribute | Values | Default | Description |
|
|
2941
|
+
|---|---|---|---|
|
|
2942
|
+
| `open` | `boolean` | `false` | Whether the item's panel is showing. A click or Enter on the trigger toggles it, firing `void-open` or `void-close`. |
|
|
2943
|
+
| `disabled` | `boolean` | `false` | Dim the item and stop it opening or navigating. |
|
|
2944
|
+
| `current` | `boolean` | `false` | Mark the item as the current section: it is drawn with an underline, and a link trigger gets `aria-current="page"`. Set it on the item that matches the page. |
|
|
2945
|
+
|
|
2946
|
+
| Event | `detail` | Description |
|
|
2947
|
+
|---|---|---|
|
|
2948
|
+
| `void-open` | `{ reason: 'hover' \| 'trigger' }` | The panel opened. Does not bubble. |
|
|
2949
|
+
| `void-close` | `{ reason: 'hover' \| 'trigger' \| 'escape' \| 'outside' \| 'blur' }` | The panel closed. Does not bubble. |
|
|
2950
|
+
|
|
2951
|
+
Allowed inside: `<void-nav-menu>`.
|
|
2952
|
+
|
|
2953
|
+
Attributes that do not exist (and what to write instead):
|
|
2954
|
+
|
|
2955
|
+
- `href`: write the link as <void-nav-menu-trigger><a href="...">Label</a></void-nav-menu-trigger>
|
|
2956
|
+
|
|
2957
|
+
Example:
|
|
2958
|
+
|
|
2959
|
+
```html
|
|
2960
|
+
<void-nav-menu>
|
|
2961
|
+
<void-nav-menu-item>
|
|
2962
|
+
<void-nav-menu-trigger><button type="button">Resources</button></void-nav-menu-trigger>
|
|
2963
|
+
<void-nav-menu-content>
|
|
2964
|
+
<a href="/docs">Documentation</a>
|
|
2965
|
+
<a href="/blog">Blog</a>
|
|
2966
|
+
</void-nav-menu-content>
|
|
2967
|
+
</void-nav-menu-item>
|
|
2968
|
+
<void-nav-menu-item>
|
|
2969
|
+
<void-nav-menu-trigger><a href="/pricing">Pricing</a></void-nav-menu-trigger>
|
|
2970
|
+
</void-nav-menu-item>
|
|
2971
|
+
</void-nav-menu>
|
|
2972
|
+
```
|
|
2973
|
+
|
|
2974
|
+
## `<void-nav-menu-trigger>`
|
|
2975
|
+
|
|
2976
|
+
Wraps the one element that is the entry: a <button> that opens a dropdown, or an <a href> that navigates; that element gets the menubar ARIA.
|
|
2977
|
+
|
|
2978
|
+
CSS-only part of `<void-nav-menu-item>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
2979
|
+
|
|
2980
|
+
Allowed inside: `<void-nav-menu-item>`.
|
|
2981
|
+
|
|
2982
|
+
Example:
|
|
2983
|
+
|
|
2984
|
+
```html
|
|
2985
|
+
<void-nav-menu>
|
|
2986
|
+
<void-nav-menu-item>
|
|
2987
|
+
<void-nav-menu-trigger><button type="button">Products</button></void-nav-menu-trigger>
|
|
2988
|
+
<void-nav-menu-content>
|
|
2989
|
+
<a href="/analytics">Analytics</a>
|
|
2990
|
+
<a href="/automation">Automation</a>
|
|
2991
|
+
</void-nav-menu-content>
|
|
2992
|
+
</void-nav-menu-item>
|
|
2993
|
+
<void-nav-menu-item current>
|
|
2994
|
+
<void-nav-menu-trigger><a href="/pricing">Pricing</a></void-nav-menu-trigger>
|
|
2995
|
+
</void-nav-menu-item>
|
|
2996
|
+
</void-nav-menu>
|
|
2997
|
+
```
|
|
2998
|
+
|
|
2999
|
+
## `<void-number-input>`
|
|
3000
|
+
|
|
3001
|
+
Precise numeric entry for quantity selectors, price fields, and settings with increment/decrement controls.
|
|
3002
|
+
The host has no role: the native text input is the spinbutton (it carries the value, bounds and the accessible
|
|
3003
|
+
name, which `<void-field>` supplies), and the stepper buttons are its own buttons.
|
|
3004
|
+
|
|
3005
|
+
| Attribute | Values | Default | Description |
|
|
3006
|
+
|---|---|---|---|
|
|
3007
|
+
| `value` | `number \| null` | | The number, or `null` while the field is empty (the default, and after the user clears it). Reflected to the attribute as it changes (absent while empty); an absent or empty attribute is an empty field. It is kept within `min` and `max` once the user commits an edit. An empty field submits an empty string, and with `required` it is invalid (`valueMissing`), as a native number field. |
|
|
3008
|
+
| `min` | `number` | `Number.NEGATIVE_INFINITY` | Lowest allowed value. Unbounded by default. |
|
|
3009
|
+
| `max` | `number` | `Number.POSITIVE_INFINITY` | Highest allowed value. Unbounded by default. |
|
|
3010
|
+
| `step` | `number \| 'any'` | `1` | Increment applied by the stepper buttons and arrow keys. `any` matches the native input: no step constraint on typed values, and the buttons step by 1. |
|
|
3011
|
+
| `precision` | `number` | `-1` | Number of decimals to round to; `0` gives integers. Unset (the default) leaves the value as entered. |
|
|
3012
|
+
| `disabled` | `boolean` | `false` | Stop the field and its stepper buttons reacting and exclude the value from the form submission. |
|
|
3013
|
+
| `readonly` | `boolean` | `false` | Show the value but do not let the user change it; the field is still focusable and submitted. |
|
|
3014
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
3015
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
3016
|
+
| `placeholder` | `string` | | Hint text shown while the field is empty. |
|
|
3017
|
+
| `controls` | `sides\|right\|none` | `sides` | Where the increment and decrement buttons go: `sides` (default, one each side), `right` (stacked at the right) or `none` (arrow keys only). |
|
|
3018
|
+
| `label` | `string` | | Accessible name of the field when it is not inside a `void-field`. Defaults to `Number input`, so set it. |
|
|
3019
|
+
| `prefix` | `string` | | Text drawn before the number inside the field, such as a currency symbol `$`. Display only; it is not part of the value. |
|
|
3020
|
+
| `unit` | `string` | | Text drawn after the number inside the field, such as `kg`. Display only; it is not part of the value. |
|
|
3021
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
3022
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
3023
|
+
|
|
3024
|
+
| Event | `detail` | Description |
|
|
3025
|
+
|---|---|---|
|
|
3026
|
+
| `void-change` | `{ value: null \| number; previous: number \| null }` | |
|
|
3027
|
+
| `void-input` | `{ value: number \| null }` | |
|
|
3028
|
+
|
|
3029
|
+
Example:
|
|
3030
|
+
|
|
3031
|
+
```html
|
|
3032
|
+
<void-field label="Quantity">
|
|
3033
|
+
<void-number-input name="quantity" value="2" min="1" max="10" step="1"></void-number-input>
|
|
3034
|
+
</void-field>
|
|
3035
|
+
```
|
|
3036
|
+
|
|
3037
|
+
## `<void-option>`
|
|
3038
|
+
|
|
3039
|
+
One option of a `<void-combobox>` or `<void-multiselect>`, inside its `-content` part. The option itself is
|
|
3040
|
+
the `role="option"` in the list: the parent gives it an id and writes `aria-selected` (chosen), `active`
|
|
3041
|
+
(highlighted) and, in a combobox, `hidden` while the typed text filters it out.
|
|
3042
|
+
|
|
3043
|
+
| Attribute | Values | Default | Description |
|
|
3044
|
+
|---|---|---|---|
|
|
3045
|
+
| `value` | `string` | | Value this option contributes when chosen: what the parent `void-combobox` or `void-multiselect` reports and submits. The option's text content is what the user sees. |
|
|
3046
|
+
| `selected` | `boolean` | `false` | Mark the option as chosen. In a `void-multiselect` it is the option's state (any number may be selected); in a `void-combobox` it is the initial choice when the combobox has no `value`. |
|
|
3047
|
+
| `disabled` | `boolean` | `false` | A disabled option is listed but cannot be highlighted or chosen. |
|
|
3048
|
+
| `label` | `string` | | Text shown for the option once chosen (in the combobox field, on a multiselect chip) and used for filtering and type-ahead, when its content is more than plain text (an icon, a second line). Defaults to the option's text content. |
|
|
3049
|
+
|
|
3050
|
+
Allowed inside: `<void-combobox-content>`, `<void-multiselect-content>`.
|
|
3051
|
+
|
|
3052
|
+
Example:
|
|
3053
|
+
|
|
3054
|
+
```html
|
|
3055
|
+
<void-field label="Country">
|
|
3056
|
+
<void-combobox name="country" placeholder="Search countries">
|
|
3057
|
+
<void-combobox-content>
|
|
3058
|
+
<void-option value="ca">Canada</void-option>
|
|
3059
|
+
<void-option value="fr" selected>France</void-option>
|
|
3060
|
+
<void-option value="jp" disabled>Japan</void-option>
|
|
3061
|
+
</void-combobox-content>
|
|
3062
|
+
</void-combobox>
|
|
3063
|
+
</void-field>
|
|
3064
|
+
```
|
|
3065
|
+
|
|
3066
|
+
## `<void-page>`
|
|
3067
|
+
|
|
3068
|
+
Content column of a page, inside <main>: centred, with a gutter, its blocks a group apart and its void-section children a section apart. Never write page padding or max-width by hand.
|
|
3069
|
+
|
|
3070
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
3071
|
+
|
|
3072
|
+
| Attribute | Values | Default | Description |
|
|
3073
|
+
|---|---|---|---|
|
|
3074
|
+
| `width` | `default\|narrow\|wide\|full` | `default` | narrow for forms and reading; wide and full for dense tables and dashboards |
|
|
3075
|
+
|
|
3076
|
+
Example:
|
|
3077
|
+
|
|
3078
|
+
```html
|
|
3079
|
+
<main>
|
|
3080
|
+
<void-page>
|
|
3081
|
+
<void-page-head>
|
|
3082
|
+
<span data-void-type="label">Network / Stations</span>
|
|
3083
|
+
<h1>Stations</h1>
|
|
3084
|
+
<void-actions><void-button variant="filled">Add station</void-button></void-actions>
|
|
3085
|
+
</void-page-head>
|
|
3086
|
+
<void-section>
|
|
3087
|
+
<void-section-head><h2>Online</h2></void-section-head>
|
|
3088
|
+
<p>Section content.</p>
|
|
3089
|
+
</void-section>
|
|
3090
|
+
<void-section>
|
|
3091
|
+
<void-section-head><h2>Offline</h2></void-section-head>
|
|
3092
|
+
<p>Section content.</p>
|
|
3093
|
+
</void-section>
|
|
3094
|
+
</void-page>
|
|
3095
|
+
</main>
|
|
3096
|
+
```
|
|
3097
|
+
|
|
3098
|
+
## `<void-page-head>`
|
|
3099
|
+
|
|
3100
|
+
Head of a page, first child of void-page: a label or void-breadcrumbs, an <h1>, an optional <p>, and void-actions. Text left, actions bottom right; a hairline under it.
|
|
3101
|
+
|
|
3102
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
3103
|
+
|
|
3104
|
+
| Attribute | Values | Default | Description |
|
|
3105
|
+
|---|---|---|---|
|
|
3106
|
+
| `flush` | `boolean` | | no hairline and no padding under the head |
|
|
3107
|
+
|
|
3108
|
+
Example:
|
|
3109
|
+
|
|
3110
|
+
```html
|
|
3111
|
+
<void-page-head>
|
|
3112
|
+
<span data-void-type="label">Network / Overview</span>
|
|
3113
|
+
<h1>Ground network</h1>
|
|
3114
|
+
<p>Every station, pass and link in one place.</p>
|
|
3115
|
+
<void-actions>
|
|
3116
|
+
<void-button variant="ghost">Export</void-button>
|
|
3117
|
+
<void-button>Schedule pass</void-button>
|
|
3118
|
+
<void-button variant="filled">Add station</void-button>
|
|
3119
|
+
</void-actions>
|
|
3120
|
+
</void-page-head>
|
|
3121
|
+
```
|
|
3122
|
+
|
|
3123
|
+
## `<void-pagination>`
|
|
3124
|
+
|
|
3125
|
+
Page navigation for data tables, search result lists, and content archives.
|
|
3126
|
+
|
|
3127
|
+
| Attribute | Values | Default | Description |
|
|
3128
|
+
|---|---|---|---|
|
|
3129
|
+
| `total` | `number` | `1` | Number of pages. Defaults to 1. |
|
|
3130
|
+
| `value` | `number` | `1` | Current page, 1-based. Choosing a page fires a cancelable `void-change` and then updates `value`; cancel the event to keep the page unchanged. |
|
|
3131
|
+
| `siblings` | `number` | `1` | Page buttons shown on each side of the current page before the list collapses to ellipses. Defaults to 1. |
|
|
3132
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
3133
|
+
| `href-template` | `string` | | Opt-in link mode: URL with a `{page}` placeholder, e.g. `/posts?page={page}`. |
|
|
3134
|
+
| `param` | `string` | | Opt-in link mode: query parameter rewritten on the current location, e.g. `page`. Ignored when `href-template` is set. |
|
|
3135
|
+
|
|
3136
|
+
| Event | `detail` | Description |
|
|
3137
|
+
|---|---|---|
|
|
3138
|
+
| `void-change` | `{ value: number }` | |
|
|
3139
|
+
|
|
3140
|
+
Example:
|
|
3141
|
+
|
|
3142
|
+
```html
|
|
3143
|
+
<void-pagination total="12" value="4"></void-pagination>
|
|
3144
|
+
```
|
|
3145
|
+
|
|
3146
|
+
## `<void-panel>`
|
|
3147
|
+
|
|
3148
|
+
Bordered or elevated content region for grouping related settings, dashboard sections, and detail blocks.
|
|
3149
|
+
|
|
3150
|
+
Its regions are parts, in this order: an optional `<void-panel-header>` (holding a `<void-panel-title>` and an
|
|
3151
|
+
optional `<void-panel-description>`) and the `<void-panel-body>`. The parts are CSS-only and never moved. The panel
|
|
3152
|
+
is a `region` named by its title part; without a title it is unnamed unless the author gives it an `aria-label`.
|
|
3153
|
+
|
|
3154
|
+
Parts (only these parts as children, in this order):
|
|
3155
|
+
|
|
3156
|
+
| Part | | Description |
|
|
3157
|
+
|---|---|---|
|
|
3158
|
+
| `<void-panel-header>` | one, CSS-only | Top of the panel: the title, an optional description, and anything at the far end. |
|
|
3159
|
+
|  `<void-panel-title>` | one, CSS-only | Title of the panel; it names the region. |
|
|
3160
|
+
|  `<void-panel-description>` | one, CSS-only | One line under the title. |
|
|
3161
|
+
| `<void-panel-body>` | required, one, CSS-only | Content of the panel. |
|
|
3162
|
+
|
|
3163
|
+
Markup: `<void-panel variant="bordered"><void-panel-header><void-panel-title>Billing</void-panel-title><void-panel-description>One line.</void-panel-description></void-panel-header><void-panel-body>...</void-panel-body></void-panel>`
|
|
3164
|
+
|
|
3165
|
+
| Attribute | Values | Default | Description |
|
|
3166
|
+
|---|---|---|---|
|
|
3167
|
+
| `variant` | `default\|bordered\|elevated` | `default` | `default` is a quiet filled region, `bordered` draws a visible border, `elevated` lifts it with a shadow. |
|
|
3168
|
+
|
|
3169
|
+
Attributes that do not exist (and what to write instead):
|
|
3170
|
+
|
|
3171
|
+
- `label`: write <void-panel-header><void-panel-title>...</void-panel-title></void-panel-header> as the first child; the title names the panel
|
|
3172
|
+
|
|
3173
|
+
Example:
|
|
3174
|
+
|
|
3175
|
+
```html
|
|
3176
|
+
<void-panel variant="bordered">
|
|
3177
|
+
<void-panel-header>
|
|
3178
|
+
<void-panel-title>Billing</void-panel-title>
|
|
3179
|
+
</void-panel-header>
|
|
3180
|
+
<void-panel-body>
|
|
3181
|
+
<p>Next invoice on 1 April, $240.</p>
|
|
3182
|
+
</void-panel-body>
|
|
3183
|
+
</void-panel>
|
|
3184
|
+
```
|
|
3185
|
+
|
|
3186
|
+
## `<void-panel-body>`
|
|
3187
|
+
|
|
3188
|
+
Content of the panel.
|
|
3189
|
+
|
|
3190
|
+
CSS-only part of `<void-panel>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
3191
|
+
|
|
3192
|
+
Allowed inside: `<void-panel>`.
|
|
3193
|
+
|
|
3194
|
+
Example:
|
|
3195
|
+
|
|
3196
|
+
```html
|
|
3197
|
+
<void-panel variant="bordered">
|
|
3198
|
+
<void-panel-header>
|
|
3199
|
+
<void-panel-title>Billing</void-panel-title>
|
|
3200
|
+
</void-panel-header>
|
|
3201
|
+
<void-panel-body>
|
|
3202
|
+
<p>Next invoice on 1 April, $240.</p>
|
|
3203
|
+
</void-panel-body>
|
|
3204
|
+
</void-panel>
|
|
3205
|
+
```
|
|
3206
|
+
|
|
3207
|
+
## `<void-panel-description>`
|
|
3208
|
+
|
|
3209
|
+
One line under the title.
|
|
3210
|
+
|
|
3211
|
+
CSS-only part of `<void-panel-header>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
3212
|
+
|
|
3213
|
+
Allowed inside: `<void-panel-header>`.
|
|
3214
|
+
|
|
3215
|
+
Example:
|
|
3216
|
+
|
|
3217
|
+
```html
|
|
3218
|
+
<void-panel variant="bordered">
|
|
3219
|
+
<void-panel-header>
|
|
3220
|
+
<void-panel-title>Billing</void-panel-title>
|
|
3221
|
+
</void-panel-header>
|
|
3222
|
+
<void-panel-body>
|
|
3223
|
+
<p>Next invoice on 1 April, $240.</p>
|
|
3224
|
+
</void-panel-body>
|
|
3225
|
+
</void-panel>
|
|
3226
|
+
```
|
|
3227
|
+
|
|
3228
|
+
## `<void-panel-header>`
|
|
3229
|
+
|
|
3230
|
+
Top of the panel: the title, an optional description, and anything at the far end.
|
|
3231
|
+
|
|
3232
|
+
CSS-only part of `<void-panel>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
3233
|
+
|
|
3234
|
+
Parts (parts mixed with other content):
|
|
3235
|
+
|
|
3236
|
+
| Part | | Description |
|
|
3237
|
+
|---|---|---|
|
|
3238
|
+
| `<void-panel-title>` | one, CSS-only | Title of the panel; it names the region. |
|
|
3239
|
+
| `<void-panel-description>` | one, CSS-only | One line under the title. |
|
|
3240
|
+
|
|
3241
|
+
Allowed inside: `<void-panel>`.
|
|
3242
|
+
|
|
3243
|
+
Example:
|
|
3244
|
+
|
|
3245
|
+
```html
|
|
3246
|
+
<void-panel variant="bordered">
|
|
3247
|
+
<void-panel-header>
|
|
3248
|
+
<void-panel-title>Billing</void-panel-title>
|
|
3249
|
+
</void-panel-header>
|
|
3250
|
+
<void-panel-body>
|
|
3251
|
+
<p>Next invoice on 1 April, $240.</p>
|
|
3252
|
+
</void-panel-body>
|
|
3253
|
+
</void-panel>
|
|
3254
|
+
```
|
|
3255
|
+
|
|
3256
|
+
## `<void-panel-title>`
|
|
3257
|
+
|
|
3258
|
+
Title of the panel; it names the region.
|
|
3259
|
+
|
|
3260
|
+
CSS-only part of `<void-panel-header>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
3261
|
+
|
|
3262
|
+
Allowed inside: `<void-panel-header>`.
|
|
3263
|
+
|
|
3264
|
+
Example:
|
|
3265
|
+
|
|
3266
|
+
```html
|
|
3267
|
+
<void-panel variant="bordered">
|
|
3268
|
+
<void-panel-header>
|
|
3269
|
+
<void-panel-title>Billing</void-panel-title>
|
|
3270
|
+
</void-panel-header>
|
|
3271
|
+
<void-panel-body>
|
|
3272
|
+
<p>Next invoice on 1 April, $240.</p>
|
|
3273
|
+
</void-panel-body>
|
|
3274
|
+
</void-panel>
|
|
3275
|
+
```
|
|
3276
|
+
|
|
3277
|
+
## `<void-pin-input>`
|
|
3278
|
+
|
|
3279
|
+
Single-character input cells for OTP verification codes, PIN entry, and multi-digit confirmation fields.
|
|
3280
|
+
|
|
3281
|
+
| Attribute | Values | Default | Description |
|
|
3282
|
+
|---|---|---|---|
|
|
3283
|
+
| `length` | `number` | `6` | Number of cells, so the number of characters in the code. Defaults to 6. |
|
|
3284
|
+
| `groups` | `string` | | Visual grouping of the cells as comma-separated sizes, such as `3,3` for a code drawn as `123 456`. Display only; the value has no separator. |
|
|
3285
|
+
| `value` | `string` | | The characters entered so far, without separators, reflected to the `value` attribute as they change; the form's reset target stays the value the cells started with. A `mask`ed input does not reflect: its attribute is only ever the initial value. |
|
|
3286
|
+
| `disabled` | `boolean` | `false` | Stop the cells accepting input and exclude the value from the form submission. |
|
|
3287
|
+
| `mask` | `boolean` | `false` | Hide the entered characters as dots, like a password field. Use it for a PIN, not for a one-time code. |
|
|
3288
|
+
| `type` | `numeric\|alphanumeric` | `numeric` | Which characters the cells accept: `numeric` (default, digits only) or `alphanumeric`. |
|
|
3289
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
3290
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the cells: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. Use `error` after a wrong code. |
|
|
3291
|
+
| `placeholder` | `string` | | Character shown in every empty cell, such as `-`. |
|
|
3292
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
3293
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
3294
|
+
|
|
3295
|
+
| Event | `detail` | Description |
|
|
3296
|
+
|---|---|---|
|
|
3297
|
+
| `void-input` | `{ value: string }` | A character was typed, pasted or deleted. |
|
|
3298
|
+
| `void-complete` | `{ value: string }` | Every cell is filled. |
|
|
3299
|
+
| `void-change` | `{ value: string }` | Focus left the cells with a different value from when it came in (the commit, as a native field's `change`). |
|
|
3300
|
+
|
|
3301
|
+
Example:
|
|
3302
|
+
|
|
3303
|
+
```html
|
|
3304
|
+
<void-field label="Verification code">
|
|
3305
|
+
<void-pin-input name="code" length="6" groups="3,3"></void-pin-input>
|
|
3306
|
+
</void-field>
|
|
3307
|
+
```
|
|
3308
|
+
|
|
3309
|
+
## `<void-popover>`
|
|
3310
|
+
|
|
3311
|
+
Anchored overlay for contextual detail and mini-forms that need more room than a tooltip.
|
|
3312
|
+
|
|
3313
|
+
Two parts: `<void-popover-trigger>` around the control that toggles it (one element: a `<void-button>`, a
|
|
3314
|
+
`<button>`), and `<void-popover-content>`, the panel. The parts are the final DOM; the popover only adds
|
|
3315
|
+
behaviour. The content is a non-modal dialog shown in the top layer (the Popover API), so no `overflow` or
|
|
3316
|
+
`transform` of an ancestor clips it, placed next to the trigger with CSS anchor positioning (flipping at
|
|
3317
|
+
viewport edges; a JavaScript positioner where anchor positioning is missing). Opening it from the trigger moves
|
|
3318
|
+
focus to its first focusable element; Escape, a press outside it, or focus leaving it closes it and focus
|
|
3319
|
+
returns to the trigger. The trigger's control gets `aria-haspopup="dialog"`, `aria-expanded` and
|
|
3320
|
+
`aria-controls`, and names the content.
|
|
3321
|
+
|
|
3322
|
+
Parts (only these parts as children, in this order):
|
|
3323
|
+
|
|
3324
|
+
| Part | | Description |
|
|
3325
|
+
|---|---|---|
|
|
3326
|
+
| `<void-popover-trigger>` | required, one, wraps one control, CSS-only | Wraps the one element that toggles the popover (a <void-button>, a <button>, a link); that element gets the ARIA. |
|
|
3327
|
+
| `<void-popover-content>` | required, one, CSS-only | Shown in the top layer next to the trigger. |
|
|
3328
|
+
|
|
3329
|
+
Markup: `<void-popover><void-popover-trigger><void-button>Details</void-button></void-popover-trigger><void-popover-content>...</void-popover-content></void-popover>`
|
|
3330
|
+
|
|
3331
|
+
| Attribute | Values | Default | Description |
|
|
3332
|
+
|---|---|---|---|
|
|
3333
|
+
| `open` | `boolean` | `false` | Whether the popover is open. |
|
|
3334
|
+
| `side` | `top\|bottom\|left\|right` | `bottom` | Side of the trigger it opens on; it flips to the opposite side when there is no room. |
|
|
3335
|
+
| `align` | `start\|center\|end` | `start` | Alignment with the trigger along that side. |
|
|
3336
|
+
| `trigger` | `click\|manual` | `click` | `click` toggles on trigger clicks; `manual` leaves opening to the `open` attribute or property. |
|
|
3337
|
+
|
|
3338
|
+
| Event | `detail` | Description |
|
|
3339
|
+
|---|---|---|
|
|
3340
|
+
| `void-open` | `{ reason: 'trigger' \| 'api' }` | The popover opened. |
|
|
3341
|
+
| `void-close` | `{ reason: 'trigger' \| 'escape' \| 'outside' \| 'blur' \| 'parent' \| 'api' }` | The popover is closing. Cancelable when the user caused it (every reason but `parent` and `api`). |
|
|
3342
|
+
|
|
3343
|
+
Example:
|
|
3344
|
+
|
|
3345
|
+
```html
|
|
3346
|
+
<void-popover side="bottom" align="start">
|
|
3347
|
+
<void-popover-trigger><void-button>Details</void-button></void-popover-trigger>
|
|
3348
|
+
<void-popover-content>
|
|
3349
|
+
<p>Anchored content.</p>
|
|
3350
|
+
</void-popover-content>
|
|
3351
|
+
</void-popover>
|
|
3352
|
+
```
|
|
3353
|
+
|
|
3354
|
+
## `<void-popover-content>`
|
|
3355
|
+
|
|
3356
|
+
Shown in the top layer next to the trigger.
|
|
3357
|
+
|
|
3358
|
+
CSS-only part of `<void-popover>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
3359
|
+
|
|
3360
|
+
Allowed inside: `<void-popover>`.
|
|
3361
|
+
|
|
3362
|
+
Example:
|
|
3363
|
+
|
|
3364
|
+
```html
|
|
3365
|
+
<void-popover side="bottom" align="start">
|
|
3366
|
+
<void-popover-trigger><void-button>Details</void-button></void-popover-trigger>
|
|
3367
|
+
<void-popover-content>
|
|
3368
|
+
<p>Anchored content.</p>
|
|
3369
|
+
</void-popover-content>
|
|
3370
|
+
</void-popover>
|
|
3371
|
+
```
|
|
3372
|
+
|
|
3373
|
+
## `<void-popover-trigger>`
|
|
3374
|
+
|
|
3375
|
+
Wraps the one element that toggles the popover (a <void-button>, a <button>, a link); that element gets the ARIA.
|
|
3376
|
+
|
|
3377
|
+
CSS-only part of `<void-popover>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
3378
|
+
|
|
3379
|
+
Allowed inside: `<void-popover>`.
|
|
3380
|
+
|
|
3381
|
+
Example:
|
|
3382
|
+
|
|
3383
|
+
```html
|
|
3384
|
+
<void-popover side="bottom" align="start">
|
|
3385
|
+
<void-popover-trigger><void-button>Details</void-button></void-popover-trigger>
|
|
3386
|
+
<void-popover-content>
|
|
3387
|
+
<p>Anchored content.</p>
|
|
3388
|
+
</void-popover-content>
|
|
3389
|
+
</void-popover>
|
|
3390
|
+
```
|
|
3391
|
+
|
|
3392
|
+
## `<void-progress>`
|
|
3393
|
+
|
|
3394
|
+
Visual progress indicator for file uploads, multi-step processes, and loading states.
|
|
3395
|
+
|
|
3396
|
+
| Attribute | Values | Default | Description |
|
|
3397
|
+
|---|---|---|---|
|
|
3398
|
+
| `value` | `number` | `0` | Current progress, from 0 to `max`. Ignored while `indeterminate`. |
|
|
3399
|
+
| `max` | `number` | `100` | Value that means complete. Defaults to 100. |
|
|
3400
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the bar: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
3401
|
+
| `size` | `sm\|md\|lg` | `md` | Thickness step of the bar: `sm`, `md` (default) or `lg`. |
|
|
3402
|
+
| `indeterminate` | `boolean` | `false` | Show an animated bar for work of unknown length. It has no `aria-valuenow` while on. |
|
|
3403
|
+
|
|
3404
|
+
Example:
|
|
3405
|
+
|
|
3406
|
+
```html
|
|
3407
|
+
<void-progress value="64" color="success" aria-label="Upload progress"></void-progress>
|
|
3408
|
+
```
|
|
3409
|
+
|
|
3410
|
+
## `<void-radio>`
|
|
3411
|
+
|
|
3412
|
+
Single mutually exclusive option for forms and surveys; typically used inside VoidRadioGroup.
|
|
3413
|
+
|
|
3414
|
+
| Attribute | Values | Default | Description |
|
|
3415
|
+
|---|---|---|---|
|
|
3416
|
+
| `checked` | `boolean` | `false` | Whether this radio is the selected one. Checking one radio unchecks the others with the same `name`. |
|
|
3417
|
+
| `disabled` | `boolean` | `false` | Stop the radio reacting and exclude it from the form submission. Also disabled by a `<fieldset disabled>` or a disabled `void-radio-group` around it. |
|
|
3418
|
+
| `name` | `string` | | Group name: radios sharing a name in the same form are mutually exclusive, and it is the key the chosen value is submitted under. Within a `void-radio-group` the group's `name` is used. |
|
|
3419
|
+
| `value` | `string` | `on` | Submitted under `name` while checked; defaults to "on" like a native radio. |
|
|
3420
|
+
| `required` | `boolean` | `false` | One radio with this name must be checked. Forwarded to the native radio, which the browser validates as a group; focus moves to the host. |
|
|
3421
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the selected radio: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
3422
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
3423
|
+
| `form` | `string \| null` | | `id` of a `<form>` elsewhere in the page that this control belongs to, as on a native control. Without it the control belongs to the form it sits inside. |
|
|
3424
|
+
|
|
3425
|
+
| Event | `detail` | Description |
|
|
3426
|
+
|---|---|---|
|
|
3427
|
+
| `void-change` | `{ value: string; checked: boolean }` | |
|
|
3428
|
+
|
|
3429
|
+
Example:
|
|
3430
|
+
|
|
3431
|
+
```html
|
|
3432
|
+
<void-radio-group label="Plan" name="plan" value="pro">
|
|
3433
|
+
<void-radio value="free">Free</void-radio>
|
|
3434
|
+
<void-radio value="pro">Pro</void-radio>
|
|
3435
|
+
</void-radio-group>
|
|
3436
|
+
```
|
|
3437
|
+
|
|
3438
|
+
## `<void-radio-group>`
|
|
3439
|
+
|
|
3440
|
+
Mutually exclusive option group for plan pickers, survey questions, and preference settings.
|
|
3441
|
+
|
|
3442
|
+
Form strategy: pass-through. `name` is forwarded to the child void-radio
|
|
3443
|
+
elements, whose native radios submit; the group itself submits nothing.
|
|
3444
|
+
|
|
3445
|
+
| Attribute | Values | Default | Description |
|
|
3446
|
+
|---|---|---|---|
|
|
3447
|
+
| `label` | `string` | | Name of the group, shown above the radios and used as its accessible name. |
|
|
3448
|
+
| `value` | `string` | | `value` of the selected radio. Set it to choose one; it follows the user's choice and is reflected to the attribute. The form's reset target stays the initial selection. |
|
|
3449
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
3450
|
+
| `required` | `boolean` | `false` | Forwarded to the child radios: the browser then requires one of them to be checked. |
|
|
3451
|
+
| `disabled` | `boolean` | `false` | Disables every radio in the group (like a fieldset). |
|
|
3452
|
+
| `orientation` | `vertical\|horizontal` | `vertical` | Lay the radios out in a `vertical` column (default) or a `horizontal` row. |
|
|
3453
|
+
| `form` | `string \| null` | | `id` of a `<form>` elsewhere in the page that this control belongs to, as on a native control. Without it the control belongs to the form it sits inside. |
|
|
3454
|
+
|
|
3455
|
+
| Event | `detail` | Description |
|
|
3456
|
+
|---|---|---|
|
|
3457
|
+
| `void-change` | `{ value: string }` | |
|
|
3458
|
+
|
|
3459
|
+
Example:
|
|
3460
|
+
|
|
3461
|
+
```html
|
|
3462
|
+
<void-radio-group label="Plan" name="plan" value="pro" orientation="horizontal">
|
|
3463
|
+
<void-radio value="free">Free</void-radio>
|
|
3464
|
+
<void-radio value="pro">Pro</void-radio>
|
|
3465
|
+
<void-radio value="team">Team</void-radio>
|
|
3466
|
+
</void-radio-group>
|
|
3467
|
+
```
|
|
3468
|
+
|
|
3469
|
+
## `<void-row>`
|
|
3470
|
+
|
|
3471
|
+
One row of void-rows: a void-row-text on the left, a value or one control on the right.
|
|
3472
|
+
|
|
3473
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
3474
|
+
|
|
3475
|
+
Allowed inside: `<void-rows>`.
|
|
3476
|
+
|
|
3477
|
+
Example:
|
|
3478
|
+
|
|
3479
|
+
```html
|
|
3480
|
+
<void-rows>
|
|
3481
|
+
<void-row>
|
|
3482
|
+
<void-row-text>
|
|
3483
|
+
<span>Backup link engaged</span>
|
|
3484
|
+
<span data-void-type="caption">Tromsø 2 · 12 min ago</span>
|
|
3485
|
+
</void-row-text>
|
|
3486
|
+
<void-badge color="warning" variant="outline">Degraded</void-badge>
|
|
3487
|
+
</void-row>
|
|
3488
|
+
</void-rows>
|
|
3489
|
+
```
|
|
3490
|
+
|
|
3491
|
+
## `<void-row-text>`
|
|
3492
|
+
|
|
3493
|
+
Two lines of text: a main line and a data-void-type="caption" line. In a void-row or a table cell.
|
|
3494
|
+
|
|
3495
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
3496
|
+
|
|
3497
|
+
Example:
|
|
3498
|
+
|
|
3499
|
+
```html
|
|
3500
|
+
<void-row-text>
|
|
3501
|
+
<span>Svalbard 1</span>
|
|
3502
|
+
<span data-void-type="caption">78.23° N, 15.39° E</span>
|
|
3503
|
+
</void-row-text>
|
|
3504
|
+
```
|
|
3505
|
+
|
|
3506
|
+
## `<void-rows>`
|
|
3507
|
+
|
|
3508
|
+
List of void-row children with a hairline between them: settings, events, anything that is one thing per line and not tabular.
|
|
3509
|
+
|
|
3510
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
3511
|
+
|
|
3512
|
+
Example:
|
|
3513
|
+
|
|
3514
|
+
```html
|
|
3515
|
+
<void-rows>
|
|
3516
|
+
<void-row>
|
|
3517
|
+
<void-row-text>
|
|
3518
|
+
<span>Station goes offline</span>
|
|
3519
|
+
<span data-void-type="caption">Sent immediately, at any hour.</span>
|
|
3520
|
+
</void-row-text>
|
|
3521
|
+
<void-switch checked aria-label="Station goes offline"></void-switch>
|
|
3522
|
+
</void-row>
|
|
3523
|
+
<void-row>
|
|
3524
|
+
<void-row-text>
|
|
3525
|
+
<span>Weekly summary</span>
|
|
3526
|
+
<span data-void-type="caption">Mondays at 08:00.</span>
|
|
3527
|
+
</void-row-text>
|
|
3528
|
+
<void-switch aria-label="Weekly summary"></void-switch>
|
|
3529
|
+
</void-row>
|
|
3530
|
+
</void-rows>
|
|
3531
|
+
```
|
|
3532
|
+
|
|
3533
|
+
## `<void-scroll-area>`
|
|
3534
|
+
|
|
3535
|
+
Scrollable container with styled scrollbars for long content areas, code blocks, and chat histories.
|
|
3536
|
+
|
|
3537
|
+
| Attribute | Values | Default | Description |
|
|
3538
|
+
|---|---|---|---|
|
|
3539
|
+
| `max-height` | `string` | | CSS length (for example `20rem` or `50vh`) at which the area stops growing and scrolls. Without it the area is as tall as its content and does not scroll vertically. |
|
|
3540
|
+
| `orientation` | `vertical\|horizontal\|both` | `vertical` | Which way the content scrolls: `vertical` (default), `horizontal` or `both`. |
|
|
3541
|
+
|
|
3542
|
+
Example:
|
|
3543
|
+
|
|
3544
|
+
```html
|
|
3545
|
+
<void-scroll-area max-height="8rem">
|
|
3546
|
+
<p>Mission log, entry 1: the antenna array finished its calibration pass.</p>
|
|
3547
|
+
<p>Mission log, entry 2: telemetry from the southern station arrived intact.</p>
|
|
3548
|
+
<p>Mission log, entry 3: a scheduled pass over the polar region was moved by four minutes.</p>
|
|
3549
|
+
<p>Mission log, entry 4: the ground link held through the storm.</p>
|
|
3550
|
+
<p>Mission log, entry 5: the archive was rotated and verified.</p>
|
|
3551
|
+
</void-scroll-area>
|
|
3552
|
+
```
|
|
3553
|
+
|
|
3554
|
+
## `<void-section>`
|
|
3555
|
+
|
|
3556
|
+
Titled part of a page: a void-section-head (or a bare <h2>), then content. No box and no shadow.
|
|
3557
|
+
|
|
3558
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
3559
|
+
|
|
3560
|
+
| Attribute | Values | Default | Description |
|
|
3561
|
+
|---|---|---|---|
|
|
3562
|
+
| `divided` | `boolean` | | hairline under the head, for content with no line of its own (a form, a paragraph, a chart) |
|
|
3563
|
+
| `gap` | `inside\|stack\|group` | `inside` | space between the blocks in the section; stack for the fields of a form |
|
|
3564
|
+
|
|
3565
|
+
Example:
|
|
3566
|
+
|
|
3567
|
+
```html
|
|
3568
|
+
<void-section>
|
|
3569
|
+
<void-section-head>
|
|
3570
|
+
<h2>Upcoming passes</h2>
|
|
3571
|
+
<span data-void-type="label">Next 6 hours</span>
|
|
3572
|
+
</void-section-head>
|
|
3573
|
+
<void-table>
|
|
3574
|
+
<table>
|
|
3575
|
+
<thead><tr><th>Satellite</th><th data-numeric>Starts in</th></tr></thead>
|
|
3576
|
+
<tbody><tr><td>MRD-0412</td><td data-numeric>14 min</td></tr></tbody>
|
|
3577
|
+
</table>
|
|
3578
|
+
</void-table>
|
|
3579
|
+
</void-section>
|
|
3580
|
+
```
|
|
3581
|
+
|
|
3582
|
+
## `<void-section-head>`
|
|
3583
|
+
|
|
3584
|
+
Head of a void-section: an <h2> (or h3/h4), an optional <p>, and an optional aside (a data-void-type="label" span, a badge, or void-actions) that sits at the far end.
|
|
3585
|
+
|
|
3586
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
3587
|
+
|
|
3588
|
+
Example:
|
|
3589
|
+
|
|
3590
|
+
```html
|
|
3591
|
+
<void-section-head>
|
|
3592
|
+
<h2>API tokens</h2>
|
|
3593
|
+
<p>Tokens act as you. Revoke one you no longer use.</p>
|
|
3594
|
+
<void-actions><void-button size="sm">Create token</void-button></void-actions>
|
|
3595
|
+
</void-section-head>
|
|
3596
|
+
```
|
|
3597
|
+
|
|
3598
|
+
## `<void-segmented-control>`
|
|
3599
|
+
|
|
3600
|
+
Mutually exclusive button group for view mode toggles, time range selectors, and compact tab-like navigation.
|
|
3601
|
+
|
|
3602
|
+
Follows the WAI-ARIA radio group pattern: `role="radiogroup"` with `role="radio"` items, a single tab
|
|
3603
|
+
stop (roving tabindex: the checked item, or the first enabled one when nothing is checked), and
|
|
3604
|
+
selection that follows focus. Keyboard: Tab and Shift+Tab enter and leave the group; ArrowRight and
|
|
3605
|
+
ArrowDown select the next item, ArrowLeft and ArrowUp the previous one (wrapping, skipping disabled
|
|
3606
|
+
items; with nothing selected, the first or the last); Space selects the focused item.
|
|
3607
|
+
|
|
3608
|
+
| Attribute | Values | Default | Description |
|
|
3609
|
+
|---|---|---|---|
|
|
3610
|
+
| `value` | `string` | | `value` of the selected item. Selection follows focus, so each arrow key changes it and fires `void-change`. Reflected to the attribute as it changes; the form's reset target stays the value it started with. |
|
|
3611
|
+
| `disabled` | `boolean` | `false` | Stop the whole control reacting and exclude the value from the form submission. |
|
|
3612
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
3613
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the selected segment: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
3614
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
3615
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
3616
|
+
|
|
3617
|
+
| Event | `detail` | Description |
|
|
3618
|
+
|---|---|---|
|
|
3619
|
+
| `void-change` | `{ value: string }` | |
|
|
3620
|
+
|
|
3621
|
+
Needs at least one: `<void-segmented-control-item>`.
|
|
3622
|
+
|
|
3623
|
+
Example:
|
|
3624
|
+
|
|
3625
|
+
```html
|
|
3626
|
+
<void-segmented-control aria-label="Range" value="week">
|
|
3627
|
+
<void-segmented-control-item value="day">Day</void-segmented-control-item>
|
|
3628
|
+
<void-segmented-control-item value="week">Week</void-segmented-control-item>
|
|
3629
|
+
<void-segmented-control-item value="month">Month</void-segmented-control-item>
|
|
3630
|
+
</void-segmented-control>
|
|
3631
|
+
```
|
|
3632
|
+
|
|
3633
|
+
## `<void-segmented-control-item>`
|
|
3634
|
+
|
|
3635
|
+
Individual option within a VoidSegmentedControl button group.
|
|
3636
|
+
|
|
3637
|
+
| Attribute | Values | Default | Description |
|
|
3638
|
+
|---|---|---|---|
|
|
3639
|
+
| `value` | `string` | | What the parent reports and submits when this segment is selected. Must be unique within the control. |
|
|
3640
|
+
| `disabled` | `boolean` | `false` | Show the segment but skip it in keyboard navigation and refuse selection. |
|
|
3641
|
+
|
|
3642
|
+
Allowed inside: `<void-segmented-control>`.
|
|
3643
|
+
|
|
3644
|
+
Example:
|
|
3645
|
+
|
|
3646
|
+
```html
|
|
3647
|
+
<void-segmented-control aria-label="Range" value="week">
|
|
3648
|
+
<void-segmented-control-item value="day">Day</void-segmented-control-item>
|
|
3649
|
+
<void-segmented-control-item value="week">Week</void-segmented-control-item>
|
|
3650
|
+
<void-segmented-control-item value="month" disabled>Month</void-segmented-control-item>
|
|
3651
|
+
</void-segmented-control>
|
|
3652
|
+
```
|
|
3653
|
+
|
|
3654
|
+
## `<void-select>`
|
|
3655
|
+
|
|
3656
|
+
Native dropdown for small option sets in forms where a simple pick-one is sufficient.
|
|
3657
|
+
|
|
3658
|
+
Wraps the author's own native `<select>` and enhances it in place: `<void-select><select name="plan"><option
|
|
3659
|
+
value="free">Free</option></select></void-select>`. The select, its options and its form attributes (`name`,
|
|
3660
|
+
`required`, `disabled`, `multiple`, `autocomplete`, `form`) are plain HTML and the final DOM, so the control
|
|
3661
|
+
submits, validates, resets and autofills as a native select does, before and after the script loads. The
|
|
3662
|
+
component styles it (`size`, `error`), names it from the host's `aria-label` or a `void-field` label, exposes
|
|
3663
|
+
`value` and `void-change`, and keeps the user's choice through server morphs the server did not change it in.
|
|
3664
|
+
A prompt is a first option with an empty value: `<option value="" disabled selected hidden>Choose a
|
|
3665
|
+
plan</option>`.
|
|
3666
|
+
|
|
3667
|
+
| Attribute | Values | Default | Description |
|
|
3668
|
+
|---|---|---|---|
|
|
3669
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
3670
|
+
| `error` | `string` | | Mark the select invalid: it gets the error styling, `aria-invalid` and the message under it. Inside a `void-field`, set `error` on the field instead, which shows the message. |
|
|
3671
|
+
| `value` | `string` | | `value` of the chosen option (the native select's value), reflected to the attribute as the choice changes. Written in markup it is the initial choice, applied once an option with that value exists (and what a form reset returns to); without it the options' own `selected` decide, as in plain HTML. |
|
|
3672
|
+
|
|
3673
|
+
| Event | `detail` | Description |
|
|
3674
|
+
|---|---|---|
|
|
3675
|
+
| `void-change` | `{ value: string }` | The user chose an option. |
|
|
3676
|
+
|
|
3677
|
+
Attributes that do not exist (and what to write instead):
|
|
3678
|
+
|
|
3679
|
+
- `label`: wrap the control in <void-field label="...">
|
|
3680
|
+
- `name`: put name on the native <select> inside: <void-select><select name="...">...</select></void-select>
|
|
3681
|
+
- `required`: put required on the native <select> inside: <void-select><select name="..." required>...</select></void-select>
|
|
3682
|
+
- `disabled`: put disabled on the native <select> inside: <void-select><select name="..." disabled>...</select></void-select>
|
|
3683
|
+
- `multiple`: put multiple on the native <select> inside, or use <void-multiselect>
|
|
3684
|
+
- `autocomplete`: put autocomplete on the native <select> inside
|
|
3685
|
+
- `placeholder`: write the prompt as the first option of the native <select>: <option value="" disabled selected hidden>Choose...</option>
|
|
3686
|
+
|
|
3687
|
+
Example:
|
|
3688
|
+
|
|
3689
|
+
```html
|
|
3690
|
+
<void-field label="Plan">
|
|
3691
|
+
<void-select>
|
|
3692
|
+
<select name="plan">
|
|
3693
|
+
<option value="" disabled selected hidden>Choose a plan</option>
|
|
3694
|
+
<option value="free">Free</option>
|
|
3695
|
+
<option value="pro">Pro</option>
|
|
3696
|
+
</select>
|
|
3697
|
+
</void-select>
|
|
3698
|
+
</void-field>
|
|
3699
|
+
```
|
|
3700
|
+
|
|
3701
|
+
## `<void-shell>`
|
|
3702
|
+
|
|
3703
|
+
Frame of an application: a void-nav-bar or void-sidebar, then <main>. The first thing in <body>.
|
|
3704
|
+
|
|
3705
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
3706
|
+
|
|
3707
|
+
| Attribute | Values | Default | Description |
|
|
3708
|
+
|---|---|---|---|
|
|
3709
|
+
| `nav` | `top\|side\|overlay` | `top` | top: bar above the page. side: void-sidebar beside it (a bar across the top below 48rem). overlay: bar laid over the top of the page, for a page that opens on a void-media |
|
|
3710
|
+
|
|
3711
|
+
Example:
|
|
3712
|
+
|
|
3713
|
+
```html
|
|
3714
|
+
<void-shell>
|
|
3715
|
+
<void-nav-bar>
|
|
3716
|
+
<void-brand><a href="/">Meridian</a></void-brand>
|
|
3717
|
+
<void-nav-links>
|
|
3718
|
+
<a href="/" aria-current="page">Overview</a>
|
|
3719
|
+
<a href="/stations">Stations</a>
|
|
3720
|
+
<a href="/settings">Settings</a>
|
|
3721
|
+
</void-nav-links>
|
|
3722
|
+
<void-spacer></void-spacer>
|
|
3723
|
+
<void-avatar initials="RK" size="sm"></void-avatar>
|
|
3724
|
+
</void-nav-bar>
|
|
3725
|
+
<main>
|
|
3726
|
+
<void-page>
|
|
3727
|
+
<void-page-head>
|
|
3728
|
+
<span data-void-type="label">Network</span>
|
|
3729
|
+
<h1>Ground network</h1>
|
|
3730
|
+
</void-page-head>
|
|
3731
|
+
<void-section>
|
|
3732
|
+
<void-section-head><h2>Stations</h2></void-section-head>
|
|
3733
|
+
<p>Section content.</p>
|
|
3734
|
+
</void-section>
|
|
3735
|
+
</void-page>
|
|
3736
|
+
</main>
|
|
3737
|
+
</void-shell>
|
|
3738
|
+
```
|
|
3739
|
+
|
|
3740
|
+
## `<void-sidebar>`
|
|
3741
|
+
|
|
3742
|
+
Collapsible side navigation for app shells, admin panels, and documentation sites.
|
|
3743
|
+
|
|
3744
|
+
| Attribute | Values | Default | Description |
|
|
3745
|
+
|---|---|---|---|
|
|
3746
|
+
| `collapsed` | `boolean` | `false` | Show the narrow, collapsed width (a rail that stays on screen, not a closed panel). `toggle()` fires `void-collapse` or `void-expand`; the element has no built-in toggle button, so wire one (for example a `void-hamburger`) to this attribute. |
|
|
3747
|
+
| `width` | `string` | `var(--void-sidebar-width)` | CSS width when expanded. Defaults to the theme's `--void-sidebar-width`. |
|
|
3748
|
+
| `collapsed-width` | `string` | `var(--void-sidebar-collapsed-width)` | CSS width when collapsed. Defaults to the theme's `--void-sidebar-collapsed-width`. |
|
|
3749
|
+
| `side` | `left\|right` | `left` | Which edge of the page the sidebar sits on: `left` (default) or `right`. |
|
|
3750
|
+
|
|
3751
|
+
| Event | `detail` | Description |
|
|
3752
|
+
|---|---|---|
|
|
3753
|
+
| `void-collapse` | `{ reason: 'api' }` | `toggle()` collapsed it. Does not bubble. |
|
|
3754
|
+
| `void-expand` | `{ reason: 'api' }` | `toggle()` expanded it. Does not bubble. |
|
|
3755
|
+
|
|
3756
|
+
Example:
|
|
3757
|
+
|
|
3758
|
+
```html
|
|
3759
|
+
<void-sidebar>
|
|
3760
|
+
<void-nav-links>
|
|
3761
|
+
<a href="/overview" aria-current="page">Overview</a>
|
|
3762
|
+
<a href="/reports">Reports</a>
|
|
3763
|
+
<a href="/settings">Settings</a>
|
|
3764
|
+
</void-nav-links>
|
|
3765
|
+
</void-sidebar>
|
|
3766
|
+
```
|
|
3767
|
+
|
|
3768
|
+
## `<void-skeleton>`
|
|
3769
|
+
|
|
3770
|
+
Content placeholder during data loading for cards, lists, and profile pages to prevent layout shift.
|
|
3771
|
+
|
|
3772
|
+
| Attribute | Values | Default | Description |
|
|
3773
|
+
|---|---|---|---|
|
|
3774
|
+
| `shape` | `text\|circular\|rectangular` | `text` | Shape of the placeholder: `text` (one line of text, default), `circular` (for an avatar) or `rectangular` (for an image or card). Size it with CSS width and height. |
|
|
3775
|
+
|
|
3776
|
+
Example:
|
|
3777
|
+
|
|
3778
|
+
```html
|
|
3779
|
+
<void-skeleton shape="text"></void-skeleton>
|
|
3780
|
+
<void-skeleton shape="text"></void-skeleton>
|
|
3781
|
+
<void-skeleton shape="rectangular"></void-skeleton>
|
|
3782
|
+
```
|
|
3783
|
+
|
|
3784
|
+
## `<void-slider>`
|
|
3785
|
+
|
|
3786
|
+
Continuous value selection for volume controls, price range filters, and numeric range settings.
|
|
3787
|
+
The host has no role: the native range input is the slider (value, min and max included) and carries
|
|
3788
|
+
the accessible name, which `<void-field>` supplies.
|
|
3789
|
+
|
|
3790
|
+
| Attribute | Values | Default | Description |
|
|
3791
|
+
|---|---|---|---|
|
|
3792
|
+
| `value` | `number` | `50` | Current position, between `min` and `max`. Defaults to 50. Reflected to the `value` attribute as it moves; the form's reset target stays the value the slider started with. |
|
|
3793
|
+
| `min` | `number` | `0` | Lowest value. Defaults to 0. |
|
|
3794
|
+
| `max` | `number` | `100` | Highest value. Defaults to 100. |
|
|
3795
|
+
| `step` | `number` | `1` | Granularity: the value moves in multiples of `step` from `min`. Defaults to 1. |
|
|
3796
|
+
| `disabled` | `boolean` | `false` | Stop the slider reacting and exclude it from the form submission. |
|
|
3797
|
+
| `name` | `string` | | Key the value is submitted under in the form's `FormData`. Without a name the slider submits nothing. |
|
|
3798
|
+
| `show-value` | `boolean` | `false` | Show the current number beside the slider. |
|
|
3799
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
3800
|
+
| `form` | `string \| null` | | `id` of a `<form>` elsewhere in the page that this control belongs to, as on a native control. Without it the control belongs to the form it sits inside. |
|
|
3801
|
+
|
|
3802
|
+
| Event | `detail` | Description |
|
|
3803
|
+
|---|---|---|
|
|
3804
|
+
| `void-input` | `{ value: number }` | |
|
|
3805
|
+
| `void-change` | `{ value: number }` | |
|
|
3806
|
+
|
|
3807
|
+
Example:
|
|
3808
|
+
|
|
3809
|
+
```html
|
|
3810
|
+
<void-field label="Volume">
|
|
3811
|
+
<void-slider name="volume" value="40" min="0" max="100" step="5" show-value></void-slider>
|
|
3812
|
+
</void-field>
|
|
3813
|
+
```
|
|
3814
|
+
|
|
3815
|
+
## `<void-spacer>`
|
|
3816
|
+
|
|
3817
|
+
Empty flexible gap: pushes what follows it to the far end of a void-nav-bar or void-toolbar.
|
|
3818
|
+
|
|
3819
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
3820
|
+
|
|
3821
|
+
Example:
|
|
3822
|
+
|
|
3823
|
+
```html
|
|
3824
|
+
<void-toolbar>
|
|
3825
|
+
<span>3 selected</span>
|
|
3826
|
+
<void-spacer></void-spacer>
|
|
3827
|
+
<void-button size="sm">Pause</void-button>
|
|
3828
|
+
</void-toolbar>
|
|
3829
|
+
```
|
|
3830
|
+
|
|
3831
|
+
## `<void-spinner>`
|
|
3832
|
+
|
|
3833
|
+
Indeterminate loading indicator for async operations, button loading states, and inline fetching.
|
|
3834
|
+
|
|
3835
|
+
| Attribute | Values | Default | Description |
|
|
3836
|
+
|---|---|---|---|
|
|
3837
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
3838
|
+
| `label` | `string` | `Loading` | Text announced to screen readers while loading, and the spinner's accessible name. Defaults to `Loading`; say what is loading (`Loading orders`). |
|
|
3839
|
+
|
|
3840
|
+
Example:
|
|
3841
|
+
|
|
3842
|
+
```html
|
|
3843
|
+
<void-spinner label="Loading orders"></void-spinner>
|
|
3844
|
+
```
|
|
3845
|
+
|
|
3846
|
+
## `<void-split>`
|
|
3847
|
+
|
|
3848
|
+
Two columns that collapse to one below 48rem.
|
|
3849
|
+
|
|
3850
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
3851
|
+
|
|
3852
|
+
| Attribute | Values | Default | Description |
|
|
3853
|
+
|---|---|---|---|
|
|
3854
|
+
| `ratio` | `1:1\|2:1\|1:2\|aside` | `1:1` | aside is a narrow fixed first column beside the content (a settings list) |
|
|
3855
|
+
| `valign` | `start\|center\|end` | `start` | vertical alignment of the two columns |
|
|
3856
|
+
|
|
3857
|
+
Example:
|
|
3858
|
+
|
|
3859
|
+
```html
|
|
3860
|
+
<void-split ratio="2:1">
|
|
3861
|
+
<void-section>
|
|
3862
|
+
<void-section-head><h2>Capacity</h2></void-section-head>
|
|
3863
|
+
<p>The wider column.</p>
|
|
3864
|
+
</void-section>
|
|
3865
|
+
<void-section>
|
|
3866
|
+
<void-section-head><h2>Events</h2></void-section-head>
|
|
3867
|
+
<p>The narrower column.</p>
|
|
3868
|
+
</void-section>
|
|
3869
|
+
</void-split>
|
|
3870
|
+
```
|
|
3871
|
+
|
|
3872
|
+
## `<void-stack>`
|
|
3873
|
+
|
|
3874
|
+
Vertical stack with a named gap from the layout rhythm.
|
|
3875
|
+
|
|
3876
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
3877
|
+
|
|
3878
|
+
| Attribute | Values | Default | Description |
|
|
3879
|
+
|---|---|---|---|
|
|
3880
|
+
| `gap` | `tight\|inside\|stack\|group\|section` | `inside` | tight 8px, inside 16px, stack 24px, group 40px, section 72px at the default knobs |
|
|
3881
|
+
| `sticky` | `boolean` | | as a child of void-split: stays in view while the other column scrolls |
|
|
3882
|
+
|
|
3883
|
+
Example:
|
|
3884
|
+
|
|
3885
|
+
```html
|
|
3886
|
+
<void-stack gap="stack">
|
|
3887
|
+
<void-field label="Name"><void-input name="name"></void-input></void-field>
|
|
3888
|
+
<void-field label="Email"><void-input name="email" type="email"></void-input></void-field>
|
|
3889
|
+
</void-stack>
|
|
3890
|
+
```
|
|
3891
|
+
|
|
3892
|
+
## `<void-stat>`
|
|
3893
|
+
|
|
3894
|
+
Key metric display for analytics dashboards and KPI summaries with label, value, delta, and trend.
|
|
3895
|
+
|
|
3896
|
+
| Attribute | Values | Default | Description |
|
|
3897
|
+
|---|---|---|---|
|
|
3898
|
+
| `label` | `string` | | Small caption above the value, such as `Active users`. |
|
|
3899
|
+
| `value` | `string` | | The headline figure, as text. Format it yourself (`12,480`, `$4.2k`, `99.9%`); the element does not format numbers. |
|
|
3900
|
+
| `delta` | `string` | | Change shown beside the value, such as `+12%`. Its colour comes from `trend`. |
|
|
3901
|
+
| `description` | `string` | | Secondary line of text shown under the value, e.g. "vs. last month". |
|
|
3902
|
+
| `trend` | `up\|down\|flat\|error\|warning\|caution\|success\|info\|notice\|highlight\|null` | | Colours the `delta`: `up` is success green and `down` is error red, `flat` is neutral, and a status name (`error`, `warning`, `caution`, `success`, `info`, `notice`, `highlight`) uses that colour directly. Use the status names when up is not good (rising errors). |
|
|
3903
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the stat itself: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. Independent of the delta's `trend` colour. |
|
|
3904
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
3905
|
+
|
|
3906
|
+
Attributes that do not exist (and what to write instead):
|
|
3907
|
+
|
|
3908
|
+
- `unit`: use <void-figure> with data-void-type="value" and "unit" spans
|
|
3909
|
+
- `caption`: use <void-figure> with a data-void-type="caption" span
|
|
3910
|
+
|
|
3911
|
+
Example:
|
|
3912
|
+
|
|
3913
|
+
```html
|
|
3914
|
+
<void-stat label="Active users" value="12,480" delta="+8.2%" trend="up" description="vs. last month"></void-stat>
|
|
3915
|
+
```
|
|
3916
|
+
|
|
3917
|
+
## `<void-state>`
|
|
3918
|
+
|
|
3919
|
+
A state as a coloured dot and a word. The word is the content and is required, so colour is never the only signal.
|
|
3920
|
+
|
|
3921
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
3922
|
+
|
|
3923
|
+
| Attribute | Values | Default | Description |
|
|
3924
|
+
|---|---|---|---|
|
|
3925
|
+
| `color` | `default\|success\|info\|warning\|caution\|error\|notice\|highlight` | `default` | default is grey (idle, off, unknown) |
|
|
3926
|
+
| `pulse` | `boolean` | | animated ring: something happening now |
|
|
3927
|
+
|
|
3928
|
+
Example:
|
|
3929
|
+
|
|
3930
|
+
```html
|
|
3931
|
+
<void-state color="success">Tracking</void-state>
|
|
3932
|
+
```
|
|
3933
|
+
|
|
3934
|
+
## `<void-status-dot>`
|
|
3935
|
+
|
|
3936
|
+
Presence indicator for user lists and chat rosters showing online/away/offline state at a glance.
|
|
3937
|
+
|
|
3938
|
+
| Attribute | Values | Default | Description |
|
|
3939
|
+
|---|---|---|---|
|
|
3940
|
+
| `status` | `online\|away\|offline` | `offline` | Presence state: `online`, `away` or `offline` (default). Sets the colour and the accessible name (`Online`, `Away`, `Offline`). |
|
|
3941
|
+
|
|
3942
|
+
Example:
|
|
3943
|
+
|
|
3944
|
+
```html
|
|
3945
|
+
<void-status-dot status="online"></void-status-dot>
|
|
3946
|
+
```
|
|
3947
|
+
|
|
3948
|
+
## `<void-stepper>`
|
|
3949
|
+
|
|
3950
|
+
Multi-step progress tracker for onboarding flows, checkout funnels, and guided wizards.
|
|
3951
|
+
|
|
3952
|
+
| Attribute | Values | Default | Description |
|
|
3953
|
+
|---|---|---|---|
|
|
3954
|
+
| `value` | `number` | `0` | Zero-based index of the current step. Earlier steps show as completed, later ones as upcoming. |
|
|
3955
|
+
| `steps` | `string` | | Step labels as one comma-separated string, in order: `Account, Plan, Payment`. The element draws them; it does not hold any step content. |
|
|
3956
|
+
|
|
3957
|
+
Example:
|
|
3958
|
+
|
|
3959
|
+
```html
|
|
3960
|
+
<void-stepper steps="Account, Plan, Payment, Review" value="1"></void-stepper>
|
|
3961
|
+
```
|
|
3962
|
+
|
|
3963
|
+
## `<void-switch>`
|
|
3964
|
+
|
|
3965
|
+
On/off toggle for feature flags, notification preferences, and settings that take immediate effect.
|
|
3966
|
+
|
|
3967
|
+
| Attribute | Values | Default | Description |
|
|
3968
|
+
|---|---|---|---|
|
|
3969
|
+
| `checked` | `boolean` | `false` | Whether the switch is on. Reflected to the attribute as it changes; the form's reset target stays the state it started with. |
|
|
3970
|
+
| `disabled` | `boolean` | `false` | Stop the switch reacting and exclude it from the form submission. Also disabled by an enclosing `<fieldset disabled>`. |
|
|
3971
|
+
| `value` | `string` | `on` | Submitted under `name` while checked (like a native checkbox). |
|
|
3972
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the switch when on: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
3973
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
3974
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
3975
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
3976
|
+
|
|
3977
|
+
| Event | `detail` | Description |
|
|
3978
|
+
|---|---|---|
|
|
3979
|
+
| `void-change` | `{ value: string; checked: boolean }` | |
|
|
3980
|
+
|
|
3981
|
+
Example:
|
|
3982
|
+
|
|
3983
|
+
```html
|
|
3984
|
+
<void-switch name="alerts" checked>Email alerts</void-switch>
|
|
3985
|
+
```
|
|
3986
|
+
|
|
3987
|
+
## `<void-table>`
|
|
3988
|
+
|
|
3989
|
+
Data table around a native `<table>`: sets how it looks (`striped`, `hoverable`, `compact`,
|
|
3990
|
+
`bordered`, `inset`), how it behaves when the container is narrow (`stack`) and when it is wider
|
|
3991
|
+
than its container (`scrollable`, `sticky-header`, `sticky-column`).
|
|
3992
|
+
|
|
3993
|
+
**Stacked presentation.** `stack` turns each row into a block of label and value pairs while the
|
|
3994
|
+
table's container (not the viewport) is narrower than a breakpoint (`stack="48rem"`, `stack="always"`). The label of a cell is the
|
|
3995
|
+
text of the header cell of its column; it is copied to the cell as `data-label` (a `data-label`
|
|
3996
|
+
written on a cell is kept). `data-stack` on a header cell sets the role of a column in the block:
|
|
3997
|
+
`title` (the block's heading, no label), `select` (a row checkbox, beside the title), `actions`
|
|
3998
|
+
(buttons, grouped at the end) or `hide` (left out). It is copied to the cells of the column.
|
|
3999
|
+
`data-align="end"` on a header cell right-aligns a numeric column. Because browsers can drop table
|
|
4000
|
+
semantics when `display` changes, a table with `stack` carries explicit table, row and cell roles.
|
|
4001
|
+
|
|
4002
|
+
**Overflow.** Nothing is clipped by default, so a menu, popover or tooltip opened from a cell is
|
|
4003
|
+
always fully visible. `scrollable` makes the table its own horizontal scroll region: it is
|
|
4004
|
+
focusable and labelled (`label`, else the `<caption>`, else `aria-label`) only while it actually
|
|
4005
|
+
overflows, and fades its edges while there is more to scroll to. `max-height` makes the region
|
|
4006
|
+
scroll vertically too, which is what `sticky-header` needs; without it a sticky header sticks to
|
|
4007
|
+
the page.
|
|
4008
|
+
|
|
4009
|
+
| Attribute | Values | Default | Description |
|
|
4010
|
+
|---|---|---|---|
|
|
4011
|
+
| `striped` | `boolean` | `false` | Shade every other body row. |
|
|
4012
|
+
| `hoverable` | `boolean` | `false` | Highlight the body row under the pointer. |
|
|
4013
|
+
| `compact` | `boolean` | `false` | Reduce the padding of the cells for a denser table. |
|
|
4014
|
+
| `bordered` | `boolean` | `false` | Draw a border around every cell. |
|
|
4015
|
+
| `inset` | `boolean` | `false` | For a table placed in a card or panel: its dividers and stripes run to the container's edge and its text stays aligned with the container's content. |
|
|
4016
|
+
| `stack` | `string \| null` | | Presents each row as a block of label and value pairs while the table's container is narrow. Present without a value: stack below the theme's breakpoint (`--void-table-stack-at`, 40rem). A CSS length (`48rem`, `600px`) sets the breakpoint for this table, `always` stacks at every width. Absent: always a table. |
|
|
4017
|
+
| `scrollable` | `boolean` | `false` | Makes the table a horizontal scroll region (focusable and labelled while it overflows) with faded edges. |
|
|
4018
|
+
| `sticky-header` | `boolean` | `false` | Keeps the header row in view: against the table's own scroll (with `max-height`) or against the page. |
|
|
4019
|
+
| `sticky-column` | `boolean` | `false` | Keeps the first column in view while the table scrolls horizontally. |
|
|
4020
|
+
| `max-height` | `string \| null` | | Height (a CSS length) at which a scrollable table scrolls vertically. |
|
|
4021
|
+
| `label` | `string \| null` | | Accessible name of the scroll region (default: the table's caption, then `aria-label`). |
|
|
4022
|
+
|
|
4023
|
+
Example:
|
|
4024
|
+
|
|
4025
|
+
```html
|
|
4026
|
+
<void-table stack hoverable>
|
|
4027
|
+
<table>
|
|
4028
|
+
<thead>
|
|
4029
|
+
<tr><th data-stack="title">Name</th><th>Role</th><th data-align="end">Seats</th><th data-stack="actions">Actions</th></tr>
|
|
4030
|
+
</thead>
|
|
4031
|
+
<tbody>
|
|
4032
|
+
<tr><td>Ada</td><td>Admin</td><td>4</td><td><void-button variant="ghost" size="sm">Edit</void-button></td></tr>
|
|
4033
|
+
</tbody>
|
|
4034
|
+
</table>
|
|
4035
|
+
</void-table>
|
|
4036
|
+
```
|
|
4037
|
+
|
|
4038
|
+
## `<void-tabs>`
|
|
4039
|
+
|
|
4040
|
+
Tabbed section navigation for settings pages, detail views, and parallel content categories.
|
|
4041
|
+
|
|
4042
|
+
Three parts, all written by the author and never moved: `<void-tabs-list>` holding one `<void-tabs-trigger>`
|
|
4043
|
+
per tab (its `value` names the tab, its text is the label, `disabled` disables it), and one
|
|
4044
|
+
`<void-tabs-content>` per panel, matched to its trigger by `value`. Follows the WAI-ARIA tabs pattern: the list is the
|
|
4045
|
+
`tablist`, triggers are `tab`s and contents `tabpanel`s, wired with `aria-selected`, `aria-controls` and
|
|
4046
|
+
`aria-labelledby` (ids are generated only where the author gave none), and a roving tabindex (the selected tab,
|
|
4047
|
+
or the first enabled tab while none is selected, is the single tab stop; the visible panel is a tab stop too).
|
|
4048
|
+
Keyboard: ArrowRight and ArrowLeft move focus to the next and previous tab (wrapping, skipping disabled tabs),
|
|
4049
|
+
Home and End to the first and last, Enter or Space select the focused tab; with `activation="auto"` moving focus
|
|
4050
|
+
selects the tab. The selected trigger and the visible content carry `active` (for the theme and for server
|
|
4051
|
+
markup that must look right before the script loads).
|
|
4052
|
+
|
|
4053
|
+
Parts (only these parts as children, in this order):
|
|
4054
|
+
|
|
4055
|
+
| Part | | Description |
|
|
4056
|
+
|---|---|---|
|
|
4057
|
+
| `<void-tabs-list>` | required, one, CSS-only | The row of tabs (role="tablist"). |
|
|
4058
|
+
|  `<void-tabs-trigger>` | required, any number, CSS-only | One tab; its text is the label. Selects the content with the same value. |
|
|
4059
|
+
| `<void-tabs-content>` | required, any number, CSS-only | One panel (role="tabpanel"), shown while the tab with the same value is selected. |
|
|
4060
|
+
|
|
4061
|
+
Markup: `<void-tabs value="a"><void-tabs-list><void-tabs-trigger value="a">A</void-tabs-trigger><void-tabs-trigger value="b">B</void-tabs-trigger></void-tabs-list><void-tabs-content value="a">...</void-tabs-content><void-tabs-content value="b">...</void-tabs-content></void-tabs>`
|
|
4062
|
+
|
|
4063
|
+
| Attribute | Values | Default | Description |
|
|
4064
|
+
|---|---|---|---|
|
|
4065
|
+
| `value` | `string` | | The `value` of the selected tab. As an attribute it is the initial tab; selecting a tab updates it (it reflects) and fires `void-change`. |
|
|
4066
|
+
| `size` | `sm\|md\|lg` | `md` | Size step of the tabs: `sm`, `md` (default) or `lg`. |
|
|
4067
|
+
| `activation` | `manual\|auto` | `manual` | `manual` (default): arrow keys move focus and Enter or Space select the focused tab. `auto`: focusing a tab with the arrow keys selects it. |
|
|
4068
|
+
|
|
4069
|
+
| Event | `detail` | Description |
|
|
4070
|
+
|---|---|---|
|
|
4071
|
+
| `void-change` | `{ value: string }` | The user selected a tab. |
|
|
4072
|
+
|
|
4073
|
+
Example:
|
|
4074
|
+
|
|
4075
|
+
```html
|
|
4076
|
+
<void-tabs value="overview">
|
|
4077
|
+
<void-tabs-list>
|
|
4078
|
+
<void-tabs-trigger value="overview">Overview</void-tabs-trigger>
|
|
4079
|
+
<void-tabs-trigger value="activity">Activity</void-tabs-trigger>
|
|
4080
|
+
<void-tabs-trigger value="settings" disabled>Settings</void-tabs-trigger>
|
|
4081
|
+
</void-tabs-list>
|
|
4082
|
+
<void-tabs-content value="overview">Summary of the project.</void-tabs-content>
|
|
4083
|
+
<void-tabs-content value="activity">Recent changes.</void-tabs-content>
|
|
4084
|
+
<void-tabs-content value="settings">Not available on this plan.</void-tabs-content>
|
|
4085
|
+
</void-tabs>
|
|
4086
|
+
```
|
|
4087
|
+
|
|
4088
|
+
## `<void-tabs-content>`
|
|
4089
|
+
|
|
4090
|
+
One panel (role="tabpanel"), shown while the tab with the same value is selected.
|
|
4091
|
+
|
|
4092
|
+
CSS-only part of `<void-tabs>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
4093
|
+
|
|
4094
|
+
| Attribute | Values | Default | Description |
|
|
4095
|
+
|---|---|---|---|
|
|
4096
|
+
| `value` | `string` | | Key of the panel: the `value` of its <void-tabs-trigger>. |
|
|
4097
|
+
| `active` | `boolean` | | Set by <void-tabs> on the visible panel. Render it on the selected panel in server markup so the page looks right before the script loads. |
|
|
4098
|
+
|
|
4099
|
+
Allowed inside: `<void-tabs>`.
|
|
4100
|
+
|
|
4101
|
+
Example:
|
|
4102
|
+
|
|
4103
|
+
```html
|
|
4104
|
+
<void-tabs value="overview">
|
|
4105
|
+
<void-tabs-list>
|
|
4106
|
+
<void-tabs-trigger value="overview">Overview</void-tabs-trigger>
|
|
4107
|
+
<void-tabs-trigger value="activity">Activity</void-tabs-trigger>
|
|
4108
|
+
<void-tabs-trigger value="settings" disabled>Settings</void-tabs-trigger>
|
|
4109
|
+
</void-tabs-list>
|
|
4110
|
+
<void-tabs-content value="overview">Summary of the project.</void-tabs-content>
|
|
4111
|
+
<void-tabs-content value="activity">Recent changes.</void-tabs-content>
|
|
4112
|
+
<void-tabs-content value="settings">Not available on this plan.</void-tabs-content>
|
|
4113
|
+
</void-tabs>
|
|
4114
|
+
```
|
|
4115
|
+
|
|
4116
|
+
## `<void-tabs-list>`
|
|
4117
|
+
|
|
4118
|
+
The row of tabs (role="tablist").
|
|
4119
|
+
|
|
4120
|
+
CSS-only part of `<void-tabs>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
4121
|
+
|
|
4122
|
+
Parts (only these parts as children):
|
|
4123
|
+
|
|
4124
|
+
| Part | | Description |
|
|
4125
|
+
|---|---|---|
|
|
4126
|
+
| `<void-tabs-trigger>` | required, any number, CSS-only | One tab; its text is the label. Selects the content with the same value. |
|
|
4127
|
+
|
|
4128
|
+
Allowed inside: `<void-tabs>`.
|
|
4129
|
+
|
|
4130
|
+
Example:
|
|
4131
|
+
|
|
4132
|
+
```html
|
|
4133
|
+
<void-tabs value="overview">
|
|
4134
|
+
<void-tabs-list>
|
|
4135
|
+
<void-tabs-trigger value="overview">Overview</void-tabs-trigger>
|
|
4136
|
+
<void-tabs-trigger value="activity">Activity</void-tabs-trigger>
|
|
4137
|
+
<void-tabs-trigger value="settings" disabled>Settings</void-tabs-trigger>
|
|
4138
|
+
</void-tabs-list>
|
|
4139
|
+
<void-tabs-content value="overview">Summary of the project.</void-tabs-content>
|
|
4140
|
+
<void-tabs-content value="activity">Recent changes.</void-tabs-content>
|
|
4141
|
+
<void-tabs-content value="settings">Not available on this plan.</void-tabs-content>
|
|
4142
|
+
</void-tabs>
|
|
4143
|
+
```
|
|
4144
|
+
|
|
4145
|
+
## `<void-tabs-trigger>`
|
|
4146
|
+
|
|
4147
|
+
One tab; its text is the label. Selects the content with the same value.
|
|
4148
|
+
|
|
4149
|
+
CSS-only part of `<void-tabs-list>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
4150
|
+
|
|
4151
|
+
| Attribute | Values | Default | Description |
|
|
4152
|
+
|---|---|---|---|
|
|
4153
|
+
| `value` | `string` | | Key of the tab: the `value` of the <void-tabs-content> it shows, and of <void-tabs> while it is selected. |
|
|
4154
|
+
| `disabled` | `boolean` | | Shown, but cannot be selected and is skipped by the arrow keys. |
|
|
4155
|
+
| `active` | `boolean` | | Set by the tabs on the selected tab. Render it on the selected tab in server markup so the page looks right before the script loads. |
|
|
4156
|
+
|
|
4157
|
+
Allowed inside: `<void-tabs-list>`.
|
|
4158
|
+
|
|
4159
|
+
Example:
|
|
4160
|
+
|
|
4161
|
+
```html
|
|
4162
|
+
<void-tabs value="overview">
|
|
4163
|
+
<void-tabs-list>
|
|
4164
|
+
<void-tabs-trigger value="overview">Overview</void-tabs-trigger>
|
|
4165
|
+
<void-tabs-trigger value="activity">Activity</void-tabs-trigger>
|
|
4166
|
+
<void-tabs-trigger value="settings" disabled>Settings</void-tabs-trigger>
|
|
4167
|
+
</void-tabs-list>
|
|
4168
|
+
<void-tabs-content value="overview">Summary of the project.</void-tabs-content>
|
|
4169
|
+
<void-tabs-content value="activity">Recent changes.</void-tabs-content>
|
|
4170
|
+
<void-tabs-content value="settings">Not available on this plan.</void-tabs-content>
|
|
4171
|
+
</void-tabs>
|
|
4172
|
+
```
|
|
4173
|
+
|
|
4174
|
+
## `<void-tag>`
|
|
4175
|
+
|
|
4176
|
+
Removable label chip for selected filters, applied tags, and multi-value inputs.
|
|
4177
|
+
|
|
4178
|
+
Inside a `<void-list>` or an element with `role="list"` a tag is a list item (`role="listitem"`);
|
|
4179
|
+
anywhere else it has no role.
|
|
4180
|
+
|
|
4181
|
+
| Attribute | Values | Default | Description |
|
|
4182
|
+
|---|---|---|---|
|
|
4183
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
4184
|
+
| `removable` | `boolean` | `false` | Show a remove button. Clicking it fires `void-remove` and removes the tag from the page. |
|
|
4185
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
4186
|
+
|
|
4187
|
+
| Event | `detail` | Description |
|
|
4188
|
+
|---|---|---|
|
|
4189
|
+
| `void-remove` | `(no detail)` | |
|
|
4190
|
+
|
|
4191
|
+
Example:
|
|
4192
|
+
|
|
4193
|
+
```html
|
|
4194
|
+
<void-tag color="info" removable>design</void-tag>
|
|
4195
|
+
```
|
|
4196
|
+
|
|
4197
|
+
## `<void-tags-input>`
|
|
4198
|
+
|
|
4199
|
+
Multi-tag input field for email recipients, category labels, keyword tagging, and comma-separated value entry.
|
|
4200
|
+
|
|
4201
|
+
| Attribute | Values | Default | Description |
|
|
4202
|
+
|---|---|---|---|
|
|
4203
|
+
| `value` | `TagValue[]` | `[]` | The tags, as an array of strings or `{ text, color }` objects. Set it as a property from script, or as a JSON array in the attribute, which follows the tags as they change. |
|
|
4204
|
+
| `disabled` | `boolean` | `false` | Stop the field accepting input and removing tags, and exclude the values from the form submission. |
|
|
4205
|
+
| `readonly` | `boolean` | `false` | Show the tags but do not let the user add or remove any. Still submitted. |
|
|
4206
|
+
| `max` | `number` | `Infinity` | Maximum number of tags. Once reached, the entry field is hidden. Unlimited by default. |
|
|
4207
|
+
| `placeholder` | `string` | `Add tag...` | Hint in the entry field. Defaults to `Add tag...`. |
|
|
4208
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
4209
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the tags: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
4210
|
+
| `variant` | `filled\|outline` | `outline` | How the tags are drawn: `outline` (default) or `filled`. |
|
|
4211
|
+
| `allow-duplicates` | `boolean` | `false` | Accept the same tag more than once. Without it a tag that is already present is ignored. |
|
|
4212
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
4213
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
4214
|
+
|
|
4215
|
+
| Event | `detail` | Description |
|
|
4216
|
+
|---|---|---|
|
|
4217
|
+
| `void-change` | `{ value: TagValue[] }` | |
|
|
4218
|
+
|
|
4219
|
+
Example:
|
|
4220
|
+
|
|
4221
|
+
```html
|
|
4222
|
+
<void-field label="Keywords">
|
|
4223
|
+
<void-tags-input name="keywords" placeholder="Add a keyword" max="5"></void-tags-input>
|
|
4224
|
+
</void-field>
|
|
4225
|
+
```
|
|
4226
|
+
|
|
4227
|
+
## `<void-textarea>`
|
|
4228
|
+
|
|
4229
|
+
Multi-line text entry for comment fields, description inputs, and freeform text that needs more than one line.
|
|
4230
|
+
The host has no role: the native textarea is the (multi-line) textbox and carries the accessible name,
|
|
4231
|
+
which `<void-field>` supplies.
|
|
4232
|
+
|
|
4233
|
+
| Attribute | Values | Default | Description |
|
|
4234
|
+
|---|---|---|---|
|
|
4235
|
+
| `value` | `string` | | The text in the box. Reflected to the `value` attribute as it changes, and setting the attribute sets it; the form's reset target stays the value the box started with. |
|
|
4236
|
+
| `placeholder` | `string` | | Hint text shown while the box is empty. It is not a label: wrap the textarea in `void-field label="..."`. |
|
|
4237
|
+
| `disabled` | `boolean` | `false` | Stop the box accepting input and exclude it from the form submission. Also disabled by an enclosing `<fieldset disabled>`. |
|
|
4238
|
+
| `readonly` | `boolean` | `false` | Show the value but do not let the user edit it. Unlike `disabled`, a readonly box is focusable, selectable and still submitted. |
|
|
4239
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
4240
|
+
| `name` | `string` | | Key the value is submitted under in the form's `FormData`. Without a name the box submits nothing. |
|
|
4241
|
+
| `rows` | `number` | `3` | Visible height in lines of text. Defaults to 3. |
|
|
4242
|
+
| `resize` | `none\|vertical\|both` | `vertical` | Which way the user may drag the corner handle: `vertical` (default), `both` or `none`. |
|
|
4243
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`; sets the text size and padding. |
|
|
4244
|
+
| `error` | `string` | | Mark the box invalid: it gets the error styling and `aria-invalid`. The message itself is shown by the wrapping `void-field`, whose own `error` attribute sets this one. |
|
|
4245
|
+
| `autocomplete` | `string` | | Autofill hint forwarded to the native control (`autocomplete`), e.g. `current-password`, `one-time-code`, `email`. |
|
|
4246
|
+
| `minlength` | `number \| undefined` | | Minimum number of characters, enforced by the native control (`minlength`) and reported through validity. |
|
|
4247
|
+
| `maxlength` | `number \| undefined` | | Maximum number of characters accepted by the native control (`maxlength`). |
|
|
4248
|
+
| `inputmode` | `\|none\|text\|decimal\|numeric\|tel\|search\|email\|url` | | Virtual keyboard hint forwarded to the native control (`inputmode`). |
|
|
4249
|
+
| `enterkeyhint` | `\|enter\|done\|go\|next\|previous\|search\|send` | | Label of the mobile keyboard's enter key (`enterkeyhint`). |
|
|
4250
|
+
| `autocapitalize` | `\|off\|none\|on\|sentences\|words\|characters` | | Capitalisation behaviour of virtual keyboards (`autocapitalize`). |
|
|
4251
|
+
| `spellcheck` | `string \| null` | | The host's `spellcheck` attribute as written (`"true"`, `"false"`, `""`, or absent for the browser default), forwarded to the native control: the native enumerated attribute, not a boolean. |
|
|
4252
|
+
| `form` | `string \| null` | | `id` of a `<form>` elsewhere in the page that this control belongs to, as on a native control. Without it the control belongs to the form it sits inside. |
|
|
4253
|
+
|
|
4254
|
+
| Event | `detail` | Description |
|
|
4255
|
+
|---|---|---|
|
|
4256
|
+
| `void-input` | `{ value: string }` | |
|
|
4257
|
+
| `void-change` | `{ value: string }` | |
|
|
4258
|
+
|
|
4259
|
+
Attributes that do not exist (and what to write instead):
|
|
4260
|
+
|
|
4261
|
+
- `label`: wrap the control in <void-field label="...">
|
|
4262
|
+
|
|
4263
|
+
Example:
|
|
4264
|
+
|
|
4265
|
+
```html
|
|
4266
|
+
<void-field label="Notes" helper="Visible to your team.">
|
|
4267
|
+
<void-textarea name="notes" rows="4" maxlength="500"></void-textarea>
|
|
4268
|
+
</void-field>
|
|
4269
|
+
```
|
|
4270
|
+
|
|
4271
|
+
## `<void-toast>`
|
|
4272
|
+
|
|
4273
|
+
Temporary notification for action confirmations, error alerts, and copy-to-clipboard feedback.
|
|
4274
|
+
|
|
4275
|
+
Its text is written as parts: an optional `<void-toast-title>`, the `<void-toast-description>`, an optional
|
|
4276
|
+
`<void-toast-actions>` (buttons) and an optional `<void-toast-close>` wrapping the one control that dismisses
|
|
4277
|
+
it (a `<void-button aria-label="Dismiss">`). The parts are never moved, so a toast a server rendered into the
|
|
4278
|
+
container and one built by `toast()` are the same markup. Without a close part the toast cannot be dismissed by
|
|
4279
|
+
the user (it still closes itself after `duration`).
|
|
4280
|
+
|
|
4281
|
+
Parts (only these parts as children, in this order):
|
|
4282
|
+
|
|
4283
|
+
| Part | | Description |
|
|
4284
|
+
|---|---|---|
|
|
4285
|
+
| `<void-toast-title>` | one, CSS-only | Short title of the notification. |
|
|
4286
|
+
| `<void-toast-description>` | required, one, CSS-only | The message. |
|
|
4287
|
+
| `<void-toast-actions>` | one, CSS-only | Buttons for the notification, such as Undo. |
|
|
4288
|
+
| `<void-toast-close>` | one, wraps one control, CSS-only | Wraps the one control that dismisses the toast (a <button aria-label="Dismiss">); pressing it fires void-close and removes the toast. Without it only the timer closes the toast. |
|
|
4289
|
+
|
|
4290
|
+
Markup: `<void-toast color="success"><void-toast-title>Saved</void-toast-title><void-toast-description>Your changes were saved.</void-toast-description><void-toast-actions><void-button size="sm">Undo</void-button></void-toast-actions><void-toast-close><button type="button" aria-label="Dismiss">×</button></void-toast-close></void-toast>`
|
|
4291
|
+
|
|
4292
|
+
| Attribute | Values | Default | Description |
|
|
4293
|
+
|---|---|---|---|
|
|
4294
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. `error` and `warning` are announced assertively, the rest politely. |
|
|
4295
|
+
| `duration` | `number` | `5000` | Milliseconds before the toast closes itself. Defaults to 5000; 0 keeps it until dismissed. The timer pauses while the pointer or focus is on the toast. |
|
|
4296
|
+
|
|
4297
|
+
| Event | `detail` | Description |
|
|
4298
|
+
|---|---|---|
|
|
4299
|
+
| `void-close` | `{ reason: 'close-button' \| 'timeout' \| 'api' }` | The toast is closing, by its close part, its timer or `close()`; it removes itself afterwards. Does not bubble. Cancelable for `close-button`. |
|
|
4300
|
+
|
|
4301
|
+
Attributes that do not exist (and what to write instead):
|
|
4302
|
+
|
|
4303
|
+
- `heading`: write the title as <void-toast-title>...</void-toast-title> before the description
|
|
4304
|
+
- `dismissable`: add <void-toast-close><button type="button" aria-label="Dismiss">×</button></void-toast-close> as the last child; without it the toast has no close button
|
|
4305
|
+
|
|
4306
|
+
Example:
|
|
4307
|
+
|
|
4308
|
+
```html
|
|
4309
|
+
<void-toast-container>
|
|
4310
|
+
<void-toast color="success" duration="0">
|
|
4311
|
+
<void-toast-title>Saved</void-toast-title>
|
|
4312
|
+
<void-toast-description>Your changes were saved.</void-toast-description>
|
|
4313
|
+
<void-toast-close><button type="button" aria-label="Dismiss">×</button></void-toast-close>
|
|
4314
|
+
</void-toast>
|
|
4315
|
+
</void-toast-container>
|
|
4316
|
+
```
|
|
4317
|
+
|
|
4318
|
+
## `<void-toast-actions>`
|
|
4319
|
+
|
|
4320
|
+
Buttons for the notification, such as Undo.
|
|
4321
|
+
|
|
4322
|
+
CSS-only part of `<void-toast>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
4323
|
+
|
|
4324
|
+
Allowed inside: `<void-toast>`.
|
|
4325
|
+
|
|
4326
|
+
Example:
|
|
4327
|
+
|
|
4328
|
+
```html
|
|
4329
|
+
<void-toast-container>
|
|
4330
|
+
<void-toast color="success" duration="0">
|
|
4331
|
+
<void-toast-title>Saved</void-toast-title>
|
|
4332
|
+
<void-toast-description>Your changes were saved.</void-toast-description>
|
|
4333
|
+
<void-toast-close><button type="button" aria-label="Dismiss">×</button></void-toast-close>
|
|
4334
|
+
</void-toast>
|
|
4335
|
+
</void-toast-container>
|
|
4336
|
+
```
|
|
4337
|
+
|
|
4338
|
+
## `<void-toast-close>`
|
|
4339
|
+
|
|
4340
|
+
Wraps the one control that dismisses the toast (a <button aria-label="Dismiss">); pressing it fires void-close and removes the toast. Without it only the timer closes the toast.
|
|
4341
|
+
|
|
4342
|
+
CSS-only part of `<void-toast>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
4343
|
+
|
|
4344
|
+
Allowed inside: `<void-toast>`.
|
|
4345
|
+
|
|
4346
|
+
Example:
|
|
4347
|
+
|
|
4348
|
+
```html
|
|
4349
|
+
<void-toast-container>
|
|
4350
|
+
<void-toast color="success" duration="0">
|
|
4351
|
+
<void-toast-title>Saved</void-toast-title>
|
|
4352
|
+
<void-toast-description>Your changes were saved.</void-toast-description>
|
|
4353
|
+
<void-toast-close><button type="button" aria-label="Dismiss">×</button></void-toast-close>
|
|
4354
|
+
</void-toast>
|
|
4355
|
+
</void-toast-container>
|
|
4356
|
+
```
|
|
4357
|
+
|
|
4358
|
+
## `<void-toast-container>`
|
|
4359
|
+
|
|
4360
|
+
Container that manages toast positioning and provides a static show() helper for programmatic toast display.
|
|
4361
|
+
|
|
4362
|
+
While it holds toasts it is shown in the top layer (a `popover="manual"`), so toasts are never clipped or buried by
|
|
4363
|
+
the page's stacking contexts. A toast added while a modal dialog is open raises the container above the dialog; it
|
|
4364
|
+
is visible there, but the page outside the dialog (the container included) stays inert until the dialog closes.
|
|
4365
|
+
|
|
4366
|
+
| Attribute | Values | Default | Description |
|
|
4367
|
+
|---|---|---|---|
|
|
4368
|
+
| `placement` | `top-right\|top-left\|bottom-right\|bottom-left\|top-center\|bottom-center\|inline` | `bottom-right` | Where the container sits. The corner and centre values overlay the page at a fixed position; `inline` keeps the container in normal flow so toasts push content instead of covering it. |
|
|
4369
|
+
|
|
4370
|
+
Example:
|
|
4371
|
+
|
|
4372
|
+
```html
|
|
4373
|
+
<void-toast-container placement="bottom-right">
|
|
4374
|
+
<void-toast color="info" duration="8000">
|
|
4375
|
+
<void-toast-description>The export will be ready in a minute.</void-toast-description>
|
|
4376
|
+
<void-toast-close><button type="button" aria-label="Dismiss">×</button></void-toast-close>
|
|
4377
|
+
</void-toast>
|
|
4378
|
+
</void-toast-container>
|
|
4379
|
+
```
|
|
4380
|
+
|
|
4381
|
+
## `<void-toast-description>`
|
|
4382
|
+
|
|
4383
|
+
The message.
|
|
4384
|
+
|
|
4385
|
+
CSS-only part of `<void-toast>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
4386
|
+
|
|
4387
|
+
Allowed inside: `<void-toast>`.
|
|
4388
|
+
|
|
4389
|
+
Example:
|
|
4390
|
+
|
|
4391
|
+
```html
|
|
4392
|
+
<void-toast-container>
|
|
4393
|
+
<void-toast color="success" duration="0">
|
|
4394
|
+
<void-toast-title>Saved</void-toast-title>
|
|
4395
|
+
<void-toast-description>Your changes were saved.</void-toast-description>
|
|
4396
|
+
<void-toast-close><button type="button" aria-label="Dismiss">×</button></void-toast-close>
|
|
4397
|
+
</void-toast>
|
|
4398
|
+
</void-toast-container>
|
|
4399
|
+
```
|
|
4400
|
+
|
|
4401
|
+
## `<void-toast-title>`
|
|
4402
|
+
|
|
4403
|
+
Short title of the notification.
|
|
4404
|
+
|
|
4405
|
+
CSS-only part of `<void-toast>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
4406
|
+
|
|
4407
|
+
Allowed inside: `<void-toast>`.
|
|
4408
|
+
|
|
4409
|
+
Example:
|
|
4410
|
+
|
|
4411
|
+
```html
|
|
4412
|
+
<void-toast-container>
|
|
4413
|
+
<void-toast color="success" duration="0">
|
|
4414
|
+
<void-toast-title>Saved</void-toast-title>
|
|
4415
|
+
<void-toast-description>Your changes were saved.</void-toast-description>
|
|
4416
|
+
<void-toast-close><button type="button" aria-label="Dismiss">×</button></void-toast-close>
|
|
4417
|
+
</void-toast>
|
|
4418
|
+
</void-toast-container>
|
|
4419
|
+
```
|
|
4420
|
+
|
|
4421
|
+
## `<void-toggle>`
|
|
4422
|
+
|
|
4423
|
+
Pressable toggle button for toolbar actions and editor formatting controls with binary active/inactive state.
|
|
4424
|
+
|
|
4425
|
+
| Attribute | Values | Default | Description |
|
|
4426
|
+
|---|---|---|---|
|
|
4427
|
+
| `pressed` | `boolean` | `false` | Whether the toggle is on. It flips on click, Enter or Space and fires `void-change` with `{ value, pressed }`. Exposed as `aria-pressed`. |
|
|
4428
|
+
| `value` | `string` | | What this toggle stands for: the value it contributes to a parent `<void-toggle-group>`, and `detail.value` of its `void-change`. |
|
|
4429
|
+
| `disabled` | `boolean` | `false` | Ignore clicks and keys, and take the toggle out of the tab order. A `<fieldset disabled>` ancestor does the same. |
|
|
4430
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the pressed state: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
4431
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
4432
|
+
| `variant` | `outline\|filled` | `outline` | How the pressed state shows: `outline` (default) keeps the border and tints; `filled` fills the toggle. |
|
|
4433
|
+
|
|
4434
|
+
| Event | `detail` | Description |
|
|
4435
|
+
|---|---|---|
|
|
4436
|
+
| `void-change` | `{ value: string; pressed: boolean }` | |
|
|
4437
|
+
|
|
4438
|
+
Example:
|
|
4439
|
+
|
|
4440
|
+
```html
|
|
4441
|
+
<void-toggle pressed>Bold</void-toggle>
|
|
4442
|
+
```
|
|
4443
|
+
|
|
4444
|
+
## `<void-toggle-group>`
|
|
4445
|
+
|
|
4446
|
+
Multi-button toggle set for text editor toolbars and filter chips where one or many options can be active.
|
|
4447
|
+
|
|
4448
|
+
| Attribute | Values | Default | Description |
|
|
4449
|
+
|---|---|---|---|
|
|
4450
|
+
| `value` | `string` | | Comma-separated `value`s of the pressed toggles (`bold,italic`), or the single pressed value. Reflected to the attribute as the pressed toggles change; the form's reset target stays the state it started with. Without it (or with an empty one) the toggles that carry `pressed` in the markup set the initial value (the first of them unless `multiple`); a non-empty `value` wins over their `pressed`. |
|
|
4451
|
+
| `multiple` | `boolean` | `false` | Let several toggles be pressed at once. Without it pressing one releases the others. |
|
|
4452
|
+
| `disabled` | `boolean` | `false` | Stop every toggle reacting and exclude the value from the form submission. |
|
|
4453
|
+
| `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
|
|
4454
|
+
| `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the pressed toggles: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
|
|
4455
|
+
| `orientation` | `horizontal\|vertical` | `horizontal` | Lay the toggles out in a `horizontal` row (default) or a `vertical` column. |
|
|
4456
|
+
| `required` | `boolean` | `false` | The control must have a value before its form can be submitted. An empty control is invalid (`valueMissing`) and the browser reports it, as for a native field. |
|
|
4457
|
+
| `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
|
|
4458
|
+
|
|
4459
|
+
| Event | `detail` | Description |
|
|
4460
|
+
|---|---|---|
|
|
4461
|
+
| `void-change` | `{ value: string[] } \| { value: string }` | |
|
|
4462
|
+
|
|
4463
|
+
Example:
|
|
4464
|
+
|
|
4465
|
+
```html
|
|
4466
|
+
<void-toggle-group multiple value="bold" aria-label="Text style">
|
|
4467
|
+
<void-toggle value="bold">Bold</void-toggle>
|
|
4468
|
+
<void-toggle value="italic">Italic</void-toggle>
|
|
4469
|
+
<void-toggle value="underline">Underline</void-toggle>
|
|
4470
|
+
</void-toggle-group>
|
|
4471
|
+
```
|
|
4472
|
+
|
|
4473
|
+
## `<void-toolbar>`
|
|
4474
|
+
|
|
4475
|
+
Row of controls above a table or list: search field, filters, void-spacer, then ghost icon buttons. Wraps.
|
|
4476
|
+
|
|
4477
|
+
CSS only: `@voidable/theme` styles this tag and nothing registers it, so it has no JavaScript, properties or events. Write it as plain markup in every framework.
|
|
4478
|
+
|
|
4479
|
+
Example:
|
|
4480
|
+
|
|
4481
|
+
```html
|
|
4482
|
+
<void-toolbar>
|
|
4483
|
+
<void-input type="search" placeholder="Search stations" aria-label="Search stations"></void-input>
|
|
4484
|
+
<void-select aria-label="Region">
|
|
4485
|
+
<select>
|
|
4486
|
+
<option>All regions</option>
|
|
4487
|
+
<option>Arctic</option>
|
|
4488
|
+
</select>
|
|
4489
|
+
</void-select>
|
|
4490
|
+
<void-spacer></void-spacer>
|
|
4491
|
+
<void-button variant="ghost" aria-label="Refresh"><i class="ti ti-refresh"></i></void-button>
|
|
4492
|
+
<void-button variant="ghost" aria-label="Download as CSV"><i class="ti ti-download"></i></void-button>
|
|
4493
|
+
</void-toolbar>
|
|
4494
|
+
```
|
|
4495
|
+
|
|
4496
|
+
## `<void-tooltip>`
|
|
4497
|
+
|
|
4498
|
+
Hover hint for icon buttons and truncated text that need a label without cluttering the visible interface.
|
|
4499
|
+
|
|
4500
|
+
Two parts: `<void-tooltip-trigger>` around the described element (one element: a `<void-button>`, a link), and
|
|
4501
|
+
`<void-tooltip-content>` with the hint text. The parts are the final DOM. Follows the WAI-ARIA tooltip pattern:
|
|
4502
|
+
the trigger's element is described by the content with `aria-describedby` (its own descriptions are kept), also
|
|
4503
|
+
when either part arrives after the tooltip upgraded. The content appears after `delay` on pointer hover and at
|
|
4504
|
+
once on keyboard focus, never takes focus, and Escape hides it. It is shown in the top layer and placed with CSS
|
|
4505
|
+
anchor positioning, flipping at viewport edges.
|
|
4506
|
+
|
|
4507
|
+
Parts (only these parts as children, in this order):
|
|
4508
|
+
|
|
4509
|
+
| Part | | Description |
|
|
4510
|
+
|---|---|---|
|
|
4511
|
+
| `<void-tooltip-trigger>` | required, one, wraps one control, CSS-only | Wraps the one element that the tooltip describes (a <void-button>, a <button>, a link); that element gets the ARIA. |
|
|
4512
|
+
| `<void-tooltip-content>` | required, one, CSS-only | Shown in the top layer next to the trigger. |
|
|
4513
|
+
|
|
4514
|
+
Markup: `<void-tooltip><void-tooltip-trigger><void-button>Copy</void-button></void-tooltip-trigger><void-tooltip-content>Copy to clipboard</void-tooltip-content></void-tooltip>`
|
|
4515
|
+
|
|
4516
|
+
| Attribute | Values | Default | Description |
|
|
4517
|
+
|---|---|---|---|
|
|
4518
|
+
| `side` | `top\|bottom\|left\|right` | `top` | Side of the trigger the tooltip appears on; it flips to the opposite side when there is no room. |
|
|
4519
|
+
| `align` | `start\|center\|end` | `center` | Alignment with the trigger along that side. |
|
|
4520
|
+
| `delay` | `number` | `200` | Milliseconds the pointer rests on the trigger before the content appears (keyboard focus shows it at once). Defaults to 200. |
|
|
4521
|
+
| `open` | `boolean` | `false` | Whether the tooltip is shown. It opens and closes itself from hover, focus and Escape; set it to drive it from script. |
|
|
4522
|
+
|
|
4523
|
+
| Event | `detail` | Description |
|
|
4524
|
+
|---|---|---|
|
|
4525
|
+
| `void-open` | `{ reason: 'hover' \| 'focus' \| 'api' }` | The tooltip appeared. |
|
|
4526
|
+
| `void-close` | `{ reason: 'hover' \| 'blur' \| 'escape' \| 'parent' \| 'api' }` | The tooltip is hiding. |
|
|
4527
|
+
|
|
4528
|
+
Attributes that do not exist (and what to write instead):
|
|
4529
|
+
|
|
4530
|
+
- `visible`: the shown state is the open attribute
|
|
4531
|
+
- `text`: write the hint as <void-tooltip-content>...</void-tooltip-content> after the <void-tooltip-trigger>
|
|
4532
|
+
|
|
4533
|
+
Example:
|
|
4534
|
+
|
|
4535
|
+
```html
|
|
4536
|
+
<void-tooltip side="top">
|
|
4537
|
+
<void-tooltip-trigger><void-button variant="ghost">Copy</void-button></void-tooltip-trigger>
|
|
4538
|
+
<void-tooltip-content>Copy to clipboard</void-tooltip-content>
|
|
4539
|
+
</void-tooltip>
|
|
4540
|
+
```
|
|
4541
|
+
|
|
4542
|
+
## `<void-tooltip-content>`
|
|
4543
|
+
|
|
4544
|
+
Shown in the top layer next to the trigger.
|
|
4545
|
+
|
|
4546
|
+
CSS-only part of `<void-tooltip>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
4547
|
+
|
|
4548
|
+
Allowed inside: `<void-tooltip>`.
|
|
4549
|
+
|
|
4550
|
+
Example:
|
|
4551
|
+
|
|
4552
|
+
```html
|
|
4553
|
+
<void-tooltip side="top">
|
|
4554
|
+
<void-tooltip-trigger><void-button variant="ghost">Copy</void-button></void-tooltip-trigger>
|
|
4555
|
+
<void-tooltip-content>Copy to clipboard</void-tooltip-content>
|
|
4556
|
+
</void-tooltip>
|
|
4557
|
+
```
|
|
4558
|
+
|
|
4559
|
+
## `<void-tooltip-trigger>`
|
|
4560
|
+
|
|
4561
|
+
Wraps the one element that the tooltip describes (a <void-button>, a <button>, a link); that element gets the ARIA.
|
|
4562
|
+
|
|
4563
|
+
CSS-only part of `<void-tooltip>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
|
|
4564
|
+
|
|
4565
|
+
Allowed inside: `<void-tooltip>`.
|
|
4566
|
+
|
|
4567
|
+
Example:
|
|
4568
|
+
|
|
4569
|
+
```html
|
|
4570
|
+
<void-tooltip side="top">
|
|
4571
|
+
<void-tooltip-trigger><void-button variant="ghost">Copy</void-button></void-tooltip-trigger>
|
|
4572
|
+
<void-tooltip-content>Copy to clipboard</void-tooltip-content>
|
|
4573
|
+
</void-tooltip>
|
|
4574
|
+
```
|
|
4575
|
+
|