@voidable/ui 0.10.0 → 0.12.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.
Files changed (177) hide show
  1. package/dist/angular/index.d.ts +2 -2
  2. package/dist/angular/index.js +2 -1
  3. package/dist/base.d.ts +6 -0
  4. package/dist/base.js +2 -2
  5. package/dist/chunks/activation-B8aBarKd.js +4 -0
  6. package/dist/chunks/{base-BxmMM3B7.js → base-BGrS4eIl.js} +9 -0
  7. package/dist/chunks/carousel-C9u0bg5l.js +10 -0
  8. package/dist/chunks/choice-BTrsi7OW.js +16 -0
  9. package/dist/chunks/data-Baycjoo4.js +96 -0
  10. package/dist/chunks/fields-MEqz-olE.js +21 -0
  11. package/dist/chunks/{form-control-C0vH6gii.js → form-control-fL-Hhy91.js} +49 -48
  12. package/dist/chunks/{keyboard-CEhMSkws.js → keyboard-ChtDvhB_.js} +4 -23
  13. package/dist/chunks/{keyboard-activation-CV0m4hkn.js → keyboard-activation-BfEyoaMT.js} +4 -6
  14. package/dist/chunks/menu-CxRRgkJI.js +21 -0
  15. package/dist/chunks/{modal-CgGp_fCs.js → modal-Cz2-Ov76.js} +24 -16
  16. package/dist/chunks/nav-menu-Bx284Dk6.js +12 -0
  17. package/dist/chunks/{overlay-hLJ7IQHx.js → overlay-BuV-4Yvt.js} +76 -69
  18. package/dist/chunks/overlay-K1ilWC1p.js +4 -0
  19. package/dist/chunks/pickers-CjlFgNke.js +36 -0
  20. package/dist/chunks/{projection-SnR79EHI.js → projection-oPe6ipjL.js} +1 -1
  21. package/dist/chunks/table-BBpqwWEi.js +4 -0
  22. package/dist/chunks/tabs-Buf3EBWq.js +10 -0
  23. package/dist/components/accordion.d.ts +7 -0
  24. package/dist/components/accordion.js +23 -15
  25. package/dist/components/action-input.d.ts +2 -1
  26. package/dist/components/action-input.js +60 -56
  27. package/dist/components/alert.d.ts +11 -0
  28. package/dist/components/alert.js +10 -3
  29. package/dist/components/avatar.js +2 -2
  30. package/dist/components/badge.d.ts +8 -2
  31. package/dist/components/badge.js +1 -4
  32. package/dist/components/banner.d.ts +9 -0
  33. package/dist/components/banner.js +10 -3
  34. package/dist/components/bar-chart.d.ts +21 -7
  35. package/dist/components/bar-chart.js +68 -45
  36. package/dist/components/breadcrumbs.d.ts +2 -0
  37. package/dist/components/breadcrumbs.js +16 -12
  38. package/dist/components/button.d.ts +7 -0
  39. package/dist/components/button.js +24 -17
  40. package/dist/components/calendar.d.ts +85 -12
  41. package/dist/components/calendar.js +263 -120
  42. package/dist/components/card.js +1 -1
  43. package/dist/components/carousel.d.ts +22 -0
  44. package/dist/components/carousel.js +66 -37
  45. package/dist/components/charts/data.d.ts +72 -0
  46. package/dist/components/checkbox-group.js +23 -22
  47. package/dist/components/checkbox.d.ts +7 -0
  48. package/dist/components/checkbox.js +30 -25
  49. package/dist/components/collapsible.d.ts +7 -0
  50. package/dist/components/collapsible.js +20 -12
  51. package/dist/components/color-picker.js +29 -28
  52. package/dist/components/combobox.d.ts +13 -1
  53. package/dist/components/combobox.js +55 -42
  54. package/dist/components/compose-input.d.ts +9 -1
  55. package/dist/components/compose-input.js +29 -17
  56. package/dist/components/dialog.js +1 -1
  57. package/dist/components/divider.js +2 -2
  58. package/dist/components/donut-chart.d.ts +22 -6
  59. package/dist/components/donut-chart.js +97 -70
  60. package/dist/components/drawer.js +1 -1
  61. package/dist/components/dropdown-menu.d.ts +22 -0
  62. package/dist/components/dropdown-menu.js +55 -40
  63. package/dist/components/editable.d.ts +11 -1
  64. package/dist/components/editable.js +36 -23
  65. package/dist/components/error-fallback.d.ts +4 -2
  66. package/dist/components/error-fallback.js +35 -29
  67. package/dist/components/field.js +2 -2
  68. package/dist/components/file-upload.d.ts +29 -5
  69. package/dist/components/file-upload.js +84 -28
  70. package/dist/components/gauge.d.ts +32 -8
  71. package/dist/components/gauge.js +206 -133
  72. package/dist/components/hamburger.d.ts +19 -1
  73. package/dist/components/hamburger.js +45 -25
  74. package/dist/components/hover-card.d.ts +7 -0
  75. package/dist/components/hover-card.js +23 -15
  76. package/dist/components/indicator.js +16 -15
  77. package/dist/components/input.js +3 -3
  78. package/dist/components/line-chart.d.ts +22 -7
  79. package/dist/components/line-chart.js +80 -57
  80. package/dist/components/list.js +1 -1
  81. package/dist/components/menu.d.ts +25 -0
  82. package/dist/components/menu.js +56 -34
  83. package/dist/components/multiselect.d.ts +17 -1
  84. package/dist/components/multiselect.js +97 -75
  85. package/dist/components/nav-bar.d.ts +9 -0
  86. package/dist/components/nav-bar.js +16 -3
  87. package/dist/components/nav-menu.d.ts +9 -0
  88. package/dist/components/nav-menu.js +31 -24
  89. package/dist/components/number-input.d.ts +15 -1
  90. package/dist/components/number-input.js +72 -38
  91. package/dist/components/pagination.js +26 -25
  92. package/dist/components/panel.js +1 -1
  93. package/dist/components/pin-input.d.ts +11 -0
  94. package/dist/components/pin-input.js +47 -33
  95. package/dist/components/popover.d.ts +7 -0
  96. package/dist/components/popover.js +22 -14
  97. package/dist/components/progress.js +2 -2
  98. package/dist/components/radio-group.js +3 -3
  99. package/dist/components/radio.d.ts +10 -1
  100. package/dist/components/radio.js +38 -33
  101. package/dist/components/scroll-area.js +2 -2
  102. package/dist/components/segmented-control.d.ts +14 -0
  103. package/dist/components/segmented-control.js +41 -29
  104. package/dist/components/select.js +2 -2
  105. package/dist/components/sidebar.d.ts +1 -0
  106. package/dist/components/sidebar.js +15 -11
  107. package/dist/components/skeleton.js +1 -1
  108. package/dist/components/slider.js +3 -3
  109. package/dist/components/spinner.d.ts +5 -3
  110. package/dist/components/spinner.js +22 -15
  111. package/dist/components/stat.d.ts +13 -1
  112. package/dist/components/stat.js +28 -20
  113. package/dist/components/status-dot.d.ts +2 -2
  114. package/dist/components/status-dot.js +13 -15
  115. package/dist/components/stepper.d.ts +2 -0
  116. package/dist/components/stepper.js +21 -14
  117. package/dist/components/switch.d.ts +7 -0
  118. package/dist/components/switch.js +25 -17
  119. package/dist/components/table.d.ts +81 -1
  120. package/dist/components/table.js +571 -69
  121. package/dist/components/tabs.d.ts +11 -0
  122. package/dist/components/tabs.js +43 -34
  123. package/dist/components/tag.js +13 -12
  124. package/dist/components/tags-input.d.ts +10 -1
  125. package/dist/components/tags-input.js +43 -31
  126. package/dist/components/textarea.js +3 -3
  127. package/dist/components/toast.d.ts +2 -0
  128. package/dist/components/toast.js +36 -29
  129. package/dist/components/toggle-group.d.ts +8 -0
  130. package/dist/components/toggle-group.js +25 -18
  131. package/dist/components/toggle.d.ts +7 -0
  132. package/dist/components/toggle.js +24 -16
  133. package/dist/components/tooltip.d.ts +7 -0
  134. package/dist/components/tooltip.js +21 -13
  135. package/dist/components.json +108 -84
  136. package/dist/custom-elements.json +4520 -236
  137. package/dist/dev/rules.d.ts +0 -1
  138. package/dist/dev/types.d.ts +5 -1
  139. package/dist/dev.js +298 -122
  140. package/dist/index.d.ts +4 -0
  141. package/dist/index.js +69 -67
  142. package/dist/keyboard-activation.d.ts +9 -9
  143. package/dist/keyboard.d.ts +2 -10
  144. package/dist/keymaps/activation.d.ts +8 -0
  145. package/dist/keymaps/carousel.d.ts +9 -0
  146. package/dist/keymaps/choice.d.ts +21 -0
  147. package/dist/keymaps/fields.d.ts +31 -0
  148. package/dist/keymaps/index.d.ts +2 -0
  149. package/dist/keymaps/menu.d.ts +36 -0
  150. package/dist/keymaps/nav-menu.d.ts +11 -0
  151. package/dist/keymaps/overlay.d.ts +4 -0
  152. package/dist/keymaps/pickers.d.ts +36 -0
  153. package/dist/keymaps/table.d.ts +8 -0
  154. package/dist/keymaps/tabs.d.ts +7 -0
  155. package/dist/keymaps.js +51 -0
  156. package/dist/keys.d.ts +46 -0
  157. package/dist/keys.js +57 -0
  158. package/dist/llms.txt +11 -3
  159. package/dist/messages/ar.d.ts +1 -0
  160. package/dist/messages/ar.js +130 -0
  161. package/dist/messages/fr.d.ts +1 -0
  162. package/dist/messages/fr.js +109 -0
  163. package/dist/messages.d.ts +213 -0
  164. package/dist/messages.js +190 -0
  165. package/dist/modal.d.ts +7 -0
  166. package/dist/reference.md +885 -60
  167. package/dist/testing/index.d.ts +46 -0
  168. package/dist/testing.js +79 -0
  169. package/dist/types/elements.d.ts +100 -84
  170. package/dist/types/react.d.ts +7 -3
  171. package/dist/types/solid.d.ts +7 -3
  172. package/dist/types/solid2.d.ts +4 -0
  173. package/dist/types/svelte.d.ts +7 -3
  174. package/dist/types/vue.d.ts +7 -3
  175. package/dist/vscode.html-custom-data.json +478 -38
  176. package/dist/web-types.json +1001 -111
  177. package/package.json +22 -2
package/dist/reference.md CHANGED
@@ -1,6 +1,6 @@
1
- # @voidable/ui 0.10.0: element reference
1
+ # @voidable/ui 0.12.0: element reference
2
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.
3
+ Generated from the package's Custom Elements Manifest. 168 elements (78 registered by JavaScript, 90 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
4
 
5
5
  ## `<void-accordion>`
6
6
 
@@ -81,6 +81,7 @@ find-in-page opens the item when it finds text inside.
81
81
 
82
82
  | Attribute | Values | Default | Description |
83
83
  |---|---|---|---|
84
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
84
85
  | `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
 
86
87
  | Event | `detail` | Description |
@@ -88,6 +89,12 @@ find-in-page opens the item when it finds text inside.
88
89
  | `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
90
  | `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
 
92
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
93
+
94
+ | Action | Default keys | What it does |
95
+ |---|---|---|
96
+ | `activate` (essential) | Enter, Space | Opens or closes the item (with the focus on its trigger). |
97
+
91
98
  Allowed inside: `<void-accordion>`.
92
99
 
93
100
  Attributes that do not exist (and what to write instead):
@@ -160,7 +167,7 @@ Input field with an attached icon button — used for copy-to-clipboard inputs,
160
167
  | `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
168
  | `type` | `text\|password\|search\|email\|tel\|url` | `text` | Native input type; any text-like type is forwarded to the native control. |
162
169
  | `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`). |
170
+ | `action-label` | `string` | | Accessible name of the button and its tooltip. Defaults to the `actionInput.action` message (English: `Action`); say what it does (`Copy link`). |
164
171
  | `icon-side` | `start\|end` | `end` | Which side of the field the button sits on, in the reading direction: `end` (default) or `start`. |
165
172
  | `tooltip-side` | `top\|bottom\|left\|right` | `top` | Where the button's tooltip appears: `top` (default), `bottom`, `left` or `right`. |
166
173
  | `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. |
@@ -171,6 +178,12 @@ Input field with an attached icon button — used for copy-to-clipboard inputs,
171
178
  | `void-change` | `{ value: string }` | |
172
179
  | `void-action` | `{ value: string }` | |
173
180
 
181
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
182
+
183
+ | Message | Default | Replaced by |
184
+ |---|---|---|
185
+ | `actionInput.action` | Action | `action-label` |
186
+
174
187
  Example:
175
188
 
176
189
  ```html
@@ -202,6 +215,9 @@ Example:
202
215
 
203
216
  Inline contextual message for form validation feedback, permission warnings, and system status notices.
204
217
 
218
+ Its role follows the colour: `error` and `warning` are `role="alert"` (announced at once, interrupting), every
219
+ other colour is `role="status"` (announced politely). A role you write on it is kept.
220
+
205
221
  Its text is written as parts: an optional `<void-alert-title>`, the `<void-alert-description>` and an optional
206
222
  `<void-alert-close>`. The parts are never moved. The close part wraps the one control the author writes (a
207
223
  `<button type="button" aria-label="Dismiss">`); pressing it fires `void-close` and, unless that is cancelled, removes the alert (focus inside
@@ -315,6 +331,11 @@ Example:
315
331
 
316
332
  Small status chip for issue trackers, tag systems, and categorization UIs where color conveys state at a glance.
317
333
 
334
+ A badge has no role: it is text beside other text, and a screen reader reads it where it sits. It is not
335
+ a live region, because a table of status badges would announce every one as it is inserted. For the one
336
+ badge whose change must be heard (a count that updates while the user works), write `role="status"` on it
337
+ yourself; the component leaves it alone.
338
+
318
339
  | Attribute | Values | Default | Description |
319
340
  |---|---|---|---|
320
341
  | `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. |
@@ -331,6 +352,11 @@ Example:
331
352
 
332
353
  Full-width site-level announcement for maintenance windows, cookie consent, and promotional messaging.
333
354
 
355
+ It never has the `banner` role: that is the page header landmark (at most one per page, never inside
356
+ `<main>`), which an announcement is not. Like the alert it carries an announcement, so its role follows its
357
+ `color`: `alert` for `error` and `warning`, `status` for the rest. To make it a landmark users can jump to,
358
+ write `role="region"` and an `aria-label`; the component leaves a role you write alone.
359
+
334
360
  Its text is written as parts: an optional `<void-banner-title>`, the `<void-banner-description>`, an optional
335
361
  `<void-banner-actions>` (buttons or links) and an optional `<void-banner-close>`. The parts are never moved. The
336
362
  close part wraps the one control the author writes (a `<void-button aria-label="Dismiss">`); pressing it fires
@@ -440,27 +466,32 @@ Example:
440
466
  ## `<void-bar-chart>`
441
467
 
442
468
  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.
469
+ (`{ series: [{ name, values }], labels }`) as the `data` property or as JSON in the `data` attribute, so
470
+ server-rendered markup draws it with no script; it has no children. The drawing is hidden from assistive
471
+ technology and a visually hidden data table (captioned with `aria-label`) carries the values instead; add
472
+ `show-table` to show the table below the chart too.
445
473
 
446
474
  | Attribute | Values | Default | Description |
447
475
  |---|---|---|---|
448
476
  | `height` | `number` | `220` | Height of the chart in pixels. Defaults to 220. The width fills the container. |
449
477
  | `show-value` | `boolean` | `false` | Print each bar's value above it (below it for a negative value), abbreviated above 1000 (`1.2k`). |
450
478
  | `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. |
479
+ | `aria-label` | `string` | | Accessible name of the chart, such as `Revenue by quarter`; it is also the caption of the data table. Set it: the drawing itself is hidden from assistive technology. |
480
+ | `show-table` | `boolean` | `false` | Show the data table (one row per category, one column per series) below the chart. The table is always there for assistive technology; this makes it visible too. |
452
481
  | `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. |
482
+ | `data` | `BarChartData` | `{ series: [] }` | 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. Give it as a property (assign a new object to update the chart and animate to it) or as JSON in the `data` attribute: `<void-bar-chart data='{"series":[{"name":"Sales","values":[3,5]}],"labels":["Mon","Tue"]}'>`. Invalid JSON draws nothing and is reported by `@voidable/ui/dev`. The property is not reflected to the attribute (the data can be large), and an attribute a server morph leaves unchanged does not animate again. |
453
483
 
454
- Properties with no attribute (set in JavaScript):
484
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
455
485
 
456
- | Property | Type | Description |
486
+ | Message | Default | Replaced by |
457
487
  |---|---|---|
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. |
488
+ | `chart.bar` | Bar chart | `aria-label` |
489
+ | `chart.label` | Label | `registerMessages()` only |
459
490
 
460
491
  Example:
461
492
 
462
493
  ```html
463
- <void-bar-chart aria-label="Revenue by quarter" height="240" show-value></void-bar-chart>
494
+ <void-bar-chart aria-label="Revenue by quarter" height="240" show-value data='{"labels":["Q1","Q2","Q3","Q4"],"series":[{"name":"2025","values":[120,180,150,210]},{"name":"2026","values":[150,220,190,260]}]}'></void-bar-chart>
464
495
  ```
465
496
 
466
497
  ## `<void-brand>`
@@ -499,6 +530,12 @@ Markup: `<void-breadcrumbs><void-breadcrumbs-list><void-breadcrumbs-item><a href
499
530
  |---|---|---|---|
500
531
  | `separator` | `string` | `/` | Character drawn between the crumbs. Defaults to `/`. It is drawn by CSS and hidden from assistive technology. |
501
532
 
533
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
534
+
535
+ | Message | Default | Replaced by |
536
+ |---|---|---|
537
+ | `breadcrumbs.label` | Breadcrumb | `aria-label` |
538
+
502
539
  Example:
503
540
 
504
541
  ```html
@@ -569,6 +606,7 @@ disabled); on an inner `<button>` it disables that button.
569
606
 
570
607
  | Attribute | Values | Default | Description |
571
608
  |---|---|---|---|
609
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
572
610
  | `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
611
  | `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
612
  | `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. |
@@ -579,6 +617,14 @@ disabled); on an inner `<button>` it disables that button.
579
617
  |---|---|---|
580
618
  | `void-click` | `(no detail)` | |
581
619
 
620
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
621
+
622
+ | Action | Default keys | What it does |
623
+ |---|---|---|
624
+ | `activate` (essential) | Enter, Space | Presses the button: a real `click`, on key down for Enter and on release for Space, as a native button does. |
625
+
626
+ The browser's own, not remappable: Tab, Shift + Tab (Move focus to and from the button.)
627
+
582
628
  Example:
583
629
 
584
630
  ```html
@@ -591,13 +637,14 @@ Date selection for booking flows, scheduling UIs, and form fields with locale-aw
591
637
 
592
638
  | Attribute | Values | Default | Description |
593
639
  |---|---|---|---|
640
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"nextWeek":["ArrowDown","j"]}`); `[]` switches an action off. See the keyboard guide. |
594
641
  | `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
642
  | `min` | `string` | | Earliest selectable date, as `YYYY-MM-DD`. Earlier days are disabled. |
596
643
  | `max` | `string` | | Latest selectable date, as `YYYY-MM-DD`. Later days are disabled. |
597
644
  | `disabled` | `boolean` | `false` | Stop the calendar reacting and exclude the value from the form submission. |
598
645
  | `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. |
646
+ | `locale` | `string` | | BCP 47 language tag for month and weekday names, the numbers and the long date announced for each day, such as `de-DE`. Without it the calendar follows the closest `lang` (the page's included), and `en-US` where there is none. Month and day names are always for the Gregorian calendar. |
647
+ | `first-day` | `number \| null` | | Day the week starts on, as a number from 0 (Sunday) to 6 (Saturday). Use 1 for Monday. Without it the week starts on the day the locale's week information gives (`Intl.Locale`), and on Sunday where the browser does not provide it. |
601
648
  | `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
649
  | `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
603
650
 
@@ -605,6 +652,37 @@ Date selection for booking flows, scheduling UIs, and form fields with locale-aw
605
652
  |---|---|---|
606
653
  | `void-change` | `{ value: string; date: Date }` | |
607
654
 
655
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
656
+
657
+ | Message | Default | Replaced by |
658
+ |---|---|---|
659
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
660
+ | `calendar.label` | Calendar | `aria-label` |
661
+ | `calendar.previousMonth` | Previous month | `registerMessages()` only |
662
+ | `calendar.nextMonth` | Next month | `registerMessages()` only |
663
+ | `calendar.chooseMonth` | Switch to month picker | `registerMessages()` only |
664
+ | `calendar.chooseYear` | Switch to year picker | `registerMessages()` only |
665
+ | `calendar.previousYear` | Previous year | `registerMessages()` only |
666
+ | `calendar.nextYear` | Next year | `registerMessages()` only |
667
+ | `calendar.previousYears` | Previous years | `registerMessages()` only |
668
+ | `calendar.nextYears` | Next years | `registerMessages()` only |
669
+
670
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
671
+
672
+ | Action | Default keys | What it does |
673
+ |---|---|---|
674
+ | `previousDay` | Left Arrow (Right Arrow in right-to-left text) | Moves focus to the previous day. In right-to-left pages the default is Right Arrow. |
675
+ | `nextDay` | Right Arrow (Left Arrow in right-to-left text) | Moves focus to the next day. In right-to-left pages the default is Left Arrow. |
676
+ | `previousWeek` | Up Arrow | Moves focus to the same weekday in the previous week. |
677
+ | `nextWeek` | Down Arrow | Moves focus to the same weekday in the next week. |
678
+ | `startOfWeek` | Home | Moves focus to the first day of the week (the week starts on `first-day`, else on the locale's first day). |
679
+ | `endOfWeek` | End | Moves focus to the last day of the week. |
680
+ | `previousMonth` | Page Up | Moves focus to the same day in the previous month. |
681
+ | `nextMonth` | Page Down | Moves focus to the same day in the next month. |
682
+ | `previousYear` | Shift + Page Up | Moves focus to the same day in the previous year. |
683
+ | `nextYear` | Shift + Page Down | Moves focus to the same day in the next year. |
684
+ | `activate` (essential) | Enter, Space | Chooses the focused day. |
685
+
608
686
  Example:
609
687
 
610
688
  ```html
@@ -787,10 +865,11 @@ Parts (only these parts as children, in this order):
787
865
  | `<void-carousel-next>` | one | Arrow button to the next slide. Empty, it shows the theme arrow; give it an aria-label. |
788
866
  | `<void-carousel-indicators>` | one, CSS-only | Leave it empty: the carousel fills it with one dot button per slide. |
789
867
 
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>`
868
+ Markup: `<void-carousel aria-label="Slides"><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
869
 
792
870
  | Attribute | Values | Default | Description |
793
871
  |---|---|---|---|
872
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"next":["ArrowRight"]}`); `[]` switches an action off. See the keyboard guide. |
794
873
  | `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
874
  | `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
875
  | `autoplay` | `boolean` | `false` | Advance to the next slide every `interval` milliseconds. It pauses while the pointer is over the carousel. |
@@ -802,6 +881,21 @@ Markup: `<void-carousel><void-carousel-content><void-carousel-item>One</void-car
802
881
  |---|---|---|
803
882
  | `void-change` | `{ value: number; index: number; previous: number }` | The shown slide changed; `value` and `index` are both the new slide's index. |
804
883
 
884
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
885
+
886
+ | Message | Default | Replaced by |
887
+ |---|---|---|
888
+ | `carousel.slide` | 2 of 5 | `aria-label` on `<void-carousel-item>` |
889
+ | `carousel.goTo` | Go to slide 2 | `registerMessages()` only |
890
+ | `carousel.indicators` | Slide indicators | `aria-label` on `<void-carousel-indicators>` |
891
+
892
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
893
+
894
+ | Action | Default keys | What it does |
895
+ |---|---|---|
896
+ | `next` | Right Arrow (Left Arrow in right-to-left text) | Goes to the next slide. In right-to-left pages the horizontal default is Left Arrow. |
897
+ | `previous` | Left Arrow (Right Arrow in right-to-left text) | Goes to the previous slide. |
898
+
805
899
  Attributes that do not exist (and what to write instead):
806
900
 
807
901
  - `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
@@ -810,7 +904,7 @@ Attributes that do not exist (and what to write instead):
810
904
  Example:
811
905
 
812
906
  ```html
813
- <void-carousel loop>
907
+ <void-carousel loop aria-label="Getting started steps">
814
908
  <void-carousel-content>
815
909
  <void-carousel-item>Step 1: Create a project</void-carousel-item>
816
910
  <void-carousel-item>Step 2: Invite your team</void-carousel-item>
@@ -839,7 +933,7 @@ Allowed inside: `<void-carousel>`.
839
933
  Example:
840
934
 
841
935
  ```html
842
- <void-carousel loop>
936
+ <void-carousel loop aria-label="Getting started steps">
843
937
  <void-carousel-content>
844
938
  <void-carousel-item>Step 1: Create a project</void-carousel-item>
845
939
  <void-carousel-item>Step 2: Invite your team</void-carousel-item>
@@ -862,7 +956,7 @@ Allowed inside: `<void-carousel>`.
862
956
  Example:
863
957
 
864
958
  ```html
865
- <void-carousel loop>
959
+ <void-carousel loop aria-label="Getting started steps">
866
960
  <void-carousel-content>
867
961
  <void-carousel-item>Step 1: Create a project</void-carousel-item>
868
962
  <void-carousel-item>Step 2: Invite your team</void-carousel-item>
@@ -882,14 +976,14 @@ CSS-only part of `<void-carousel-content>`: `@voidable/theme` styles it and noth
882
976
 
883
977
  | Attribute | Values | Default | Description |
884
978
  |---|---|---|---|
885
- | `active` | `boolean` | | Set by <void-carousel> on the slide being shown. |
979
+ | `active` | `boolean` | | Set by the carousel on the slide being shown. |
886
980
 
887
981
  Allowed inside: `<void-carousel-content>`.
888
982
 
889
983
  Example:
890
984
 
891
985
  ```html
892
- <void-carousel loop>
986
+ <void-carousel loop aria-label="Getting started steps">
893
987
  <void-carousel-content>
894
988
  <void-carousel-item>Step 1: Create a project</void-carousel-item>
895
989
  <void-carousel-item>Step 2: Invite your team</void-carousel-item>
@@ -907,12 +1001,22 @@ Next-slide control of a `<void-carousel>`: a button the theme draws as an arrow
907
1001
  empty element with an `aria-label` ("Next slide"); any content you put inside replaces the arrow. It is
908
1002
  aria-disabled on the last slide unless the carousel has `loop`.
909
1003
 
1004
+ | Attribute | Values | Default | Description |
1005
+ |---|---|---|---|
1006
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
1007
+
1008
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
1009
+
1010
+ | Action | Default keys | What it does |
1011
+ |---|---|---|
1012
+ | `activate` (essential) | Enter, Space | Goes to the next slide. |
1013
+
910
1014
  Allowed inside: `<void-carousel>`.
911
1015
 
912
1016
  Example:
913
1017
 
914
1018
  ```html
915
- <void-carousel>
1019
+ <void-carousel aria-label="Getting started steps">
916
1020
  <void-carousel-content>
917
1021
  <void-carousel-item>Step 1: Create a project</void-carousel-item>
918
1022
  <void-carousel-item>Step 2: Invite your team</void-carousel-item>
@@ -928,12 +1032,22 @@ Previous-slide control of a `<void-carousel>`: a button the theme draws as an ar
928
1032
  as an empty element with an `aria-label` ("Previous slide"); any content you put inside replaces the arrow.
929
1033
  It is aria-disabled on the first slide unless the carousel has `loop`.
930
1034
 
1035
+ | Attribute | Values | Default | Description |
1036
+ |---|---|---|---|
1037
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
1038
+
1039
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
1040
+
1041
+ | Action | Default keys | What it does |
1042
+ |---|---|---|
1043
+ | `activate` (essential) | Enter, Space | Goes to the previous slide. |
1044
+
931
1045
  Allowed inside: `<void-carousel>`.
932
1046
 
933
1047
  Example:
934
1048
 
935
1049
  ```html
936
- <void-carousel>
1050
+ <void-carousel aria-label="Getting started steps">
937
1051
  <void-carousel-content>
938
1052
  <void-carousel-item>Step 1: Create a project</void-carousel-item>
939
1053
  <void-carousel-item>Step 2: Invite your team</void-carousel-item>
@@ -949,6 +1063,7 @@ Binary or indeterminate selection for form fields, data table row selection, and
949
1063
 
950
1064
  | Attribute | Values | Default | Description |
951
1065
  |---|---|---|---|
1066
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Space"]}`); `[]` switches an action off. See the keyboard guide. |
952
1067
  | `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
1068
  | `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
1069
  | `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. |
@@ -963,6 +1078,12 @@ Binary or indeterminate selection for form fields, data table row selection, and
963
1078
  |---|---|---|
964
1079
  | `void-change` | `{ value: string; checked: boolean }` | |
965
1080
 
1081
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
1082
+
1083
+ | Action | Default keys | What it does |
1084
+ |---|---|---|
1085
+ | `activate` (essential) | Space | Checks or unchecks the box. |
1086
+
966
1087
  Example:
967
1088
 
968
1089
  ```html
@@ -993,6 +1114,12 @@ enabled checkbox's native input. `disabled` and `form` are forwarded.
993
1114
  |---|---|---|
994
1115
  | `void-change` | `{ value: string[] }` | |
995
1116
 
1117
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
1118
+
1119
+ | Message | Default | Replaced by |
1120
+ |---|---|---|
1121
+ | `checkboxGroup.required` | Please check at least one box. | `registerMessages()` only |
1122
+
996
1123
  Example:
997
1124
 
998
1125
  ```html
@@ -1026,6 +1153,7 @@ Markup: `<void-collapsible open><void-collapsible-trigger>Advanced options</void
1026
1153
 
1027
1154
  | Attribute | Values | Default | Description |
1028
1155
  |---|---|---|---|
1156
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
1029
1157
  | `open` | `boolean` | `false` | Whether the content is shown. Add the attribute to start open; it follows the user's toggling. |
1030
1158
  | `disabled` | `boolean` | `false` | Stop the panel from toggling. The trigger ignores clicks and Enter or Space. |
1031
1159
 
@@ -1034,6 +1162,12 @@ Markup: `<void-collapsible open><void-collapsible-trigger>Advanced options</void
1034
1162
  | `void-close` | `{ reason: 'trigger' \| 'keyboard' }` | The user is closing the panel. Cancelable: `preventDefault()` keeps it open. Does not bubble. |
1035
1163
  | `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
1164
 
1165
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
1166
+
1167
+ | Action | Default keys | What it does |
1168
+ |---|---|---|
1169
+ | `activate` (essential) | Enter, Space | Opens or closes the section (with the focus on the trigger). |
1170
+
1037
1171
  Attributes that do not exist (and what to write instead):
1038
1172
 
1039
1173
  - `heading`: write the heading as <void-collapsible-trigger>...</void-collapsible-trigger> and the content in <void-collapsible-content> after it
@@ -1107,6 +1241,13 @@ Color selection control with spectrum area, hue slider, hex input, and preset sw
1107
1241
  |---|---|---|
1108
1242
  | `void-change` | `{ value: string }` | |
1109
1243
 
1244
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
1245
+
1246
+ | Message | Default | Replaced by |
1247
+ |---|---|---|
1248
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
1249
+ | `colorPicker.label` | Color picker | `registerMessages()` only |
1250
+
1110
1251
  Example:
1111
1252
 
1112
1253
  ```html
@@ -1149,8 +1290,9 @@ Markup: `<void-combobox name="country" placeholder="Search countries"><void-comb
1149
1290
 
1150
1291
  | Attribute | Values | Default | Description |
1151
1292
  |---|---|---|---|
1293
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. |
1152
1294
  | `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. |
1295
+ | `placeholder` | `string` | | Hint shown in the search field while it is empty. Defaults to the `combobox.placeholder` message (English: `Search...`). It is also the field's accessible name when no `void-field` label names it. |
1154
1296
  | `disabled` | `boolean` | `false` | Stop the field opening and exclude the value from the form submission. |
1155
1297
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
1156
1298
  | `error` | `string` | | Mark the field invalid: it gets the error styling and `aria-invalid`. The message itself is shown by the wrapping `void-field`. |
@@ -1164,6 +1306,26 @@ Markup: `<void-combobox name="country" placeholder="Search countries"><void-comb
1164
1306
  | `void-open` | `{ reason: 'keyboard' \| 'focus' \| 'api' }` | The option list opened. |
1165
1307
  | `void-close` | `{ reason: 'escape' \| 'outside' \| 'blur' \| 'select' \| 'parent' \| 'api' }` | The option list is closing. |
1166
1308
 
1309
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
1310
+
1311
+ | Message | Default | Replaced by |
1312
+ |---|---|---|
1313
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
1314
+ | `combobox.placeholder` | Search... | `placeholder` |
1315
+ | `combobox.empty` | No options found | `registerMessages()` only |
1316
+
1317
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
1318
+
1319
+ | Action | Default keys | What it does |
1320
+ |---|---|---|
1321
+ | `next` | Down Arrow | Opens the list, or highlights the next option (wraps). Opening starts on the chosen option, else the first. |
1322
+ | `previous` | Up Arrow | Opens the list on the chosen option, else the last, or highlights the previous option (wraps). |
1323
+ | `open` | Alt + Down Arrow | Opens the list without highlighting an option. |
1324
+ | `activate` (essential) | Enter | Chooses the highlighted option and closes the list. With no option highlighted the list closes and the key is left alone, so a surrounding form submits. |
1325
+ | `close` | Escape, Alt + Up Arrow | Closes the list; focus stays in the field (a second Escape reaches an enclosing dialog). |
1326
+
1327
+ The browser's own, not remappable: Left Arrow, Right Arrow, Home, End (Move the text cursor; the highlight leaves the list.); Tab (Closes the list and moves on without choosing.); Characters (Filter the options; nothing is highlighted until you arrow to it.)
1328
+
1167
1329
  Example:
1168
1330
 
1169
1331
  ```html
@@ -1212,8 +1374,9 @@ Rich text entry area for messaging UIs, comment boxes, and social post composers
1212
1374
 
1213
1375
  | Attribute | Values | Default | Description |
1214
1376
  |---|---|---|---|
1377
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"send":["Control+Enter"]}`); `[]` switches an action off. See the keyboard guide. |
1215
1378
  | `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...`. |
1379
+ | `placeholder` | `string` | | Hint shown while the box is empty. Defaults to the `composeInput.placeholder` message (English: `Type a message...`). |
1217
1380
  | `disabled` | `boolean` | `false` | Stop the box and the send button reacting. |
1218
1381
  | `maxlength` | `number` | `0` | Maximum number of characters. 0 (the default) means no limit. |
1219
1382
 
@@ -1222,6 +1385,21 @@ Rich text entry area for messaging UIs, comment boxes, and social post composers
1222
1385
  | `void-input` | `{ value: string }` | |
1223
1386
  | `void-submit` | `{ value: string }` | |
1224
1387
 
1388
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
1389
+
1390
+ | Message | Default | Replaced by |
1391
+ |---|---|---|
1392
+ | `composeInput.placeholder` | Type a message... | `placeholder` |
1393
+ | `composeInput.send` | Send | `registerMessages()` only |
1394
+
1395
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
1396
+
1397
+ | Action | Default keys | What it does |
1398
+ |---|---|---|
1399
+ | `send` (essential) | Enter | Sends the message (`void-submit`). Shift + Enter, which is not bound, adds a new line. |
1400
+
1401
+ The browser's own, not remappable: Characters, Enter with Shift, arrows (Edit the text, in the native field.)
1402
+
1225
1403
  Example:
1226
1404
 
1227
1405
  ```html
@@ -1238,27 +1416,65 @@ in the field (ArrowDown then moves into the calendar); the calendar button, Ente
1238
1416
  field open it with focus on the selected (or current) day. Choosing a day, Escape, or a press outside closes
1239
1417
  it and focus returns to the input.
1240
1418
 
1419
+ The field also takes a typed date, in `format` or as ISO `YYYY-MM-DD`: it is read when the field loses focus
1420
+ and on Enter, the calendar follows, and `void-change` fires once with the ISO value. A date that is not a date,
1421
+ or is before `min` or after `max`, is refused: the text stays for correction, `error` explains it, the field
1422
+ is `aria-invalid` and described by the message, and the form is not submitted (`badInput`, `rangeUnderflow` or
1423
+ `rangeOverflow`). An empty field clears the value.
1424
+
1241
1425
  | Attribute | Values | Default | Description |
1242
1426
  |---|---|---|---|
1427
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. |
1243
1428
  | `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
1429
  | `min` | `string` | | Earliest selectable date, as `YYYY-MM-DD`. |
1245
1430
  | `max` | `string` | | Latest selectable date, as `YYYY-MM-DD`. |
1246
1431
  | `disabled` | `boolean` | `false` | Stop the field and its calendar reacting and exclude the value from the form submission. |
1247
1432
  | `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). |
1433
+ | `locale` | `string` | | BCP 47 language tag for the calendar's month and weekday names and numbers, such as `de-DE`. Without it the calendar follows the closest `lang`, and `en-US` where there is none. It does not change `format`. |
1434
+ | `first-day` | `number \| null` | | Day the calendar week starts on, as a number from 0 (Sunday) to 6 (Saturday). Without it, the locale's first day of the week, else Sunday. |
1250
1435
  | `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`. |
1436
+ | `placeholder` | `string` | | Hint shown in the field while no date is chosen. Defaults to the `datePicker.placeholder` message (English: `Select date`). |
1437
+ | `format` | `string` | `MM/DD/YYYY` | How the date is written in the field, using `YYYY`, `MM` and `DD`. Defaults to `MM/DD/YYYY`. A date typed into the field is read the same way (and as ISO `YYYY-MM-DD` always); the value stays `YYYY-MM-DD`. |
1253
1438
  | `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour of the field: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
1439
+ | `error` | `string` | | Mark the field invalid: it gets the error styling and `aria-invalid`. Set it for a server-side message; the field also sets it itself, with the reason, when a typed date is not taken, and clears what it set once a valid date is typed or picked. A message you set is left alone. |
1254
1440
  | `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
1441
  | `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
1256
1442
 
1257
1443
  | Event | `detail` | Description |
1258
1444
  |---|---|---|
1445
+ | `void-change` | `{ value: string; date: Date \| null }` | |
1259
1446
  | `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
1447
  | `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 }` | |
1448
+
1449
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
1450
+
1451
+ | Message | Default | Replaced by |
1452
+ |---|---|---|
1453
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
1454
+ | `calendar.previousMonth` | Previous month | `registerMessages()` only |
1455
+ | `calendar.nextMonth` | Next month | `registerMessages()` only |
1456
+ | `calendar.chooseMonth` | Switch to month picker | `registerMessages()` only |
1457
+ | `calendar.chooseYear` | Switch to year picker | `registerMessages()` only |
1458
+ | `calendar.previousYear` | Previous year | `registerMessages()` only |
1459
+ | `calendar.nextYear` | Next year | `registerMessages()` only |
1460
+ | `calendar.previousYears` | Previous years | `registerMessages()` only |
1461
+ | `calendar.nextYears` | Next years | `registerMessages()` only |
1462
+ | `datePicker.placeholder` | Select date | `placeholder` |
1463
+ | `datePicker.toggle` | Toggle calendar | `registerMessages()` only |
1464
+ | `datePicker.dialog` | Choose date | `registerMessages()` only |
1465
+ | `datePicker.invalid` | Enter a date as MM/DD/YYYY or YYYY-MM-DD. | `registerMessages()` only |
1466
+ | `datePicker.tooEarly` | Choose 01/15/2025 or a later date. | `registerMessages()` only |
1467
+ | `datePicker.tooLate` | Choose 01/15/2025 or an earlier date. | `registerMessages()` only |
1468
+
1469
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
1470
+
1471
+ | Action | Default keys | What it does |
1472
+ |---|---|---|
1473
+ | `activate` | Enter, Space | On the input: opens or closes the calendar; opening focuses the selected day, else today. With typed text, Enter takes the text instead. |
1474
+ | `open` | Down Arrow | On the input: opens the calendar, or moves into it when it is already open. |
1475
+ | `close` | Escape | Closes the calendar and returns focus to the input. |
1476
+
1477
+ The browser's own, not remappable: Tab (Moving focus out of the calendar closes it.)
1262
1478
 
1263
1479
  Example:
1264
1480
 
@@ -1335,6 +1551,7 @@ Markup: `<void-dialog open><void-dialog-title>Title</void-dialog-title><void-dia
1335
1551
  |---|---|---|---|
1336
1552
  | `aria-label` | `string` | | Accessible name when there is no `<void-dialog-title>` (prefer the title). |
1337
1553
  | `size` | `sm\|md\|lg` | `md` | Width of the dialog panel: `sm`, `md` (default) or `lg`. |
1554
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off, which leaves a modal with no keyboard exit. See the keyboard guide. |
1338
1555
  | `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
1556
  | `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
1557
 
@@ -1343,6 +1560,20 @@ Markup: `<void-dialog open><void-dialog-title>Title</void-dialog-title><void-dia
1343
1560
  | `void-open` | `{ reason: 'api' }` | The dialog opened. `detail.reason` is `api` (attribute or property). |
1344
1561
  | `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
1562
 
1563
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
1564
+
1565
+ | Message | Default | Replaced by |
1566
+ |---|---|---|
1567
+ | `close` | Close | `registerMessages()` only |
1568
+
1569
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
1570
+
1571
+ | Action | Default keys | What it does |
1572
+ |---|---|---|
1573
+ | `close` (essential) | Escape | Closes the dialog (`void-close` with `reason` `escape`) and returns focus to the element that opened it, unless `hide-close` or a listener calls `preventDefault()` on `void-close`. With another overlay open inside it, only that overlay closes. |
1574
+
1575
+ The browser's own, not remappable: Tab, Shift + Tab (Move between the focusable elements inside the dialog, then on to the browser's own interface and back in; the page behind it cannot be reached.); Enter, Space (on the close button) (Closes the dialog and returns focus to the opener.)
1576
+
1346
1577
  Attributes that do not exist (and what to write instead):
1347
1578
 
1348
1579
  - `heading`: write the title as the first child: <void-dialog-title>...</void-dialog-title>
@@ -1462,8 +1693,10 @@ Example:
1462
1693
  ## `<void-donut-chart>`
1463
1694
 
1464
1695
  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.
1696
+ centre. Give it `data` (`{ segments: [{ name, value }] }`) as the `data` property or as JSON in the `data`
1697
+ attribute, so server-rendered markup draws it with no script; it has no children. The drawing is hidden
1698
+ from assistive technology and a visually hidden data table (captioned with `aria-label`) carries the
1699
+ values instead; add `show-table` to show the table below the chart too.
1467
1700
 
1468
1701
  | Attribute | Values | Default | Description |
1469
1702
  |---|---|---|---|
@@ -1473,18 +1706,23 @@ image to assistive technology, so set `aria-label` and state the key figures in
1473
1706
  | `variant` | `filled\|outline\|wireframe` | `filled` | How segments are drawn: `filled` (default), `outline` (tinted with a border) or `wireframe` (border only). |
1474
1707
  | `show-value` | `boolean` | `false` | Print each segment's value on its arc, abbreviated above 1000 (`1.2k`). |
1475
1708
  | `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. |
1709
+ | `aria-label` | `string` | | Accessible name of the chart, such as `Traffic by source`; it is also the caption of the data table. Set it: the drawing itself is hidden from assistive technology. |
1710
+ | `show-table` | `boolean` | `false` | Show the data table (one row per segment: name, value and share) below the chart. The table is always there for assistive technology; this makes it visible too. |
1711
+ | `data` | `DonutChartData` | `{ segments: [] }` | The chart's data: `{ segments: [{ name, value, color? }] }`. Each segment's share of the ring is its `value` over the sum of all values. Give it as a property (assign a new object to update the chart and animate to it) or as JSON in the `data` attribute: `<void-donut-chart data='{"segments":[{"name":"Search","value":40},{"name":"Direct","value":25}]}'>`. Invalid JSON draws nothing and is reported by `@voidable/ui/dev`. The property is not reflected to the attribute (the data can be large), and an attribute a server morph leaves unchanged does not animate again. |
1477
1712
 
1478
- Properties with no attribute (set in JavaScript):
1713
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
1479
1714
 
1480
- | Property | Type | Description |
1715
+ | Message | Default | Replaced by |
1481
1716
  |---|---|---|
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. |
1717
+ | `chart.donut` | Donut chart | `aria-label` |
1718
+ | `chart.segment` | Segment | `registerMessages()` only |
1719
+ | `chart.value` | Value | `registerMessages()` only |
1720
+ | `chart.share` | Share | `registerMessages()` only |
1483
1721
 
1484
1722
  Example:
1485
1723
 
1486
1724
  ```html
1487
- <void-donut-chart aria-label="Traffic by source" show-total show-value></void-donut-chart>
1725
+ <void-donut-chart aria-label="Traffic by source" show-total show-value data='{"segments":[{"name":"Search","value":540},{"name":"Direct","value":320},{"name":"Referral","value":180}]}'></void-donut-chart>
1488
1726
  ```
1489
1727
 
1490
1728
  ## `<void-drawer>`
@@ -1512,6 +1750,7 @@ Markup: `<void-drawer open><void-drawer-title>Title</void-drawer-title><void-dra
1512
1750
  | `aria-label` | `string` | | Accessible name when there is no `<void-drawer-title>` (prefer the title). |
1513
1751
  | `side` | `left\|right\|start\|end\|top\|bottom` | `right` | Edge the drawer slides in from: `right` (default), `left`, `top` or `bottom` (the screen edges), or `start` or `end` (the side the text starts or ends on, so they swap in right-to-left). |
1514
1752
  | `size` | `sm\|md\|lg` | `md` | Width of a side drawer, or height of a top or bottom one: `sm`, `md` (default) or `lg`. |
1753
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off, which leaves a modal with no keyboard exit. See the keyboard guide. |
1515
1754
  | `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
1755
  | `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
1756
 
@@ -1520,6 +1759,20 @@ Markup: `<void-drawer open><void-drawer-title>Title</void-drawer-title><void-dra
1520
1759
  | `void-open` | `{ reason: 'api' }` | The drawer opened. |
1521
1760
  | `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
1761
 
1762
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
1763
+
1764
+ | Message | Default | Replaced by |
1765
+ |---|---|---|
1766
+ | `close` | Close | `registerMessages()` only |
1767
+
1768
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
1769
+
1770
+ | Action | Default keys | What it does |
1771
+ |---|---|---|
1772
+ | `close` (essential) | Escape | Closes the drawer (`void-close` with `reason` `escape`) and returns focus to the element that opened it, unless `hide-close` or a listener calls `preventDefault()` on `void-close`. |
1773
+
1774
+ The browser's own, not remappable: Tab, Shift + Tab (Move between the focusable elements inside the drawer, then on to the browser's own interface and back in; the page behind it cannot be reached.); Enter, Space (on the close button) (Closes the drawer and returns focus to the opener.)
1775
+
1523
1776
  Attributes that do not exist (and what to write instead):
1524
1777
 
1525
1778
  - `heading`: write the title as the first child: <void-drawer-title>...</void-drawer-title>
@@ -1657,6 +1910,7 @@ Markup: `<void-dropdown-menu><void-dropdown-menu-trigger><void-button>Actions</v
1657
1910
 
1658
1911
  | Attribute | Values | Default | Description |
1659
1912
  |---|---|---|---|
1913
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":[]}`); `[]` switches an action off. See the keyboard guide. |
1660
1914
  | `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
1915
  | `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
1916
  | `align` | `start\|center\|end` | `start` | Alignment with the trigger along that side. |
@@ -1667,6 +1921,21 @@ Markup: `<void-dropdown-menu><void-dropdown-menu-trigger><void-button>Actions</v
1667
1921
  | `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
1922
  | `void-select` | `{ item: VoidDropdownMenuItem; value: string }` | Bubbles from a child `<void-dropdown-menu-item>`. |
1669
1923
 
1924
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
1925
+
1926
+ | Action | Default keys | What it does |
1927
+ |---|---|---|
1928
+ | `open` | Down Arrow | On the trigger: opens the menu and focuses the first item. |
1929
+ | `openLast` | Up Arrow | On the trigger: opens the menu and focuses the last item. |
1930
+ | `activate` | Enter, Space | On the trigger: opens the menu and focuses the first item (a second press closes it). A `<void-button>` or any other non-native trigger is supported. |
1931
+ | `next` | Down Arrow | In the menu: moves to the next item (wraps, skips disabled items). |
1932
+ | `previous` | Up Arrow | In the menu: moves to the previous item (wraps, skips disabled items). |
1933
+ | `first` | Home | In the menu: moves to the first item. |
1934
+ | `last` | End | In the menu: moves to the last item. |
1935
+ | `typeahead` | Characters | In the menu: jumps to the next item that starts with the typed text. |
1936
+ | `close` | Escape | Closes the menu and returns focus to the trigger. |
1937
+ | `leave` | Tab, Shift + Tab | In the menu: closes it and moves focus on to the next element; focus does not return to the trigger. |
1938
+
1670
1939
  Example:
1671
1940
 
1672
1941
  ```html
@@ -1715,6 +1984,7 @@ Space) dispatches `void-select` and closes the menu, unless it has `keep-open`.
1715
1984
 
1716
1985
  | Attribute | Values | Default | Description |
1717
1986
  |---|---|---|---|
1987
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
1718
1988
  | `value` | `string` | | What the item stands for, passed as `detail.value` of `void-select` (empty when not set). |
1719
1989
  | `disabled` | `boolean` | `false` | Dim the item, skip it in keyboard navigation and stop it firing `void-select`. |
1720
1990
  | `destructive` | `boolean` | `false` | Draw the item in the error colour, for an action that deletes or cannot be undone. |
@@ -1724,6 +1994,12 @@ Space) dispatches `void-select` and closes the menu, unless it has `keep-open`.
1724
1994
  |---|---|---|
1725
1995
  | `void-select` | `{ item: VoidDropdownMenuItem; value: string }` | The item was chosen. |
1726
1996
 
1997
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
1998
+
1999
+ | Action | Default keys | What it does |
2000
+ |---|---|---|
2001
+ | `activate` (essential) | Enter, Space | Activates the item (`void-select`), closes the menu and returns focus to the trigger. An item with `keep-open` fires `void-select` and leaves the menu open. |
2002
+
1727
2003
  Allowed inside: `<void-dropdown-menu-content>`.
1728
2004
 
1729
2005
  Example:
@@ -1792,10 +2068,11 @@ the previous value. Use `both` (default) or `blur` to commit on blur.
1792
2068
 
1793
2069
  | Attribute | Values | Default | Description |
1794
2070
  |---|---|---|---|
2071
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"cancel":[]}`); `[]` switches an action off. See the keyboard guide. |
1795
2072
  | `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
2073
  | `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
2074
  | `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`. |
2075
+ | `placeholder` | `string` | | Text shown while the value is empty and the field is not being edited. Defaults to the `editable.placeholder` message (English: `Click to edit`). |
1799
2076
  | `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
2077
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
1801
2078
  | `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. |
@@ -1807,6 +2084,21 @@ the previous value. Use `both` (default) or `blur` to commit on blur.
1807
2084
  | `void-cancel` | `(no detail)` | |
1808
2085
  | `void-input` | `{ value: unknown }` | |
1809
2086
 
2087
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
2088
+
2089
+ | Message | Default | Replaced by |
2090
+ |---|---|---|
2091
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
2092
+ | `editable.placeholder` | Click to edit | `placeholder` |
2093
+
2094
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
2095
+
2096
+ | Action | Default keys | What it does |
2097
+ |---|---|---|
2098
+ | `activate` (essential) | Enter, Space | On the preview: starts editing. |
2099
+ | `submit` | Enter | In the field: commits the text (with `submit-mode` `enter` or `both`). |
2100
+ | `cancel` | Escape | In the field: discards the edit and shows the preview again. |
2101
+
1810
2102
  Example:
1811
2103
 
1812
2104
  ```html
@@ -1861,16 +2153,23 @@ Markup: `<void-error-fallback><void-error-fallback-title>Could not load invoices
1861
2153
 
1862
2154
  | Attribute | Values | Default | Description |
1863
2155
  |---|---|---|---|
1864
- | `heading` | `string` | `Something went wrong` | Headline of the built-in default. Defaults to `Something went wrong`. Ignored when the author writes parts. |
2156
+ | `heading` | `string` | | Headline of the built-in default. Defaults to the `errorFallback.heading` message (English: `Something went wrong`). Ignored when the author writes parts. |
1865
2157
  | `message` | `string` | | Detail shown under the headline in the built-in default, such as what failed or what to try. Optional. |
1866
2158
  | `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`. |
2159
+ | `retry-label` | `string` | | Text of the built-in retry button. Defaults to the `errorFallback.retry` message (English: `Try again`). Only used with `retryable`. |
1868
2160
  | `hide-icon` | `boolean` | `false` | Leave out the warning icon above the headline (it is drawn by default). |
1869
2161
 
1870
2162
  | Event | `detail` | Description |
1871
2163
  |---|---|---|
1872
2164
  | `void-retry` | `(no detail)` | The built-in retry button was pressed (the element retries nothing itself). |
1873
2165
 
2166
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
2167
+
2168
+ | Message | Default | Replaced by |
2169
+ |---|---|---|
2170
+ | `errorFallback.heading` | Something went wrong | `heading` |
2171
+ | `errorFallback.retry` | Try again | `retry-label` |
2172
+
1874
2173
  Example:
1875
2174
 
1876
2175
  ```html
@@ -2023,18 +2322,38 @@ Drag-and-drop file picker for document uploads, image attachment flows, and impo
2023
2322
 
2024
2323
  | Attribute | Values | Default | Description |
2025
2324
  |---|---|---|---|
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. |
2325
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
2326
+ | `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 not taken: `void-reject` fires with reason `type` and the zone shows an error. |
2027
2327
  | `multiple` | `boolean` | `false` | Allow more than one file. Without it a new choice replaces the old one. |
2028
2328
  | `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. |
2329
+ | `max-size` | `number` | `0` | Largest allowed file in bytes. 0 (the default) means no limit. Larger files are rejected with reason `size`. |
2330
+ | `error` | `string` | | Error message shown under the zone; while it is set the drop zone is `aria-invalid` and described by it. Set it for a server-side upload failure. The zone also sets it itself when it rejects a file (see `void-reject`) and clears what it set on the next accepted selection; a message you set is left alone. |
2031
2331
  | `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
2332
  | `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
2033
2333
 
2034
2334
  | Event | `detail` | Description |
2035
2335
  |---|---|---|
2336
+ | `void-reject` | `{ rejected: { file: File; reason: 'type' \| 'size' \| 'count' }[] }` | Files were refused: one entry per file with the reason. Does not bubble. |
2036
2337
  | `void-change` | `{ value: File[]; files: File[] }` | |
2037
2338
 
2339
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
2340
+
2341
+ | Message | Default | Replaced by |
2342
+ |---|---|---|
2343
+ | `removeItem` | Remove report.pdf | `registerMessages()` only |
2344
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
2345
+ | `fileUpload.prompt` | Drop files here or browse | `registerMessages()` only |
2346
+ | `fileUpload.browse` | browse | `registerMessages()` only |
2347
+ | `fileUpload.rejectType` | report.pdf is not an accepted file type. | `registerMessages()` only |
2348
+ | `fileUpload.rejectSize` | report.pdf is larger than the limit of 5 MB. | `registerMessages()` only |
2349
+ | `fileUpload.rejectCount` | report.pdf was not added: only one file can be chosen. | `registerMessages()` only |
2350
+
2351
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
2352
+
2353
+ | Action | Default keys | What it does |
2354
+ |---|---|---|
2355
+ | `activate` (essential) | Enter, Space | Opens the file chooser (with the focus on the drop zone). |
2356
+
2038
2357
  Example:
2039
2358
 
2040
2359
  ```html
@@ -2068,19 +2387,26 @@ assistive technology, so set `aria-label` and state the figure in the surroundin
2068
2387
  | `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
2388
  | `segments-sort` | `value\|manual` | `value` | Order of segments around the arc: `value` (default, largest first) or `manual` (the order of `data.segments`). |
2070
2389
  | `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. |
2390
+ | `aria-label` | `string` | | Accessible name of the gauge, such as `Disk usage`; it is also the caption of the data table. Set it: the drawing itself is hidden from assistive technology. |
2391
+ | `show-table` | `boolean` | `false` | Show the data table (the reading with its range, or one row per segment) below the gauge. The table is always there for assistive technology; this makes it visible too. |
2392
+ | `zones` | `GaugeZone[]` | `[]` | Colour bands over the value range: an array of `{ from, to, color }`; the fill takes the colour of the zone containing the value. Give it as a property or as JSON in the `zones` attribute: `<void-gauge zones='[{"from":0,"to":60,"color":"green"},{"from":60,"to":100,"color":"red"}]'>`. Invalid JSON draws no zones and is reported by `@voidable/ui/dev`. Not reflected to the attribute. |
2393
+ | `data` | `GaugeData` | `{}` | Segmented data: `{ segments: [{ name, value, color? }] }` splits the arc between named parts; the optional `value` is the headline reading. Give it as a property (assign a new object to update the gauge and animate to it) or as JSON in the `data` attribute: `<void-gauge data='{"segments":[{"name":"Used","value":40},{"name":"Cache","value":15}]}'>`. Invalid JSON draws nothing and is reported by `@voidable/ui/dev`. The property is not reflected to the attribute, and an attribute a server morph leaves unchanged does not animate again. For a single reading, set the `value` attribute instead. |
2072
2394
 
2073
- Properties with no attribute (set in JavaScript):
2395
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
2074
2396
 
2075
- | Property | Type | Description |
2397
+ | Message | Default | Replaced by |
2076
2398
  |---|---|---|
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. |
2399
+ | `chart.gauge` | Gauge chart | `aria-label` |
2400
+ | `chart.segment` | Segment | `registerMessages()` only |
2401
+ | `chart.value` | Value | `registerMessages()` only |
2402
+ | `chart.share` | Share | `registerMessages()` only |
2403
+ | `chart.minimum` | Minimum | `registerMessages()` only |
2404
+ | `chart.maximum` | Maximum | `registerMessages()` only |
2079
2405
 
2080
2406
  Example:
2081
2407
 
2082
2408
  ```html
2083
- <void-gauge value="72" unit="%" circular="semi" aria-label="Disk usage"></void-gauge>
2409
+ <void-gauge value="72" unit="%" circular="semi" aria-label="Disk usage" zones='[{"from":0,"to":60,"color":"var(--void-color-success)"},{"from":60,"to":85,"color":"var(--void-color-warning)"},{"from":85,"to":100,"color":"var(--void-color-error)"}]'></void-gauge>
2084
2410
  ```
2085
2411
 
2086
2412
  ## `<void-glass>`
@@ -2117,20 +2443,36 @@ Example:
2117
2443
 
2118
2444
  Animated open/close toggle for mobile navigation menus and collapsible sidebars.
2119
2445
 
2446
+ Name it by what it opens: `aria-label="Main navigation"` (or `aria-labelledby`). Without one it is called "Menu" ("Close menu" while open).
2447
+
2120
2448
  | Attribute | Values | Default | Description |
2121
2449
  |---|---|---|---|
2450
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
2122
2451
  | `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
2452
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
2124
2453
 
2125
2454
  | Event | `detail` | Description |
2126
2455
  |---|---|---|
2127
- | `void-open` | `{ reason: 'trigger' }` | The user opened it (click, Enter or Space). Does not bubble. |
2456
+ | `void-open` | `{ reason: 'trigger' \| 'keyboard' }` | The user opened it: `trigger` for a click, `keyboard` for Enter or Space. Does not bubble. |
2128
2457
  | `void-close` | `{ reason: 'trigger' }` | The user closed it. Does not bubble. |
2129
2458
 
2459
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
2460
+
2461
+ | Message | Default | Replaced by |
2462
+ |---|---|---|
2463
+ | `hamburger.open` | Menu | `aria-label` |
2464
+ | `hamburger.close` | Close menu | `aria-label` |
2465
+
2466
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
2467
+
2468
+ | Action | Default keys | What it does |
2469
+ |---|---|---|
2470
+ | `activate` (essential) | Enter, Space | Opens or closes the navigation it controls. |
2471
+
2130
2472
  Example:
2131
2473
 
2132
2474
  ```html
2133
- <void-hamburger></void-hamburger>
2475
+ <void-hamburger aria-label="Main navigation"></void-hamburger>
2134
2476
  ```
2135
2477
 
2136
2478
  ## `<void-hover-card>`
@@ -2155,6 +2497,7 @@ Markup: `<void-hover-card><void-hover-card-trigger><a href="/users/ada">@ada</a>
2155
2497
 
2156
2498
  | Attribute | Values | Default | Description |
2157
2499
  |---|---|---|---|
2500
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. |
2158
2501
  | `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
2502
  | `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
2503
  | `align` | `start\|center\|end` | `center` | Alignment with the trigger along that side. |
@@ -2166,6 +2509,14 @@ Markup: `<void-hover-card><void-hover-card-trigger><a href="/users/ada">@ada</a>
2166
2509
  | `void-open` | `{ reason: 'hover' \| 'focus' \| 'api' }` | The card opened. |
2167
2510
  | `void-close` | `{ reason: 'hover' \| 'blur' \| 'escape' \| 'parent' \| 'api' }` | The card is closing. Cancelable when the user caused it. |
2168
2511
 
2512
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
2513
+
2514
+ | Action | Default keys | What it does |
2515
+ |---|---|---|
2516
+ | `close` | Escape | Closes the card; focus stays on the trigger and does not reopen it. |
2517
+
2518
+ The browser's own, not remappable: Tab (onto the trigger) (Opens the card at once, without the `open-delay`.); Tab (into the card) (Reach links and controls inside the open card; the card closes after `close-delay` once focus has left both trigger and card.)
2519
+
2169
2520
  Example:
2170
2521
 
2171
2522
  ```html
@@ -2227,6 +2578,13 @@ Badge overlay for notification counts on icons and online presence signals on av
2227
2578
  | `ping` | `boolean` | `false` | Draw an expanding ring around the dot to draw attention. It is not drawn when the user prefers reduced motion. |
2228
2579
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
2229
2580
 
2581
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
2582
+
2583
+ | Message | Default | Replaced by |
2584
+ |---|---|---|
2585
+ | `indicator.label` | notification | `aria-label` |
2586
+ | `indicator.count` | 5 notifications | `aria-label` |
2587
+
2230
2588
  Example:
2231
2589
 
2232
2590
  ```html
@@ -2280,8 +2638,10 @@ Example:
2280
2638
  ## `<void-line-chart>`
2281
2639
 
2282
2640
  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.
2641
+ entry. Give it `data` (`{ series: [{ name, values }], labels }`) as the `data` property or as JSON in the
2642
+ `data` attribute, so server-rendered markup draws it with no script; it has no children. The drawing is
2643
+ hidden from assistive technology and a visually hidden data table (captioned with `aria-label`) carries
2644
+ the values instead; add `show-table` to show the table below the chart too.
2285
2645
 
2286
2646
  | Attribute | Values | Default | Description |
2287
2647
  |---|---|---|---|
@@ -2289,18 +2649,21 @@ is an image to assistive technology, so set `aria-label` and state the key figur
2289
2649
  | `show-value` | `boolean` | `false` | Print each point's value above it, abbreviated above 1000 (`1.2k`). |
2290
2650
  | `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
2651
  | `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. |
2652
+ | `aria-label` | `string` | | Accessible name of the chart, such as `Visitors per day`; it is also the caption of the data table. Set it: the drawing itself is hidden from assistive technology. |
2653
+ | `show-table` | `boolean` | `false` | Show the data table (one row per point, one column per series) below the chart. The table is always there for assistive technology; this makes it visible too. |
2654
+ | `data` | `LineChartData` | `{ series: [] }` | 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. Give it as a property (assign a new object to update the chart and animate to it) or as JSON in the `data` attribute: `<void-line-chart data='{"series":[{"name":"Visitors","values":[3,5,4]}],"labels":["Mon","Tue","Wed"]}'>`. Invalid JSON draws nothing and is reported by `@voidable/ui/dev`. The property is not reflected to the attribute (the data can be large), and an attribute a server morph leaves unchanged does not animate again. |
2293
2655
 
2294
- Properties with no attribute (set in JavaScript):
2656
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
2295
2657
 
2296
- | Property | Type | Description |
2658
+ | Message | Default | Replaced by |
2297
2659
  |---|---|---|
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. |
2660
+ | `chart.line` | Line chart | `aria-label` |
2661
+ | `chart.label` | Label | `registerMessages()` only |
2299
2662
 
2300
2663
  Example:
2301
2664
 
2302
2665
  ```html
2303
- <void-line-chart aria-label="Visitors per day" height="240"></void-line-chart>
2666
+ <void-line-chart aria-label="Visitors per day" height="240" data='{"labels":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"series":[{"name":"Visitors","values":[320,410,380,520,610,450,390]}]}'></void-line-chart>
2304
2667
  ```
2305
2668
 
2306
2669
  ## `<void-list>`
@@ -2434,6 +2797,7 @@ Markup: `<void-menu open><void-menu-search><input type="search" placeholder="Sea
2434
2797
 
2435
2798
  | Attribute | Values | Default | Description |
2436
2799
  |---|---|---|---|
2800
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":[]}`); `[]` switches an action off. See the keyboard guide. |
2437
2801
  | `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
2802
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
2439
2803
 
@@ -2441,6 +2805,24 @@ Markup: `<void-menu open><void-menu-search><input type="search" placeholder="Sea
2441
2805
  |---|---|---|
2442
2806
  | `void-select` | `{ item: VoidMenuItem; value: string }` | Bubbles from a child `<void-menu-item>`. |
2443
2807
 
2808
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
2809
+
2810
+ | Message | Default | Replaced by |
2811
+ |---|---|---|
2812
+ | `menu.label` | Menu | `aria-label` |
2813
+ | `menu.empty` | No results found | a `<void-menu-empty>` part you write |
2814
+
2815
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
2816
+
2817
+ | Action | Default keys | What it does |
2818
+ |---|---|---|
2819
+ | `next` | Down Arrow | Moves focus to the next item (wraps). From a search field, goes to the first item. |
2820
+ | `previous` | Up Arrow | Moves focus to the previous item (wraps). From a search field, goes to the last item; from the first item with a `<void-menu-search>`, returns to the search field. |
2821
+ | `first` | Home | Moves focus to the first item. |
2822
+ | `last` | End | Moves focus to the last item. |
2823
+ | `typeahead` | Characters | Jumps to the next item that starts with the typed text (not in a `<void-menu-search>`, where typing filters). |
2824
+ | `close` | Escape | Closes the menu. |
2825
+
2444
2826
  Attributes that do not exist (and what to write instead):
2445
2827
 
2446
2828
  - `searchable`: write a <void-menu-search> around an <input type="search"> before the content
@@ -2615,6 +2997,7 @@ Markup: `<void-menu-item value="save"><void-menu-item-icon>+</void-menu-item-ico
2615
2997
 
2616
2998
  | Attribute | Values | Default | Description |
2617
2999
  |---|---|---|---|
3000
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
2618
3001
  | `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
3002
  | `disabled` | `boolean` | `false` | Dim the item, skip it in keyboard navigation and stop it firing `void-select`. |
2620
3003
 
@@ -2622,6 +3005,12 @@ Markup: `<void-menu-item value="save"><void-menu-item-icon>+</void-menu-item-ico
2622
3005
  |---|---|---|
2623
3006
  | `void-select` | `{ item: VoidMenuItem; value: string }` | The item was chosen. |
2624
3007
 
3008
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
3009
+
3010
+ | Action | Default keys | What it does |
3011
+ |---|---|---|
3012
+ | `activate` (essential) | Enter, Space | Activates the item (`void-select`). |
3013
+
2625
3014
  Allowed inside: `<void-menu-group>`, `<void-menu-content>`.
2626
3015
 
2627
3016
  Attributes that do not exist (and what to write instead):
@@ -2763,7 +3152,8 @@ Markup: `<void-multiselect name="skills" placeholder="Choose skills"><void-multi
2763
3152
 
2764
3153
  | Attribute | Values | Default | Description |
2765
3154
  |---|---|---|---|
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. |
3155
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. |
3156
+ | `placeholder` | `string` | | Text shown in the trigger while nothing is selected. Defaults to the `multiselect.placeholder` message (English: `Select...`). It is also the trigger's accessible name when no `void-field` label names it. |
2767
3157
  | `disabled` | `boolean` | `false` | Stop the trigger opening and exclude the values from the form submission. |
2768
3158
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
2769
3159
  | `error` | `string` | | Mark the control invalid: it gets the error styling and `aria-invalid`. The message itself is shown by the wrapping `void-field`. |
@@ -2778,6 +3168,31 @@ Markup: `<void-multiselect name="skills" placeholder="Choose skills"><void-multi
2778
3168
  | `void-open` | `{ reason: 'trigger' \| 'keyboard' \| 'api' }` | The option list opened. |
2779
3169
  | `void-close` | `{ reason: 'trigger' \| 'escape' \| 'outside' \| 'blur' \| 'parent' \| 'api' }` | The option list is closing. |
2780
3170
 
3171
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
3172
+
3173
+ | Message | Default | Replaced by |
3174
+ |---|---|---|
3175
+ | `removeItem` | Remove report.pdf | `registerMessages()` only |
3176
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
3177
+ | `multiselect.placeholder` | Select... | `placeholder` |
3178
+ | `multiselect.selected` | 5 selected | `registerMessages()` only |
3179
+
3180
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
3181
+
3182
+ | Action | Default keys | What it does |
3183
+ |---|---|---|
3184
+ | `next` | Down Arrow | Highlights the next option; stops at the ends. Closed: opens the list on the first selected option, else the first. |
3185
+ | `previous` | Up Arrow | Highlights the previous option; stops at the ends. Closed: opens the list on the first option. |
3186
+ | `first` | Home | Highlights the first option. Closed: opens the list there. |
3187
+ | `last` | End | Highlights the last option. Closed: opens the list there. |
3188
+ | `nextPage` | Page Down | Moves the highlight ten options on. |
3189
+ | `previousPage` | Page Up | Moves the highlight ten options back. |
3190
+ | `activate` (essential) | Enter, Space | Toggles the highlighted option; the list stays open. Closed: opens the list on the first selected option, else the first. |
3191
+ | `typeahead` | Characters | Jumps to the next option that starts with the typed text. Closed: opens the list there. |
3192
+ | `close` | Escape, Alt + Up Arrow | Closes the list (a second Escape reaches an enclosing dialog). |
3193
+
3194
+ The browser's own, not remappable: Tab (Closes the list and moves on.)
3195
+
2781
3196
  Example:
2782
3197
 
2783
3198
  ```html
@@ -2823,6 +3238,11 @@ nothing rendered. Use the patterns beside it for the usual contents: `<void-bran
2823
3238
  `<void-nav-links>` for the links (mark the current page with `aria-current="page"`) and `<void-spacer>` to
2824
3239
  push what follows to the far end.
2825
3240
 
3241
+ The bar is a `navigation` landmark. Where the page already has one around it (the bar sits inside a `<nav>`
3242
+ or an element with a navigation or other role of its own) or inside it (the links are already in a `<nav>`),
3243
+ it adds nothing, so landmarks never nest; a role you write on it is kept. When a page has more than one
3244
+ navigation landmark, give each an `aria-label` (`<void-nav-bar aria-label="Primary">`); with one, a name is optional.
3245
+
2826
3246
  | Attribute | Values | Default | Description |
2827
3247
  |---|---|---|---|
2828
3248
  | `sticky` | `boolean` | `false` | Stay at the top of the viewport while the page scrolls. |
@@ -2882,9 +3302,20 @@ Markup: `<void-nav-menu><void-nav-menu-item><void-nav-menu-trigger><button type=
2882
3302
 
2883
3303
  | Attribute | Values | Default | Description |
2884
3304
  |---|---|---|---|
3305
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":[]}`); `[]` switches an action off. See the keyboard guide. |
2885
3306
  | `orientation` | `horizontal\|vertical` | `horizontal` | `horizontal` (default) lays the items out in a row with Left and Right arrow keys; `vertical` stacks them. |
2886
3307
  | `width` | `string` | | CSS width of the menu, such as `100%` or `40rem`. By default it is as wide as its items. |
2887
3308
 
3309
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
3310
+
3311
+ | Action | Default keys | What it does |
3312
+ |---|---|---|
3313
+ | `next` | Right Arrow (Left Arrow in right-to-left text) | Moves focus to the next entry, wrapping at the ends. In right-to-left pages the horizontal default is Left Arrow. |
3314
+ | `previous` | Left Arrow (Right Arrow in right-to-left text) | Moves focus to the previous entry, wrapping at the ends. |
3315
+ | `close` | Escape | Closes the open panel and returns focus to its entry. |
3316
+
3317
+ The browser's own, not remappable: Enter, Space (On a button entry, opens or closes its panel; on a link, follows it.)
3318
+
2888
3319
  Example:
2889
3320
 
2890
3321
  ```html
@@ -3004,6 +3435,7 @@ name, which `<void-field>` supplies), and the stepper buttons are its own button
3004
3435
 
3005
3436
  | Attribute | Values | Default | Description |
3006
3437
  |---|---|---|---|
3438
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"increment":["ArrowUp","k"]}`); `[]` switches an action off. See the keyboard guide. |
3007
3439
  | `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
3440
  | `min` | `number` | `Number.NEGATIVE_INFINITY` | Lowest allowed value. Unbounded by default. |
3009
3441
  | `max` | `number` | `Number.POSITIVE_INFINITY` | Highest allowed value. Unbounded by default. |
@@ -3015,7 +3447,7 @@ name, which `<void-field>` supplies), and the stepper buttons are its own button
3015
3447
  | `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
3016
3448
  | `placeholder` | `string` | | Hint text shown while the field is empty. |
3017
3449
  | `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. |
3450
+ | `label` | `string` | | Accessible name of the field when it is not inside a `void-field`. Defaults to the `numberInput.label` message (English: `Number input`), so set it. |
3019
3451
  | `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
3452
  | `unit` | `string` | | Text drawn after the number inside the field, such as `kg`. Display only; it is not part of the value. |
3021
3453
  | `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. |
@@ -3026,6 +3458,24 @@ name, which `<void-field>` supplies), and the stepper buttons are its own button
3026
3458
  | `void-change` | `{ value: null \| number; previous: number \| null }` | |
3027
3459
  | `void-input` | `{ value: number \| null }` | |
3028
3460
 
3461
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
3462
+
3463
+ | Message | Default | Replaced by |
3464
+ |---|---|---|
3465
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
3466
+ | `numberInput.label` | Number input | `label` |
3467
+ | `numberInput.decrement` | Decrement | `registerMessages()` only |
3468
+ | `numberInput.increment` | Increment | `registerMessages()` only |
3469
+
3470
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
3471
+
3472
+ | Action | Default keys | What it does |
3473
+ |---|---|---|
3474
+ | `increment` | Up Arrow | Increases the value by `step` (by 1 when `step="any"`). |
3475
+ | `decrement` | Down Arrow | Decreases the value by `step` (by 1 when `step="any"`). |
3476
+
3477
+ The browser's own, not remappable: Digits, minus sign, Backspace, Delete, Left Arrow, Right Arrow (Edit the text, in the native field.)
3478
+
3029
3479
  Example:
3030
3480
 
3031
3481
  ```html
@@ -3137,6 +3587,14 @@ Page navigation for data tables, search result lists, and content archives.
3137
3587
  |---|---|---|
3138
3588
  | `void-change` | `{ value: number }` | |
3139
3589
 
3590
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
3591
+
3592
+ | Message | Default | Replaced by |
3593
+ |---|---|---|
3594
+ | `pagination.label` | Pagination | `registerMessages()` only |
3595
+ | `pagination.previous` | Previous page | `registerMessages()` only |
3596
+ | `pagination.next` | Next page | `registerMessages()` only |
3597
+
3140
3598
  Example:
3141
3599
 
3142
3600
  ```html
@@ -3280,6 +3738,7 @@ Single-character input cells for OTP verification codes, PIN entry, and multi-di
3280
3738
 
3281
3739
  | Attribute | Values | Default | Description |
3282
3740
  |---|---|---|---|
3741
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"previous":["ArrowLeft"]}`); `[]` switches an action off. See the keyboard guide. |
3283
3742
  | `length` | `number` | `6` | Number of cells, so the number of characters in the code. Defaults to 6. |
3284
3743
  | `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
3744
  | `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. |
@@ -3298,6 +3757,23 @@ Single-character input cells for OTP verification codes, PIN entry, and multi-di
3298
3757
  | `void-complete` | `{ value: string }` | Every cell is filled. |
3299
3758
  | `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
3759
 
3760
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
3761
+
3762
+ | Message | Default | Replaced by |
3763
+ |---|---|---|
3764
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
3765
+ | `pinInput.label` | PIN input | `aria-label` |
3766
+ | `pinInput.digit` | Digit 2 of 5 | `registerMessages()` only |
3767
+
3768
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
3769
+
3770
+ | Action | Default keys | What it does |
3771
+ |---|---|---|
3772
+ | `previous` | Left Arrow (Right Arrow in right-to-left text) | Moves to the previous cell. In right-to-left pages the default is Right Arrow. |
3773
+ | `next` | Right Arrow (Left Arrow in right-to-left text) | Moves to the next cell. In right-to-left pages the default is Left Arrow. |
3774
+ | `deleteBackward` | Backspace | Clears the cell; in an empty cell, moves to the previous cell and clears it. |
3775
+ | `deleteForward` | Delete | Clears the cell. |
3776
+
3301
3777
  Example:
3302
3778
 
3303
3779
  ```html
@@ -3330,6 +3806,7 @@ Markup: `<void-popover><void-popover-trigger><void-button>Details</void-button><
3330
3806
 
3331
3807
  | Attribute | Values | Default | Description |
3332
3808
  |---|---|---|---|
3809
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. |
3333
3810
  | `open` | `boolean` | `false` | Whether the popover is open. |
3334
3811
  | `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
3812
  | `align` | `start\|center\|end` | `start` | Alignment with the trigger along that side. |
@@ -3340,6 +3817,14 @@ Markup: `<void-popover><void-popover-trigger><void-button>Details</void-button><
3340
3817
  | `void-open` | `{ reason: 'trigger' \| 'api' }` | The popover opened. |
3341
3818
  | `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
3819
 
3820
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
3821
+
3822
+ | Action | Default keys | What it does |
3823
+ |---|---|---|
3824
+ | `close` | Escape | Closes the popover and returns focus to the trigger. |
3825
+
3826
+ The browser's own, not remappable: Enter, Space (on the trigger) (Toggle the popover (with `trigger="click"`); opening it moves focus to its first focusable element.); Tab, Shift + Tab (Move through the popover's content; moving focus out of the popover closes it.)
3827
+
3343
3828
  Example:
3344
3829
 
3345
3830
  ```html
@@ -3413,6 +3898,7 @@ Single mutually exclusive option for forms and surveys; typically used inside Vo
3413
3898
 
3414
3899
  | Attribute | Values | Default | Description |
3415
3900
  |---|---|---|---|
3901
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"next":["ArrowRight"]}`); `[]` switches an action off. See the keyboard guide. |
3416
3902
  | `checked` | `boolean` | `false` | Whether this radio is the selected one. Checking one radio unchecks the others with the same `name`. |
3417
3903
  | `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
3904
  | `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. |
@@ -3426,6 +3912,16 @@ Single mutually exclusive option for forms and surveys; typically used inside Vo
3426
3912
  |---|---|---|
3427
3913
  | `void-change` | `{ value: string; checked: boolean }` | |
3428
3914
 
3915
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
3916
+
3917
+ | Action | Default keys | What it does |
3918
+ |---|---|---|
3919
+ | `next` | Right Arrow (Left Arrow in right-to-left text), Down Arrow | Checks the next enabled radio of the group (wraps) and moves focus to it. In right-to-left pages the default inline key is Left Arrow (Down Arrow does not swap). |
3920
+ | `previous` | Left Arrow (Right Arrow in right-to-left text), Up Arrow | Checks the previous enabled radio of the group (wraps) and moves focus to it. |
3921
+ | `activate` | Space | Checks the focused radio if it is not checked. |
3922
+
3923
+ The browser's own, not remappable: Tab (Moves into the group on the checked radio, or the first enabled one while none is checked, and out of it on the next press.); Shift + Tab (Moves into the group on the checked radio, or the last enabled one while none is checked (as native radios do).)
3924
+
3429
3925
  Example:
3430
3926
 
3431
3927
  ```html
@@ -3456,6 +3952,16 @@ elements, whose native radios submit; the group itself submits nothing.
3456
3952
  |---|---|---|
3457
3953
  | `void-change` | `{ value: string }` | |
3458
3954
 
3955
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
3956
+
3957
+ | Action | Default keys | What it does |
3958
+ |---|---|---|
3959
+ | `next` | Right Arrow (Left Arrow in right-to-left text), Down Arrow | Checks the next enabled radio of the group (wraps) and moves focus to it. In right-to-left pages the default inline key is Left Arrow (Down Arrow does not swap). |
3960
+ | `previous` | Left Arrow (Right Arrow in right-to-left text), Up Arrow | Checks the previous enabled radio of the group (wraps) and moves focus to it. |
3961
+ | `activate` | Space | Checks the focused radio if it is not checked. |
3962
+
3963
+ The browser's own, not remappable: Tab (Moves into the group on the checked radio, or the first enabled one while none is checked, and out of it on the next press.); Shift + Tab (Moves into the group on the checked radio, or the last enabled one while none is checked (as native radios do).)
3964
+
3459
3965
  Example:
3460
3966
 
3461
3967
  ```html
@@ -3570,7 +4076,7 @@ Example:
3570
4076
  <h2>Upcoming passes</h2>
3571
4077
  <span data-void-type="label">Next 6 hours</span>
3572
4078
  </void-section-head>
3573
- <void-table>
4079
+ <void-table aria-label="Upcoming passes">
3574
4080
  <table>
3575
4081
  <thead><tr><th>Satellite</th><th data-numeric>Starts in</th></tr></thead>
3576
4082
  <tbody><tr><td>MRD-0412</td><td data-numeric>14 min</td></tr></tbody>
@@ -3607,6 +4113,7 @@ items; with nothing selected, the first or the last); Space selects the focused
3607
4113
 
3608
4114
  | Attribute | Values | Default | Description |
3609
4115
  |---|---|---|---|
4116
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"next":["ArrowRight"]}`); `[]` switches an action off. See the keyboard guide. |
3610
4117
  | `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
4118
  | `disabled` | `boolean` | `false` | Stop the whole control reacting and exclude the value from the form submission. |
3612
4119
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
@@ -3618,6 +4125,21 @@ items; with nothing selected, the first or the last); Space selects the focused
3618
4125
  |---|---|---|
3619
4126
  | `void-change` | `{ value: string }` | |
3620
4127
 
4128
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
4129
+
4130
+ | Message | Default | Replaced by |
4131
+ |---|---|---|
4132
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
4133
+
4134
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
4135
+
4136
+ | Action | Default keys | What it does |
4137
+ |---|---|---|
4138
+ | `next` | Right Arrow (Left Arrow in right-to-left text), Down Arrow | Selects the next item (wraps). With nothing selected, the first. In right-to-left pages the default inline key is Left Arrow (Down Arrow does not swap). |
4139
+ | `previous` | Left Arrow (Right Arrow in right-to-left text), Up Arrow | Selects the previous item (wraps). With nothing selected, the last. |
4140
+
4141
+ The browser's own, not remappable: Tab, Shift + Tab (Move into and out of the group.)
4142
+
3621
4143
  Needs at least one: `<void-segmented-control-item>`.
3622
4144
 
3623
4145
  Example:
@@ -3636,9 +4158,16 @@ Individual option within a VoidSegmentedControl button group.
3636
4158
 
3637
4159
  | Attribute | Values | Default | Description |
3638
4160
  |---|---|---|---|
4161
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Space"]}`); `[]` switches an action off. See the keyboard guide. |
3639
4162
  | `value` | `string` | | What the parent reports and submits when this segment is selected. Must be unique within the control. |
3640
4163
  | `disabled` | `boolean` | `false` | Show the segment but skip it in keyboard navigation and refuse selection. |
3641
4164
 
4165
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
4166
+
4167
+ | Action | Default keys | What it does |
4168
+ |---|---|---|
4169
+ | `activate` (essential) | Space | Selects the focused item. |
4170
+
3642
4171
  Allowed inside: `<void-segmented-control>`.
3643
4172
 
3644
4173
  Example:
@@ -3753,6 +4282,12 @@ Collapsible side navigation for app shells, admin panels, and documentation site
3753
4282
  | `void-collapse` | `{ reason: 'api' }` | `toggle()` collapsed it. Does not bubble. |
3754
4283
  | `void-expand` | `{ reason: 'api' }` | `toggle()` expanded it. Does not bubble. |
3755
4284
 
4285
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
4286
+
4287
+ | Message | Default | Replaced by |
4288
+ |---|---|---|
4289
+ | `sidebar.label` | Sidebar navigation | `aria-label` |
4290
+
3756
4291
  Example:
3757
4292
 
3758
4293
  ```html
@@ -3835,7 +4370,13 @@ Indeterminate loading indicator for async operations, button loading states, and
3835
4370
  | Attribute | Values | Default | Description |
3836
4371
  |---|---|---|---|
3837
4372
  | `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`). |
4373
+ | `label` | `string` | | Text announced to screen readers while loading, and the spinner's accessible name. Defaults to the `spinner.label` message (English: `Loading`); say what is loading (`Loading orders`). |
4374
+
4375
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
4376
+
4377
+ | Message | Default | Replaced by |
4378
+ |---|---|---|
4379
+ | `spinner.label` | Loading | `label` |
3839
4380
 
3840
4381
  Example:
3841
4382
 
@@ -3893,6 +4434,8 @@ Example:
3893
4434
 
3894
4435
  Key metric display for analytics dashboards and KPI summaries with label, value, delta, and trend.
3895
4436
 
4437
+ With a `label` it is a `group` named by the label; without one it has no role.
4438
+
3896
4439
  | Attribute | Values | Default | Description |
3897
4440
  |---|---|---|---|
3898
4441
  | `label` | `string` | | Small caption above the value, such as `Active users`. |
@@ -3939,6 +4482,14 @@ Presence indicator for user lists and chat rosters showing online/away/offline s
3939
4482
  |---|---|---|---|
3940
4483
  | `status` | `online\|away\|offline` | `offline` | Presence state: `online`, `away` or `offline` (default). Sets the colour and the accessible name (`Online`, `Away`, `Offline`). |
3941
4484
 
4485
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
4486
+
4487
+ | Message | Default | Replaced by |
4488
+ |---|---|---|
4489
+ | `statusDot.online` | Online | `aria-label` |
4490
+ | `statusDot.away` | Away | `aria-label` |
4491
+ | `statusDot.offline` | Offline | `aria-label` |
4492
+
3942
4493
  Example:
3943
4494
 
3944
4495
  ```html
@@ -3954,6 +4505,12 @@ Multi-step progress tracker for onboarding flows, checkout funnels, and guided w
3954
4505
  | `value` | `number` | `0` | Zero-based index of the current step. Earlier steps show as completed, later ones as upcoming. |
3955
4506
  | `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
4507
 
4508
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
4509
+
4510
+ | Message | Default | Replaced by |
4511
+ |---|---|---|
4512
+ | `stepper.label` | Progress | `aria-label` |
4513
+
3957
4514
  Example:
3958
4515
 
3959
4516
  ```html
@@ -3966,6 +4523,7 @@ On/off toggle for feature flags, notification preferences, and settings that tak
3966
4523
 
3967
4524
  | Attribute | Values | Default | Description |
3968
4525
  |---|---|---|---|
4526
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
3969
4527
  | `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
4528
  | `disabled` | `boolean` | `false` | Stop the switch reacting and exclude it from the form submission. Also disabled by an enclosing `<fieldset disabled>`. |
3971
4529
  | `value` | `string` | `on` | Submitted under `name` while checked (like a native checkbox). |
@@ -3978,6 +4536,18 @@ On/off toggle for feature flags, notification preferences, and settings that tak
3978
4536
  |---|---|---|
3979
4537
  | `void-change` | `{ value: string; checked: boolean }` | |
3980
4538
 
4539
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
4540
+
4541
+ | Message | Default | Replaced by |
4542
+ |---|---|---|
4543
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
4544
+
4545
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
4546
+
4547
+ | Action | Default keys | What it does |
4548
+ |---|---|---|
4549
+ | `activate` (essential) | Enter, Space | Turns the switch on or off. |
4550
+
3981
4551
  Example:
3982
4552
 
3983
4553
  ```html
@@ -3999,6 +4569,10 @@ written on a cell is kept). `data-stack` on a header cell sets the role of a col
3999
4569
  `data-align="end"` on a header cell right-aligns a numeric column. Because browsers can drop table
4000
4570
  semantics when `display` changes, a table with `stack` carries explicit table, row and cell roles.
4001
4571
 
4572
+ **Name.** A table needs a name: write a `<caption>` (the caption part; it can be visually hidden), or an
4573
+ `aria-label` (or `label`) on the `<void-table>`, which the component copies onto the native `<table>`. `voidable check`
4574
+ reports a `<void-table>` with neither (rule `missing-name`).
4575
+
4002
4576
  **Overflow.** Nothing is clipped by default, so a menu, popover or tooltip opened from a cell is
4003
4577
  always fully visible. `scrollable` makes the table its own horizontal scroll region: it is
4004
4578
  focusable and labelled (`label`, else the `<caption>`, else `aria-label`) only while it actually
@@ -4006,6 +4580,40 @@ overflows, and fades its edges while there is more to scroll to. `max-height` ma
4006
4580
  scroll vertically too, which is what `sticky-header` needs; without it a sticky header sticks to
4007
4581
  the page.
4008
4582
 
4583
+ **Sorting.** `data-sort` on a header cell (`data-sort="number"` or `"date"`; text by default) makes the column
4584
+ sortable: the component wraps the header's content in a `<button>`, writes `aria-sort` and, on activation,
4585
+ cycles ascending, descending, none. A cell's `data-sort-value` is the value compared (ISO dates, raw numbers).
4586
+ Text uses `Intl.Collator` for the closest `lang` with numeric collation; empty cells sort last in both
4587
+ directions. One column at a time. `sort` is the column's `data-key` (else its index) and `sort-direction` its direction.
4588
+
4589
+ **Filtering.** `filter` hides (with `hidden`) the body rows that do not contain every word, ignoring case and accents,
4590
+ in all columns or in the `data-key`s of `filter-columns`. An author-written `<void-table-filter>` holding a search
4591
+ input is wired to it (typing is debounced). A visually hidden live region says "N of M rows" and a
4592
+ `<void-table-empty>` part shows while nothing matches.
4593
+
4594
+ **Selection.** `selectable` (or `selectable="single"`) wires the checkboxes the author wrote in the rows (a
4595
+ `void-checkbox` or a native one, in the `data-stack="select"` column) and in the header (select all, which acts
4596
+ on the rows shown). Rows are identified by `data-value` (else their position). `value` is the selected row
4597
+ values as a JSON array, submitted with the form when `name` is set. `<void-table-selection>` is shown while
4598
+ anything is selected and `<void-table-select-all>` offers "all N rows" across server pages (`total-rows`,
4599
+ `all-selected`).
4600
+
4601
+ **Server mode.** `manual` leaves ordering, visibility and selection markup to the server: the table only
4602
+ updates header state and fires the events.
4603
+
4604
+ Shortcuts are opt-in: the `selectAll` key action has no default key, and `keys='{"selectAll":["Control+a","Meta+a"]}'` lets Ctrl or Cmd plus A inside the body select every shown row.
4605
+
4606
+ Parts (parts mixed with other content):
4607
+
4608
+ | Part | | Description |
4609
+ |---|---|---|
4610
+ | `<void-table-filter>` | one, CSS-only | Holds the native search input (or a void-input) that filters the rows; typing is debounced. Place it anywhere inside the void-table. |
4611
+ | `<void-table-empty>` | one, CSS-only | Shown (the component removes `hidden`) while the filter matches no row. Write it with `hidden`. |
4612
+ | `<void-table-selection>` | one, CSS-only | Shown while any row is selected; holds the bulk actions. An element with `data-count` inside it receives the number of selected rows. Write it with `hidden`. |
4613
+ | `<void-table-select-all>` | one, CSS-only | With `total-rows` greater than the rows present, shown when select-all is checked; a button inside it ("Select all 1,250 rows") sets `all-selected` and fires void-change with `all: true`. Write it with `hidden`. |
4614
+
4615
+ Markup: `<void-table selectable filter-columns="name" aria-label="Team"><void-table-filter><input type="search" aria-label="Filter team"></void-table-filter><table><thead><tr><th data-stack="select"><void-checkbox></void-checkbox></th><th data-key="name" data-sort>Name</th><th data-key="seats" data-sort="number" data-align="end">Seats</th></tr></thead><tbody><tr data-value="ada"><td><void-checkbox aria-label="Select Ada"></void-checkbox></td><td>Ada</td><td>4</td></tr></tbody></table><void-table-empty hidden>No one matches.</void-table-empty><void-table-selection hidden><span data-count></span> selected<void-button size="sm">Remove</void-button></void-table-selection></void-table>`
4616
+
4009
4617
  | Attribute | Values | Default | Description |
4010
4618
  |---|---|---|---|
4011
4619
  | `striped` | `boolean` | `false` | Shade every other body row. |
@@ -4019,12 +4627,150 @@ the page.
4019
4627
  | `sticky-column` | `boolean` | `false` | Keeps the first column in view while the table scrolls horizontally. |
4020
4628
  | `max-height` | `string \| null` | | Height (a CSS length) at which a scrollable table scrolls vertically. |
4021
4629
  | `label` | `string \| null` | | Accessible name of the scroll region (default: the table's caption, then `aria-label`). |
4630
+ | `sort` | `string \| null` | | The key (`data-key` of the header cell, else its position) of the column the rows are sorted by. |
4631
+ | `sort-direction` | `string \| null` | | Direction of the sort. A `sort` without it is ascending. |
4632
+ | `filter` | `string \| null` | | Hides the body rows that do not contain every whitespace-separated word, ignoring case and accents. |
4633
+ | `filter-columns` | `string \| null` | | The `data-key`s (or positions), separated by spaces or commas, of the columns `filter` looks at. Default: every column. |
4634
+ | `selectable` | `string \| null` | | Wires the row checkboxes. Present without a value: any number of rows; `single`: one row at a time. |
4635
+ | `manual` | `boolean` | `false` | The server renders order, visibility, `aria-sort` and selection; the table only fires its events and updates header state. |
4636
+ | `total-rows` | `number \| null` | | How many rows there are in all, across the server's pages. Enables `<void-table-select-all>`. |
4637
+ | `all-selected` | `boolean` | `false` | Every row across the server's pages is selected (the user activated the select-all part). The server applies the action to the full set. |
4638
+ | `keys` | `KeyOverrides \| null` | | Key actions (JSON): `{"selectAll":["Control+a","Meta+a"]}` turns on select-all by keyboard, which has no default key. |
4639
+ | `value` | `string[]` | `[]` | The values of the selected rows, as a list; the `value` attribute is the same list as a JSON array (`value='["a","b"]'`), kept in step as the selection changes. Setting it selects those rows (it does not fire `void-change`). Values that match no row are dropped when the rows are known. |
4640
+ | `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. |
4641
+ | `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
4642
+
4643
+ | Event | `detail` | Description |
4644
+ |---|---|---|
4645
+ | `void-change` | `{ value: string[], all: boolean }` | The user changed the selection. |
4646
+ | `void-sort` | `{ column: string, direction: 'ascending' \| 'descending' \| 'none' }` | A user activated a sortable header; cancelable. |
4647
+ | `void-filter` | `{ filter: string, shown: number, total: number }` | The user changed the filter. |
4648
+
4649
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
4650
+
4651
+ | Message | Default | Replaced by |
4652
+ |---|---|---|
4653
+ | `table.selectAll` | Select all rows | `aria-label` on `<void-checkbox>` |
4654
+ | `table.selectAllShown` | Select all 5 shown rows | `aria-label` on `<void-checkbox>` |
4655
+ | `table.rowsShown` | 3 of 12 rows | `registerMessages()` only |
4656
+ | `table.rows` | 5 rows | `registerMessages()` only |
4657
+ | `table.selected` | 5 selected | `registerMessages()` only |
4658
+ | `table.noneSelected` | No rows selected | `registerMessages()` only |
4659
+ | `table.allSelected` | All 5 rows selected | `registerMessages()` only |
4660
+ | `table.sortedAscending` | Sorted by Name, ascending | `registerMessages()` only |
4661
+ | `table.sortedDescending` | Sorted by Name, descending | `registerMessages()` only |
4662
+ | `table.sortCleared` | Sorting by Name removed | `registerMessages()` only |
4663
+
4664
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
4665
+
4666
+ | Action | Default keys | What it does |
4667
+ |---|---|---|
4668
+ | `selectAll` | | Selects every row shown (after filtering), skipping disabled ones. It has no default key, because the page may use Control + A for something else and because select-all-text is how people copy a table: bind it with `keys='{"selectAll":["Control+a","Meta+a"]}'`. It acts only from inside the body, only when `selectable` allows many rows, and never from a text field. |
4669
+
4670
+ The browser's own, not remappable: Tab, Shift + Tab (Move between the sort buttons, the filter field, the select-all and row checkboxes, and the controls in the rows.); Enter, Space (on a sort button) (Sorts by the column: ascending, then descending, then not sorted. Focus stays on the button; the new state is announced ("Sorted by Name, ascending").); Space (on a row or select-all checkbox) (Toggles it. Select-all acts on the rows shown (after filtering) and skips disabled ones; its state is checked, mixed or unchecked.); Shift + click, Shift + Space (on a row checkbox) (Selects (or clears) every row shown between the last row toggled and this one, as one change.)
4671
+
4672
+ Example:
4673
+
4674
+ ```html
4675
+ <void-table stack hoverable>
4676
+ <table>
4677
+ <caption>Team members</caption>
4678
+ <thead>
4679
+ <tr><th data-stack="title">Name</th><th>Role</th><th data-align="end">Seats</th><th data-stack="actions">Actions</th></tr>
4680
+ </thead>
4681
+ <tbody>
4682
+ <tr><td>Ada</td><td>Admin</td><td>4</td><td><void-button variant="ghost" size="sm">Edit</void-button></td></tr>
4683
+ </tbody>
4684
+ </table>
4685
+ </void-table>
4686
+ ```
4687
+
4688
+ ## `<void-table-empty>`
4689
+
4690
+ Shown (the component removes `hidden`) while the filter matches no row. Write it with `hidden`.
4691
+
4692
+ CSS-only part of `<void-table>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
4693
+
4694
+ Allowed inside: `<void-table>`.
4695
+
4696
+ Example:
4697
+
4698
+ ```html
4699
+ <void-table stack hoverable>
4700
+ <table>
4701
+ <caption>Team members</caption>
4702
+ <thead>
4703
+ <tr><th data-stack="title">Name</th><th>Role</th><th data-align="end">Seats</th><th data-stack="actions">Actions</th></tr>
4704
+ </thead>
4705
+ <tbody>
4706
+ <tr><td>Ada</td><td>Admin</td><td>4</td><td><void-button variant="ghost" size="sm">Edit</void-button></td></tr>
4707
+ </tbody>
4708
+ </table>
4709
+ </void-table>
4710
+ ```
4711
+
4712
+ ## `<void-table-filter>`
4713
+
4714
+ Holds the native search input (or a void-input) that filters the rows; typing is debounced. Place it anywhere inside the void-table.
4715
+
4716
+ CSS-only part of `<void-table>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
4717
+
4718
+ Allowed inside: `<void-table>`.
4719
+
4720
+ Example:
4721
+
4722
+ ```html
4723
+ <void-table stack hoverable>
4724
+ <table>
4725
+ <caption>Team members</caption>
4726
+ <thead>
4727
+ <tr><th data-stack="title">Name</th><th>Role</th><th data-align="end">Seats</th><th data-stack="actions">Actions</th></tr>
4728
+ </thead>
4729
+ <tbody>
4730
+ <tr><td>Ada</td><td>Admin</td><td>4</td><td><void-button variant="ghost" size="sm">Edit</void-button></td></tr>
4731
+ </tbody>
4732
+ </table>
4733
+ </void-table>
4734
+ ```
4735
+
4736
+ ## `<void-table-select-all>`
4737
+
4738
+ With `total-rows` greater than the rows present, shown when select-all is checked; a button inside it ("Select all 1,250 rows") sets `all-selected` and fires void-change with `all: true`. Write it with `hidden`.
4739
+
4740
+ CSS-only part of `<void-table>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
4741
+
4742
+ Allowed inside: `<void-table>`.
4743
+
4744
+ Example:
4745
+
4746
+ ```html
4747
+ <void-table stack hoverable>
4748
+ <table>
4749
+ <caption>Team members</caption>
4750
+ <thead>
4751
+ <tr><th data-stack="title">Name</th><th>Role</th><th data-align="end">Seats</th><th data-stack="actions">Actions</th></tr>
4752
+ </thead>
4753
+ <tbody>
4754
+ <tr><td>Ada</td><td>Admin</td><td>4</td><td><void-button variant="ghost" size="sm">Edit</void-button></td></tr>
4755
+ </tbody>
4756
+ </table>
4757
+ </void-table>
4758
+ ```
4759
+
4760
+ ## `<void-table-selection>`
4761
+
4762
+ Shown while any row is selected; holds the bulk actions. An element with `data-count` inside it receives the number of selected rows. Write it with `hidden`.
4763
+
4764
+ CSS-only part of `<void-table>`: `@voidable/theme` styles it and nothing registers it. Write it as plain markup in every framework.
4765
+
4766
+ Allowed inside: `<void-table>`.
4022
4767
 
4023
4768
  Example:
4024
4769
 
4025
4770
  ```html
4026
4771
  <void-table stack hoverable>
4027
4772
  <table>
4773
+ <caption>Team members</caption>
4028
4774
  <thead>
4029
4775
  <tr><th data-stack="title">Name</th><th>Role</th><th data-align="end">Seats</th><th data-stack="actions">Actions</th></tr>
4030
4776
  </thead>
@@ -4062,6 +4808,7 @@ Markup: `<void-tabs value="a"><void-tabs-list><void-tabs-trigger value="a">A</vo
4062
4808
 
4063
4809
  | Attribute | Values | Default | Description |
4064
4810
  |---|---|---|---|
4811
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"next":["ArrowRight","l"]}`); `[]` switches an action off. See the keyboard guide. |
4065
4812
  | `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
4813
  | `size` | `sm\|md\|lg` | `md` | Size step of the tabs: `sm`, `md` (default) or `lg`. |
4067
4814
  | `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. |
@@ -4070,6 +4817,18 @@ Markup: `<void-tabs value="a"><void-tabs-list><void-tabs-trigger value="a">A</vo
4070
4817
  |---|---|---|
4071
4818
  | `void-change` | `{ value: string }` | The user selected a tab. |
4072
4819
 
4820
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
4821
+
4822
+ | Action | Default keys | What it does |
4823
+ |---|---|---|
4824
+ | `next` | Right Arrow (Left Arrow in right-to-left text) | Moves focus to the next tab (wraps, skips disabled tabs). With `activation="auto"` the tab is selected too. In right-to-left pages the default is Left Arrow. |
4825
+ | `previous` | Left Arrow (Right Arrow in right-to-left text) | Moves focus to the previous tab (wraps). With `activation="auto"` the tab is selected too. |
4826
+ | `first` | Home | Moves focus to the first tab (selects it with `activation="auto"`). |
4827
+ | `last` | End | Moves focus to the last tab (selects it with `activation="auto"`). |
4828
+ | `activate` (essential) | Enter, Space | Selects the focused tab (manual activation). |
4829
+
4830
+ The browser's own, not remappable: Tab (Enters the tab list on its tab stop, then moves to the visible panel.)
4831
+
4073
4832
  Example:
4074
4833
 
4075
4834
  ```html
@@ -4188,6 +4947,12 @@ anywhere else it has no role.
4188
4947
  |---|---|---|
4189
4948
  | `void-remove` | `(no detail)` | |
4190
4949
 
4950
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
4951
+
4952
+ | Message | Default | Replaced by |
4953
+ |---|---|---|
4954
+ | `remove` | Remove | `registerMessages()` only |
4955
+
4191
4956
  Example:
4192
4957
 
4193
4958
  ```html
@@ -4200,11 +4965,12 @@ Multi-tag input field for email recipients, category labels, keyword tagging, an
4200
4965
 
4201
4966
  | Attribute | Values | Default | Description |
4202
4967
  |---|---|---|---|
4968
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"add":["Enter",";"]}`); `[]` switches an action off. See the keyboard guide. |
4203
4969
  | `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
4970
  | `disabled` | `boolean` | `false` | Stop the field accepting input and removing tags, and exclude the values from the form submission. |
4205
4971
  | `readonly` | `boolean` | `false` | Show the tags but do not let the user add or remove any. Still submitted. |
4206
4972
  | `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...`. |
4973
+ | `placeholder` | `string` | | Hint in the entry field. Defaults to the `tagsInput.placeholder` message (English: `Add tag...`). |
4208
4974
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
4209
4975
  | `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
4976
  | `variant` | `filled\|outline` | `outline` | How the tags are drawn: `outline` (default) or `filled`. |
@@ -4216,6 +4982,23 @@ Multi-tag input field for email recipients, category labels, keyword tagging, an
4216
4982
  |---|---|---|
4217
4983
  | `void-change` | `{ value: TagValue[] }` | |
4218
4984
 
4985
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
4986
+
4987
+ | Message | Default | Replaced by |
4988
+ |---|---|---|
4989
+ | `removeItem` | Remove report.pdf | `registerMessages()` only |
4990
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
4991
+ | `tagsInput.placeholder` | Add tag... | `placeholder` |
4992
+
4993
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
4994
+
4995
+ | Action | Default keys | What it does |
4996
+ |---|---|---|
4997
+ | `add` | Enter, Comma | Adds the typed text as a tag. |
4998
+ | `removeLast` | Backspace | In an empty field, removes the last tag. |
4999
+
5000
+ The browser's own, not remappable: Characters, Left Arrow, Right Arrow, Backspace (Edit the text, in the native field.)
5001
+
4219
5002
  Example:
4220
5003
 
4221
5004
  ```html
@@ -4298,6 +5081,12 @@ Markup: `<void-toast color="success"><void-toast-title>Saved</void-toast-title><
4298
5081
  |---|---|---|
4299
5082
  | `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
5083
 
5084
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
5085
+
5086
+ | Message | Default | Replaced by |
5087
+ |---|---|---|
5088
+ | `dismiss` | Dismiss | `registerMessages()` only |
5089
+
4301
5090
  Attributes that do not exist (and what to write instead):
4302
5091
 
4303
5092
  - `heading`: write the title as <void-toast-title>...</void-toast-title> before the description
@@ -4367,6 +5156,12 @@ is visible there, but the page outside the dialog (the container included) stays
4367
5156
  |---|---|---|---|
4368
5157
  | `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
5158
 
5159
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
5160
+
5161
+ | Message | Default | Replaced by |
5162
+ |---|---|---|
5163
+ | `toast.region` | Notifications | `aria-label` |
5164
+
4370
5165
  Example:
4371
5166
 
4372
5167
  ```html
@@ -4424,6 +5219,7 @@ Pressable toggle button for toolbar actions and editor formatting controls with
4424
5219
 
4425
5220
  | Attribute | Values | Default | Description |
4426
5221
  |---|---|---|---|
5222
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
4427
5223
  | `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
5224
  | `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
5225
  | `disabled` | `boolean` | `false` | Ignore clicks and keys, and take the toggle out of the tab order. A `<fieldset disabled>` ancestor does the same. |
@@ -4435,6 +5231,12 @@ Pressable toggle button for toolbar actions and editor formatting controls with
4435
5231
  |---|---|---|
4436
5232
  | `void-change` | `{ value: string; pressed: boolean }` | |
4437
5233
 
5234
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
5235
+
5236
+ | Action | Default keys | What it does |
5237
+ |---|---|---|
5238
+ | `activate` (essential) | Enter, Space | Presses the toggle. |
5239
+
4438
5240
  Example:
4439
5241
 
4440
5242
  ```html
@@ -4447,6 +5249,7 @@ Multi-button toggle set for text editor toolbars and filter chips where one or m
4447
5249
 
4448
5250
  | Attribute | Values | Default | Description |
4449
5251
  |---|---|---|---|
5252
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"next":["ArrowRight"]}`); `[]` switches an action off. See the keyboard guide. |
4450
5253
  | `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
5254
  | `multiple` | `boolean` | `false` | Let several toggles be pressed at once. Without it pressing one releases the others. |
4452
5255
  | `disabled` | `boolean` | `false` | Stop every toggle reacting and exclude the value from the form submission. |
@@ -4460,6 +5263,19 @@ Multi-button toggle set for text editor toolbars and filter chips where one or m
4460
5263
  |---|---|---|
4461
5264
  | `void-change` | `{ value: string[] } \| { value: string }` | |
4462
5265
 
5266
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
5267
+
5268
+ | Message | Default | Replaced by |
5269
+ |---|---|---|
5270
+ | `valueMissing` | Please fill out this field. | `registerMessages()` only |
5271
+
5272
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
5273
+
5274
+ | Action | Default keys | What it does |
5275
+ |---|---|---|
5276
+ | `next` | Right Arrow (Left Arrow in right-to-left text) | Moves focus to the next toggle, wrapping at the ends. In right-to-left pages the horizontal default is Left Arrow. |
5277
+ | `previous` | Left Arrow (Right Arrow in right-to-left text) | Moves focus to the previous toggle, wrapping at the ends. |
5278
+
4463
5279
  Example:
4464
5280
 
4465
5281
  ```html
@@ -4515,6 +5331,7 @@ Markup: `<void-tooltip><void-tooltip-trigger><void-button>Copy</void-button></vo
4515
5331
 
4516
5332
  | Attribute | Values | Default | Description |
4517
5333
  |---|---|---|---|
5334
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. |
4518
5335
  | `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
5336
  | `align` | `start\|center\|end` | `center` | Alignment with the trigger along that side. |
4520
5337
  | `delay` | `number` | `200` | Milliseconds the pointer rests on the trigger before the content appears (keyboard focus shows it at once). Defaults to 200. |
@@ -4525,6 +5342,14 @@ Markup: `<void-tooltip><void-tooltip-trigger><void-button>Copy</void-button></vo
4525
5342
  | `void-open` | `{ reason: 'hover' \| 'focus' \| 'api' }` | The tooltip appeared. |
4526
5343
  | `void-close` | `{ reason: 'hover' \| 'blur' \| 'escape' \| 'parent' \| 'api' }` | The tooltip is hiding. |
4527
5344
 
5345
+ Keys (an action can be rebound or switched off with the `keys` attribute, `keys='{"next":["l"],"close":[]}'`, or for every element of the tag with `configureKeys(tag, {...})`; removing a key can make the control unusable from the keyboard):
5346
+
5347
+ | Action | Default keys | What it does |
5348
+ |---|---|---|
5349
+ | `close` | Escape | Hides the tooltip without moving focus. |
5350
+
5351
+ The browser's own, not remappable: Tab (onto the trigger) (Shows the tooltip at once, without the `delay` (keyboard focus only, not a click).); Tab (off the trigger) (Hides the tooltip.)
5352
+
4528
5353
  Attributes that do not exist (and what to write instead):
4529
5354
 
4530
5355
  - `visible`: the shown state is the open attribute