@voidable/ui 0.11.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/README.md +1 -1
  2. package/dist/angular/index.d.ts +2 -2
  3. package/dist/angular/index.js +2 -1
  4. package/dist/chunks/activation-B8aBarKd.js +4 -0
  5. package/dist/chunks/carousel-C9u0bg5l.js +10 -0
  6. package/dist/chunks/choice-BTrsi7OW.js +16 -0
  7. package/dist/chunks/data-Baycjoo4.js +96 -0
  8. package/dist/chunks/fields-MEqz-olE.js +21 -0
  9. package/dist/chunks/{form-control-C0vH6gii.js → form-control-fL-Hhy91.js} +49 -48
  10. package/dist/chunks/{keyboard-CEhMSkws.js → keyboard-ChtDvhB_.js} +4 -23
  11. package/dist/chunks/{keyboard-activation-CV0m4hkn.js → keyboard-activation-BfEyoaMT.js} +4 -6
  12. package/dist/chunks/menu-CxRRgkJI.js +21 -0
  13. package/dist/chunks/{modal-DWGkNdNG.js → modal-Cz2-Ov76.js} +23 -15
  14. package/dist/chunks/nav-menu-Bx284Dk6.js +12 -0
  15. package/dist/chunks/{overlay-CH7L4N-h.js → overlay-BuV-4Yvt.js} +75 -68
  16. package/dist/chunks/overlay-K1ilWC1p.js +4 -0
  17. package/dist/chunks/pickers-CjlFgNke.js +36 -0
  18. package/dist/chunks/table-BBpqwWEi.js +4 -0
  19. package/dist/chunks/tabs-Buf3EBWq.js +10 -0
  20. package/dist/components/accordion.d.ts +7 -0
  21. package/dist/components/accordion.js +22 -14
  22. package/dist/components/action-input.d.ts +2 -1
  23. package/dist/components/action-input.js +59 -55
  24. package/dist/components/bar-chart.js +41 -40
  25. package/dist/components/breadcrumbs.d.ts +2 -0
  26. package/dist/components/breadcrumbs.js +15 -11
  27. package/dist/components/button.d.ts +7 -0
  28. package/dist/components/button.js +23 -16
  29. package/dist/components/calendar.d.ts +45 -10
  30. package/dist/components/calendar.js +183 -129
  31. package/dist/components/carousel.d.ts +22 -0
  32. package/dist/components/carousel.js +64 -35
  33. package/dist/components/charts/data.d.ts +2 -2
  34. package/dist/components/checkbox-group.js +22 -21
  35. package/dist/components/checkbox.d.ts +7 -0
  36. package/dist/components/checkbox.js +29 -24
  37. package/dist/components/collapsible.d.ts +7 -0
  38. package/dist/components/collapsible.js +19 -11
  39. package/dist/components/color-picker.js +28 -27
  40. package/dist/components/combobox.d.ts +13 -1
  41. package/dist/components/combobox.js +54 -41
  42. package/dist/components/compose-input.d.ts +9 -1
  43. package/dist/components/compose-input.js +28 -16
  44. package/dist/components/dialog.js +1 -1
  45. package/dist/components/donut-chart.js +57 -56
  46. package/dist/components/drawer.js +1 -1
  47. package/dist/components/dropdown-menu.d.ts +22 -0
  48. package/dist/components/dropdown-menu.js +54 -39
  49. package/dist/components/editable.d.ts +11 -1
  50. package/dist/components/editable.js +35 -22
  51. package/dist/components/error-fallback.d.ts +4 -2
  52. package/dist/components/error-fallback.js +34 -28
  53. package/dist/components/file-upload.d.ts +9 -0
  54. package/dist/components/file-upload.js +54 -28
  55. package/dist/components/gauge.js +108 -107
  56. package/dist/components/hamburger.d.ts +7 -0
  57. package/dist/components/hamburger.js +28 -19
  58. package/dist/components/hover-card.d.ts +7 -0
  59. package/dist/components/hover-card.js +22 -14
  60. package/dist/components/indicator.js +15 -14
  61. package/dist/components/input.js +1 -1
  62. package/dist/components/line-chart.js +43 -42
  63. package/dist/components/menu.d.ts +25 -0
  64. package/dist/components/menu.js +55 -33
  65. package/dist/components/multiselect.d.ts +17 -1
  66. package/dist/components/multiselect.js +96 -74
  67. package/dist/components/nav-menu.d.ts +9 -0
  68. package/dist/components/nav-menu.js +30 -23
  69. package/dist/components/number-input.d.ts +15 -1
  70. package/dist/components/number-input.js +71 -37
  71. package/dist/components/pagination.js +25 -24
  72. package/dist/components/pin-input.d.ts +11 -0
  73. package/dist/components/pin-input.js +46 -32
  74. package/dist/components/popover.d.ts +7 -0
  75. package/dist/components/popover.js +21 -13
  76. package/dist/components/radio-group.js +1 -1
  77. package/dist/components/radio.d.ts +10 -1
  78. package/dist/components/radio.js +37 -32
  79. package/dist/components/segmented-control.d.ts +14 -0
  80. package/dist/components/segmented-control.js +40 -28
  81. package/dist/components/sidebar.d.ts +1 -0
  82. package/dist/components/sidebar.js +14 -10
  83. package/dist/components/slider.js +1 -1
  84. package/dist/components/spinner.d.ts +5 -3
  85. package/dist/components/spinner.js +21 -14
  86. package/dist/components/stat.js +1 -1
  87. package/dist/components/status-dot.d.ts +2 -2
  88. package/dist/components/status-dot.js +12 -14
  89. package/dist/components/stepper.d.ts +2 -0
  90. package/dist/components/stepper.js +20 -13
  91. package/dist/components/switch.d.ts +7 -0
  92. package/dist/components/switch.js +24 -16
  93. package/dist/components/table.d.ts +77 -1
  94. package/dist/components/table.js +562 -73
  95. package/dist/components/tabs.d.ts +11 -0
  96. package/dist/components/tabs.js +42 -33
  97. package/dist/components/tag.js +12 -11
  98. package/dist/components/tags-input.d.ts +10 -1
  99. package/dist/components/tags-input.js +42 -30
  100. package/dist/components/textarea.js +1 -1
  101. package/dist/components/toast.d.ts +2 -0
  102. package/dist/components/toast.js +35 -28
  103. package/dist/components/toggle-group.d.ts +8 -0
  104. package/dist/components/toggle-group.js +24 -17
  105. package/dist/components/toggle.d.ts +7 -0
  106. package/dist/components/toggle.js +23 -15
  107. package/dist/components/tooltip.d.ts +7 -0
  108. package/dist/components/tooltip.js +20 -12
  109. package/dist/components.json +96 -74
  110. package/dist/custom-elements.json +4213 -131
  111. package/dist/dev/rules.d.ts +0 -1
  112. package/dist/dev/types.d.ts +3 -1
  113. package/dist/dev.js +244 -113
  114. package/dist/index.d.ts +4 -0
  115. package/dist/index.js +68 -66
  116. package/dist/keyboard-activation.d.ts +9 -9
  117. package/dist/keyboard.d.ts +2 -10
  118. package/dist/keymaps/activation.d.ts +8 -0
  119. package/dist/keymaps/carousel.d.ts +9 -0
  120. package/dist/keymaps/choice.d.ts +21 -0
  121. package/dist/keymaps/fields.d.ts +31 -0
  122. package/dist/keymaps/index.d.ts +2 -0
  123. package/dist/keymaps/menu.d.ts +36 -0
  124. package/dist/keymaps/nav-menu.d.ts +11 -0
  125. package/dist/keymaps/overlay.d.ts +4 -0
  126. package/dist/keymaps/pickers.d.ts +36 -0
  127. package/dist/keymaps/table.d.ts +8 -0
  128. package/dist/keymaps/tabs.d.ts +7 -0
  129. package/dist/keymaps.js +51 -0
  130. package/dist/keys.d.ts +46 -0
  131. package/dist/keys.js +57 -0
  132. package/dist/llms.txt +11 -3
  133. package/dist/messages/ar.d.ts +1 -0
  134. package/dist/messages/ar.js +130 -0
  135. package/dist/messages/fr.d.ts +1 -0
  136. package/dist/messages/fr.js +109 -0
  137. package/dist/messages.d.ts +213 -0
  138. package/dist/messages.js +190 -0
  139. package/dist/modal.d.ts +7 -0
  140. package/dist/reference.md +817 -17
  141. package/dist/testing/index.d.ts +46 -0
  142. package/dist/testing.js +79 -0
  143. package/dist/types/elements.d.ts +89 -73
  144. package/dist/types/react.d.ts +5 -1
  145. package/dist/types/solid.d.ts +5 -1
  146. package/dist/types/solid2.d.ts +4 -0
  147. package/dist/types/svelte.d.ts +5 -1
  148. package/dist/types/vue.d.ts +5 -1
  149. package/dist/vscode.html-custom-data.json +384 -18
  150. package/dist/web-types.json +830 -69
  151. package/package.json +22 -2
  152. package/dist/chunks/data-BpiiNapL.js +0 -95
package/dist/reference.md CHANGED
@@ -1,6 +1,6 @@
1
- # @voidable/ui 0.11.0: element reference
1
+ # @voidable/ui 0.12.1: 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
@@ -468,6 +481,13 @@ technology and a visually hidden data table (captioned with `aria-label`) carrie
468
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. |
469
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. |
470
483
 
484
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
485
+
486
+ | Message | Default | Replaced by |
487
+ |---|---|---|
488
+ | `chart.bar` | Bar chart | `aria-label` |
489
+ | `chart.label` | Label | `registerMessages()` only |
490
+
471
491
  Example:
472
492
 
473
493
  ```html
@@ -510,6 +530,12 @@ Markup: `<void-breadcrumbs><void-breadcrumbs-list><void-breadcrumbs-item><a href
510
530
  |---|---|---|---|
511
531
  | `separator` | `string` | `/` | Character drawn between the crumbs. Defaults to `/`. It is drawn by CSS and hidden from assistive technology. |
512
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
+
513
539
  Example:
514
540
 
515
541
  ```html
@@ -580,6 +606,7 @@ disabled); on an inner `<button>` it disables that button.
580
606
 
581
607
  | Attribute | Values | Default | Description |
582
608
  |---|---|---|---|
609
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
583
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. |
584
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. |
585
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. |
@@ -590,6 +617,14 @@ disabled); on an inner `<button>` it disables that button.
590
617
  |---|---|---|
591
618
  | `void-click` | `(no detail)` | |
592
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
+
593
628
  Example:
594
629
 
595
630
  ```html
@@ -602,13 +637,14 @@ Date selection for booking flows, scheduling UIs, and form fields with locale-aw
602
637
 
603
638
  | Attribute | Values | Default | Description |
604
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. |
605
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`. |
606
642
  | `min` | `string` | | Earliest selectable date, as `YYYY-MM-DD`. Earlier days are disabled. |
607
643
  | `max` | `string` | | Latest selectable date, as `YYYY-MM-DD`. Later days are disabled. |
608
644
  | `disabled` | `boolean` | `false` | Stop the calendar reacting and exclude the value from the form submission. |
609
645
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
610
- | `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`. |
611
- | `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. |
612
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. |
613
649
  | `name` | `string` | | Key the control's value is submitted under in the form's `FormData`. Without a name the control submits nothing. |
614
650
 
@@ -616,6 +652,37 @@ Date selection for booking flows, scheduling UIs, and form fields with locale-aw
616
652
  |---|---|---|
617
653
  | `void-change` | `{ value: string; date: Date }` | |
618
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
+
619
686
  Example:
620
687
 
621
688
  ```html
@@ -802,6 +869,7 @@ Markup: `<void-carousel aria-label="Slides"><void-carousel-content><void-carouse
802
869
 
803
870
  | Attribute | Values | Default | Description |
804
871
  |---|---|---|---|
872
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"next":["ArrowRight"]}`); `[]` switches an action off. See the keyboard guide. |
805
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`. |
806
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. |
807
875
  | `autoplay` | `boolean` | `false` | Advance to the next slide every `interval` milliseconds. It pauses while the pointer is over the carousel. |
@@ -813,6 +881,21 @@ Markup: `<void-carousel aria-label="Slides"><void-carousel-content><void-carouse
813
881
  |---|---|---|
814
882
  | `void-change` | `{ value: number; index: number; previous: number }` | The shown slide changed; `value` and `index` are both the new slide's index. |
815
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
+
816
899
  Attributes that do not exist (and what to write instead):
817
900
 
818
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
@@ -918,6 +1001,16 @@ Next-slide control of a `<void-carousel>`: a button the theme draws as an arrow
918
1001
  empty element with an `aria-label` ("Next slide"); any content you put inside replaces the arrow. It is
919
1002
  aria-disabled on the last slide unless the carousel has `loop`.
920
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
+
921
1014
  Allowed inside: `<void-carousel>`.
922
1015
 
923
1016
  Example:
@@ -939,6 +1032,16 @@ Previous-slide control of a `<void-carousel>`: a button the theme draws as an ar
939
1032
  as an empty element with an `aria-label` ("Previous slide"); any content you put inside replaces the arrow.
940
1033
  It is aria-disabled on the first slide unless the carousel has `loop`.
941
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
+
942
1045
  Allowed inside: `<void-carousel>`.
943
1046
 
944
1047
  Example:
@@ -960,6 +1063,7 @@ Binary or indeterminate selection for form fields, data table row selection, and
960
1063
 
961
1064
  | Attribute | Values | Default | Description |
962
1065
  |---|---|---|---|
1066
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Space"]}`); `[]` switches an action off. See the keyboard guide. |
963
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. |
964
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. |
965
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. |
@@ -974,6 +1078,12 @@ Binary or indeterminate selection for form fields, data table row selection, and
974
1078
  |---|---|---|
975
1079
  | `void-change` | `{ value: string; checked: boolean }` | |
976
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
+
977
1087
  Example:
978
1088
 
979
1089
  ```html
@@ -1004,6 +1114,12 @@ enabled checkbox's native input. `disabled` and `form` are forwarded.
1004
1114
  |---|---|---|
1005
1115
  | `void-change` | `{ value: string[] }` | |
1006
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
+
1007
1123
  Example:
1008
1124
 
1009
1125
  ```html
@@ -1037,6 +1153,7 @@ Markup: `<void-collapsible open><void-collapsible-trigger>Advanced options</void
1037
1153
 
1038
1154
  | Attribute | Values | Default | Description |
1039
1155
  |---|---|---|---|
1156
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
1040
1157
  | `open` | `boolean` | `false` | Whether the content is shown. Add the attribute to start open; it follows the user's toggling. |
1041
1158
  | `disabled` | `boolean` | `false` | Stop the panel from toggling. The trigger ignores clicks and Enter or Space. |
1042
1159
 
@@ -1045,6 +1162,12 @@ Markup: `<void-collapsible open><void-collapsible-trigger>Advanced options</void
1045
1162
  | `void-close` | `{ reason: 'trigger' \| 'keyboard' }` | The user is closing the panel. Cancelable: `preventDefault()` keeps it open. Does not bubble. |
1046
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. |
1047
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
+
1048
1171
  Attributes that do not exist (and what to write instead):
1049
1172
 
1050
1173
  - `heading`: write the heading as <void-collapsible-trigger>...</void-collapsible-trigger> and the content in <void-collapsible-content> after it
@@ -1118,6 +1241,13 @@ Color selection control with spectrum area, hue slider, hex input, and preset sw
1118
1241
  |---|---|---|
1119
1242
  | `void-change` | `{ value: string }` | |
1120
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
+
1121
1251
  Example:
1122
1252
 
1123
1253
  ```html
@@ -1160,8 +1290,9 @@ Markup: `<void-combobox name="country" placeholder="Search countries"><void-comb
1160
1290
 
1161
1291
  | Attribute | Values | Default | Description |
1162
1292
  |---|---|---|---|
1293
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. |
1163
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. |
1164
- | `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. |
1165
1296
  | `disabled` | `boolean` | `false` | Stop the field opening and exclude the value from the form submission. |
1166
1297
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
1167
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`. |
@@ -1175,6 +1306,26 @@ Markup: `<void-combobox name="country" placeholder="Search countries"><void-comb
1175
1306
  | `void-open` | `{ reason: 'keyboard' \| 'focus' \| 'api' }` | The option list opened. |
1176
1307
  | `void-close` | `{ reason: 'escape' \| 'outside' \| 'blur' \| 'select' \| 'parent' \| 'api' }` | The option list is closing. |
1177
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
+
1178
1329
  Example:
1179
1330
 
1180
1331
  ```html
@@ -1223,8 +1374,9 @@ Rich text entry area for messaging UIs, comment boxes, and social post composers
1223
1374
 
1224
1375
  | Attribute | Values | Default | Description |
1225
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. |
1226
1378
  | `value` | `string` | | The draft text, reflected to the `value` attribute as it changes. It is cleared after each send. |
1227
- | `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...`). |
1228
1380
  | `disabled` | `boolean` | `false` | Stop the box and the send button reacting. |
1229
1381
  | `maxlength` | `number` | `0` | Maximum number of characters. 0 (the default) means no limit. |
1230
1382
 
@@ -1233,6 +1385,21 @@ Rich text entry area for messaging UIs, comment boxes, and social post composers
1233
1385
  | `void-input` | `{ value: string }` | |
1234
1386
  | `void-submit` | `{ value: string }` | |
1235
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
+
1236
1403
  Example:
1237
1404
 
1238
1405
  ```html
@@ -1257,15 +1424,16 @@ is `aria-invalid` and described by the message, and the form is not submitted (`
1257
1424
 
1258
1425
  | Attribute | Values | Default | Description |
1259
1426
  |---|---|---|---|
1427
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. |
1260
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. |
1261
1429
  | `min` | `string` | | Earliest selectable date, as `YYYY-MM-DD`. |
1262
1430
  | `max` | `string` | | Latest selectable date, as `YYYY-MM-DD`. |
1263
1431
  | `disabled` | `boolean` | `false` | Stop the field and its calendar reacting and exclude the value from the form submission. |
1264
1432
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
1265
- | `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`. |
1266
- | `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. |
1267
1435
  | `open` | `boolean` | `false` | Whether the calendar dropdown is showing. Clicking the field or button toggles it; Escape closes it. |
1268
- | `placeholder` | `string` | `Select date` | Hint shown in the field while no date is chosen. Defaults to `Select date`. |
1436
+ | `placeholder` | `string` | | Hint shown in the field while no date is chosen. Defaults to the `datePicker.placeholder` message (English: `Select date`). |
1269
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`. |
1270
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`. |
1271
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. |
@@ -1278,6 +1446,36 @@ is `aria-invalid` and described by the message, and the form is not submitted (`
1278
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. |
1279
1447
  | `void-close` | `{ reason: 'trigger' \| 'select' \| 'escape' \| 'outside' \| 'blur' \| 'parent' \| 'api' }` | The calendar popup is closing. Cancelable when the user caused it. |
1280
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.)
1478
+
1281
1479
  Example:
1282
1480
 
1283
1481
  ```html
@@ -1353,6 +1551,7 @@ Markup: `<void-dialog open><void-dialog-title>Title</void-dialog-title><void-dia
1353
1551
  |---|---|---|---|
1354
1552
  | `aria-label` | `string` | | Accessible name when there is no `<void-dialog-title>` (prefer the title). |
1355
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. |
1356
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. |
1357
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). |
1358
1557
 
@@ -1361,6 +1560,20 @@ Markup: `<void-dialog open><void-dialog-title>Title</void-dialog-title><void-dia
1361
1560
  | `void-open` | `{ reason: 'api' }` | The dialog opened. `detail.reason` is `api` (attribute or property). |
1362
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). |
1363
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
+
1364
1577
  Attributes that do not exist (and what to write instead):
1365
1578
 
1366
1579
  - `heading`: write the title as the first child: <void-dialog-title>...</void-dialog-title>
@@ -1497,6 +1710,15 @@ values instead; add `show-table` to show the table below the chart too.
1497
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. |
1498
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. |
1499
1712
 
1713
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
1714
+
1715
+ | Message | Default | Replaced by |
1716
+ |---|---|---|
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 |
1721
+
1500
1722
  Example:
1501
1723
 
1502
1724
  ```html
@@ -1528,6 +1750,7 @@ Markup: `<void-drawer open><void-drawer-title>Title</void-drawer-title><void-dra
1528
1750
  | `aria-label` | `string` | | Accessible name when there is no `<void-drawer-title>` (prefer the title). |
1529
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). |
1530
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. |
1531
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. |
1532
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). |
1533
1756
 
@@ -1536,6 +1759,20 @@ Markup: `<void-drawer open><void-drawer-title>Title</void-drawer-title><void-dra
1536
1759
  | `void-open` | `{ reason: 'api' }` | The drawer opened. |
1537
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`). |
1538
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
+
1539
1776
  Attributes that do not exist (and what to write instead):
1540
1777
 
1541
1778
  - `heading`: write the title as the first child: <void-drawer-title>...</void-drawer-title>
@@ -1673,6 +1910,7 @@ Markup: `<void-dropdown-menu><void-dropdown-menu-trigger><void-button>Actions</v
1673
1910
 
1674
1911
  | Attribute | Values | Default | Description |
1675
1912
  |---|---|---|---|
1913
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":[]}`); `[]` switches an action off. See the keyboard guide. |
1676
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. |
1677
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. |
1678
1916
  | `align` | `start\|center\|end` | `start` | Alignment with the trigger along that side. |
@@ -1683,6 +1921,21 @@ Markup: `<void-dropdown-menu><void-dropdown-menu-trigger><void-button>Actions</v
1683
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`). |
1684
1922
  | `void-select` | `{ item: VoidDropdownMenuItem; value: string }` | Bubbles from a child `<void-dropdown-menu-item>`. |
1685
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
+
1686
1939
  Example:
1687
1940
 
1688
1941
  ```html
@@ -1731,6 +1984,7 @@ Space) dispatches `void-select` and closes the menu, unless it has `keep-open`.
1731
1984
 
1732
1985
  | Attribute | Values | Default | Description |
1733
1986
  |---|---|---|---|
1987
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
1734
1988
  | `value` | `string` | | What the item stands for, passed as `detail.value` of `void-select` (empty when not set). |
1735
1989
  | `disabled` | `boolean` | `false` | Dim the item, skip it in keyboard navigation and stop it firing `void-select`. |
1736
1990
  | `destructive` | `boolean` | `false` | Draw the item in the error colour, for an action that deletes or cannot be undone. |
@@ -1740,6 +1994,12 @@ Space) dispatches `void-select` and closes the menu, unless it has `keep-open`.
1740
1994
  |---|---|---|
1741
1995
  | `void-select` | `{ item: VoidDropdownMenuItem; value: string }` | The item was chosen. |
1742
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
+
1743
2003
  Allowed inside: `<void-dropdown-menu-content>`.
1744
2004
 
1745
2005
  Example:
@@ -1808,10 +2068,11 @@ the previous value. Use `both` (default) or `blur` to commit on blur.
1808
2068
 
1809
2069
  | Attribute | Values | Default | Description |
1810
2070
  |---|---|---|---|
2071
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"cancel":[]}`); `[]` switches an action off. See the keyboard guide. |
1811
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. |
1812
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. |
1813
2074
  | `disabled` | `boolean` | `false` | Stop the field entering edit mode and exclude the value from the form submission. |
1814
- | `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`). |
1815
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). |
1816
2077
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
1817
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. |
@@ -1823,6 +2084,21 @@ the previous value. Use `both` (default) or `blur` to commit on blur.
1823
2084
  | `void-cancel` | `(no detail)` | |
1824
2085
  | `void-input` | `{ value: unknown }` | |
1825
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
+
1826
2102
  Example:
1827
2103
 
1828
2104
  ```html
@@ -1877,16 +2153,23 @@ Markup: `<void-error-fallback><void-error-fallback-title>Could not load invoices
1877
2153
 
1878
2154
  | Attribute | Values | Default | Description |
1879
2155
  |---|---|---|---|
1880
- | `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. |
1881
2157
  | `message` | `string` | | Detail shown under the headline in the built-in default, such as what failed or what to try. Optional. |
1882
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. |
1883
- | `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`. |
1884
2160
  | `hide-icon` | `boolean` | `false` | Leave out the warning icon above the headline (it is drawn by default). |
1885
2161
 
1886
2162
  | Event | `detail` | Description |
1887
2163
  |---|---|---|
1888
2164
  | `void-retry` | `(no detail)` | The built-in retry button was pressed (the element retries nothing itself). |
1889
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
+
1890
2173
  Example:
1891
2174
 
1892
2175
  ```html
@@ -2039,6 +2322,7 @@ Drag-and-drop file picker for document uploads, image attachment flows, and impo
2039
2322
 
2040
2323
  | Attribute | Values | Default | Description |
2041
2324
  |---|---|---|---|
2325
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
2042
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. |
2043
2327
  | `multiple` | `boolean` | `false` | Allow more than one file. Without it a new choice replaces the old one. |
2044
2328
  | `disabled` | `boolean` | `false` | Stop the zone reacting and exclude the files from the form submission. |
@@ -2052,6 +2336,24 @@ Drag-and-drop file picker for document uploads, image attachment flows, and impo
2052
2336
  | `void-reject` | `{ rejected: { file: File; reason: 'type' \| 'size' \| 'count' }[] }` | Files were refused: one entry per file with the reason. Does not bubble. |
2053
2337
  | `void-change` | `{ value: File[]; files: File[] }` | |
2054
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
+
2055
2357
  Example:
2056
2358
 
2057
2359
  ```html
@@ -2090,6 +2392,17 @@ assistive technology, so set `aria-label` and state the figure in the surroundin
2090
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. |
2091
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. |
2092
2394
 
2395
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
2396
+
2397
+ | Message | Default | Replaced by |
2398
+ |---|---|---|
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 |
2405
+
2093
2406
  Example:
2094
2407
 
2095
2408
  ```html
@@ -2134,6 +2447,7 @@ Name it by what it opens: `aria-label="Main navigation"` (or `aria-labelledby`).
2134
2447
 
2135
2448
  | Attribute | Values | Default | Description |
2136
2449
  |---|---|---|---|
2450
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
2137
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. |
2138
2452
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
2139
2453
 
@@ -2142,6 +2456,19 @@ Name it by what it opens: `aria-label="Main navigation"` (or `aria-labelledby`).
2142
2456
  | `void-open` | `{ reason: 'trigger' \| 'keyboard' }` | The user opened it: `trigger` for a click, `keyboard` for Enter or Space. Does not bubble. |
2143
2457
  | `void-close` | `{ reason: 'trigger' }` | The user closed it. Does not bubble. |
2144
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
+
2145
2472
  Example:
2146
2473
 
2147
2474
  ```html
@@ -2170,6 +2497,7 @@ Markup: `<void-hover-card><void-hover-card-trigger><a href="/users/ada">@ada</a>
2170
2497
 
2171
2498
  | Attribute | Values | Default | Description |
2172
2499
  |---|---|---|---|
2500
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. |
2173
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. |
2174
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. |
2175
2503
  | `align` | `start\|center\|end` | `center` | Alignment with the trigger along that side. |
@@ -2181,6 +2509,14 @@ Markup: `<void-hover-card><void-hover-card-trigger><a href="/users/ada">@ada</a>
2181
2509
  | `void-open` | `{ reason: 'hover' \| 'focus' \| 'api' }` | The card opened. |
2182
2510
  | `void-close` | `{ reason: 'hover' \| 'blur' \| 'escape' \| 'parent' \| 'api' }` | The card is closing. Cancelable when the user caused it. |
2183
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
+
2184
2520
  Example:
2185
2521
 
2186
2522
  ```html
@@ -2242,6 +2578,13 @@ Badge overlay for notification counts on icons and online presence signals on av
2242
2578
  | `ping` | `boolean` | `false` | Draw an expanding ring around the dot to draw attention. It is not drawn when the user prefers reduced motion. |
2243
2579
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
2244
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
+
2245
2588
  Example:
2246
2589
 
2247
2590
  ```html
@@ -2310,6 +2653,13 @@ the values instead; add `show-table` to show the table below the chart too.
2310
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. |
2311
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. |
2312
2655
 
2656
+ Words it writes itself (English; the language follows the closest `lang`, see the Translation guide at https://voidable.dev/guides/translation/):
2657
+
2658
+ | Message | Default | Replaced by |
2659
+ |---|---|---|
2660
+ | `chart.line` | Line chart | `aria-label` |
2661
+ | `chart.label` | Label | `registerMessages()` only |
2662
+
2313
2663
  Example:
2314
2664
 
2315
2665
  ```html
@@ -2447,6 +2797,7 @@ Markup: `<void-menu open><void-menu-search><input type="search" placeholder="Sea
2447
2797
 
2448
2798
  | Attribute | Values | Default | Description |
2449
2799
  |---|---|---|---|
2800
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":[]}`); `[]` switches an action off. See the keyboard guide. |
2450
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. |
2451
2802
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
2452
2803
 
@@ -2454,6 +2805,24 @@ Markup: `<void-menu open><void-menu-search><input type="search" placeholder="Sea
2454
2805
  |---|---|---|
2455
2806
  | `void-select` | `{ item: VoidMenuItem; value: string }` | Bubbles from a child `<void-menu-item>`. |
2456
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
+
2457
2826
  Attributes that do not exist (and what to write instead):
2458
2827
 
2459
2828
  - `searchable`: write a <void-menu-search> around an <input type="search"> before the content
@@ -2628,6 +2997,7 @@ Markup: `<void-menu-item value="save"><void-menu-item-icon>+</void-menu-item-ico
2628
2997
 
2629
2998
  | Attribute | Values | Default | Description |
2630
2999
  |---|---|---|---|
3000
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
2631
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. |
2632
3002
  | `disabled` | `boolean` | `false` | Dim the item, skip it in keyboard navigation and stop it firing `void-select`. |
2633
3003
 
@@ -2635,6 +3005,12 @@ Markup: `<void-menu-item value="save"><void-menu-item-icon>+</void-menu-item-ico
2635
3005
  |---|---|---|
2636
3006
  | `void-select` | `{ item: VoidMenuItem; value: string }` | The item was chosen. |
2637
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
+
2638
3014
  Allowed inside: `<void-menu-group>`, `<void-menu-content>`.
2639
3015
 
2640
3016
  Attributes that do not exist (and what to write instead):
@@ -2776,7 +3152,8 @@ Markup: `<void-multiselect name="skills" placeholder="Choose skills"><void-multi
2776
3152
 
2777
3153
  | Attribute | Values | Default | Description |
2778
3154
  |---|---|---|---|
2779
- | `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. |
2780
3157
  | `disabled` | `boolean` | `false` | Stop the trigger opening and exclude the values from the form submission. |
2781
3158
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
2782
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`. |
@@ -2791,6 +3168,31 @@ Markup: `<void-multiselect name="skills" placeholder="Choose skills"><void-multi
2791
3168
  | `void-open` | `{ reason: 'trigger' \| 'keyboard' \| 'api' }` | The option list opened. |
2792
3169
  | `void-close` | `{ reason: 'trigger' \| 'escape' \| 'outside' \| 'blur' \| 'parent' \| 'api' }` | The option list is closing. |
2793
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
+
2794
3196
  Example:
2795
3197
 
2796
3198
  ```html
@@ -2900,9 +3302,20 @@ Markup: `<void-nav-menu><void-nav-menu-item><void-nav-menu-trigger><button type=
2900
3302
 
2901
3303
  | Attribute | Values | Default | Description |
2902
3304
  |---|---|---|---|
3305
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":[]}`); `[]` switches an action off. See the keyboard guide. |
2903
3306
  | `orientation` | `horizontal\|vertical` | `horizontal` | `horizontal` (default) lays the items out in a row with Left and Right arrow keys; `vertical` stacks them. |
2904
3307
  | `width` | `string` | | CSS width of the menu, such as `100%` or `40rem`. By default it is as wide as its items. |
2905
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
+
2906
3319
  Example:
2907
3320
 
2908
3321
  ```html
@@ -3022,6 +3435,7 @@ name, which `<void-field>` supplies), and the stepper buttons are its own button
3022
3435
 
3023
3436
  | Attribute | Values | Default | Description |
3024
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. |
3025
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. |
3026
3440
  | `min` | `number` | `Number.NEGATIVE_INFINITY` | Lowest allowed value. Unbounded by default. |
3027
3441
  | `max` | `number` | `Number.POSITIVE_INFINITY` | Highest allowed value. Unbounded by default. |
@@ -3033,7 +3447,7 @@ name, which `<void-field>` supplies), and the stepper buttons are its own button
3033
3447
  | `color` | `default\|error\|warning\|caution\|success\|info\|notice\|highlight` | `default` | Status colour: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. |
3034
3448
  | `placeholder` | `string` | | Hint text shown while the field is empty. |
3035
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). |
3036
- | `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. |
3037
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. |
3038
3452
  | `unit` | `string` | | Text drawn after the number inside the field, such as `kg`. Display only; it is not part of the value. |
3039
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. |
@@ -3044,6 +3458,24 @@ name, which `<void-field>` supplies), and the stepper buttons are its own button
3044
3458
  | `void-change` | `{ value: null \| number; previous: number \| null }` | |
3045
3459
  | `void-input` | `{ value: number \| null }` | |
3046
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
+
3047
3479
  Example:
3048
3480
 
3049
3481
  ```html
@@ -3155,6 +3587,14 @@ Page navigation for data tables, search result lists, and content archives.
3155
3587
  |---|---|---|
3156
3588
  | `void-change` | `{ value: number }` | |
3157
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
+
3158
3598
  Example:
3159
3599
 
3160
3600
  ```html
@@ -3298,6 +3738,7 @@ Single-character input cells for OTP verification codes, PIN entry, and multi-di
3298
3738
 
3299
3739
  | Attribute | Values | Default | Description |
3300
3740
  |---|---|---|---|
3741
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"previous":["ArrowLeft"]}`); `[]` switches an action off. See the keyboard guide. |
3301
3742
  | `length` | `number` | `6` | Number of cells, so the number of characters in the code. Defaults to 6. |
3302
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. |
3303
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. |
@@ -3316,6 +3757,23 @@ Single-character input cells for OTP verification codes, PIN entry, and multi-di
3316
3757
  | `void-complete` | `{ value: string }` | Every cell is filled. |
3317
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`). |
3318
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
+
3319
3777
  Example:
3320
3778
 
3321
3779
  ```html
@@ -3348,6 +3806,7 @@ Markup: `<void-popover><void-popover-trigger><void-button>Details</void-button><
3348
3806
 
3349
3807
  | Attribute | Values | Default | Description |
3350
3808
  |---|---|---|---|
3809
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. |
3351
3810
  | `open` | `boolean` | `false` | Whether the popover is open. |
3352
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. |
3353
3812
  | `align` | `start\|center\|end` | `start` | Alignment with the trigger along that side. |
@@ -3358,6 +3817,14 @@ Markup: `<void-popover><void-popover-trigger><void-button>Details</void-button><
3358
3817
  | `void-open` | `{ reason: 'trigger' \| 'api' }` | The popover opened. |
3359
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`). |
3360
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
+
3361
3828
  Example:
3362
3829
 
3363
3830
  ```html
@@ -3431,6 +3898,7 @@ Single mutually exclusive option for forms and surveys; typically used inside Vo
3431
3898
 
3432
3899
  | Attribute | Values | Default | Description |
3433
3900
  |---|---|---|---|
3901
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"next":["ArrowRight"]}`); `[]` switches an action off. See the keyboard guide. |
3434
3902
  | `checked` | `boolean` | `false` | Whether this radio is the selected one. Checking one radio unchecks the others with the same `name`. |
3435
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. |
3436
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. |
@@ -3444,6 +3912,16 @@ Single mutually exclusive option for forms and surveys; typically used inside Vo
3444
3912
  |---|---|---|
3445
3913
  | `void-change` | `{ value: string; checked: boolean }` | |
3446
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
+
3447
3925
  Example:
3448
3926
 
3449
3927
  ```html
@@ -3474,6 +3952,16 @@ elements, whose native radios submit; the group itself submits nothing.
3474
3952
  |---|---|---|
3475
3953
  | `void-change` | `{ value: string }` | |
3476
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
+
3477
3965
  Example:
3478
3966
 
3479
3967
  ```html
@@ -3625,6 +4113,7 @@ items; with nothing selected, the first or the last); Space selects the focused
3625
4113
 
3626
4114
  | Attribute | Values | Default | Description |
3627
4115
  |---|---|---|---|
4116
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"next":["ArrowRight"]}`); `[]` switches an action off. See the keyboard guide. |
3628
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. |
3629
4118
  | `disabled` | `boolean` | `false` | Stop the whole control reacting and exclude the value from the form submission. |
3630
4119
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
@@ -3636,6 +4125,21 @@ items; with nothing selected, the first or the last); Space selects the focused
3636
4125
  |---|---|---|
3637
4126
  | `void-change` | `{ value: string }` | |
3638
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
+
3639
4143
  Needs at least one: `<void-segmented-control-item>`.
3640
4144
 
3641
4145
  Example:
@@ -3654,9 +4158,16 @@ Individual option within a VoidSegmentedControl button group.
3654
4158
 
3655
4159
  | Attribute | Values | Default | Description |
3656
4160
  |---|---|---|---|
4161
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Space"]}`); `[]` switches an action off. See the keyboard guide. |
3657
4162
  | `value` | `string` | | What the parent reports and submits when this segment is selected. Must be unique within the control. |
3658
4163
  | `disabled` | `boolean` | `false` | Show the segment but skip it in keyboard navigation and refuse selection. |
3659
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
+
3660
4171
  Allowed inside: `<void-segmented-control>`.
3661
4172
 
3662
4173
  Example:
@@ -3771,6 +4282,12 @@ Collapsible side navigation for app shells, admin panels, and documentation site
3771
4282
  | `void-collapse` | `{ reason: 'api' }` | `toggle()` collapsed it. Does not bubble. |
3772
4283
  | `void-expand` | `{ reason: 'api' }` | `toggle()` expanded it. Does not bubble. |
3773
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
+
3774
4291
  Example:
3775
4292
 
3776
4293
  ```html
@@ -3853,7 +4370,13 @@ Indeterminate loading indicator for async operations, button loading states, and
3853
4370
  | Attribute | Values | Default | Description |
3854
4371
  |---|---|---|---|
3855
4372
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
3856
- | `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` |
3857
4380
 
3858
4381
  Example:
3859
4382
 
@@ -3959,6 +4482,14 @@ Presence indicator for user lists and chat rosters showing online/away/offline s
3959
4482
  |---|---|---|---|
3960
4483
  | `status` | `online\|away\|offline` | `offline` | Presence state: `online`, `away` or `offline` (default). Sets the colour and the accessible name (`Online`, `Away`, `Offline`). |
3961
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
+
3962
4493
  Example:
3963
4494
 
3964
4495
  ```html
@@ -3974,6 +4505,12 @@ Multi-step progress tracker for onboarding flows, checkout funnels, and guided w
3974
4505
  | `value` | `number` | `0` | Zero-based index of the current step. Earlier steps show as completed, later ones as upcoming. |
3975
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. |
3976
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
+
3977
4514
  Example:
3978
4515
 
3979
4516
  ```html
@@ -3986,6 +4523,7 @@ On/off toggle for feature flags, notification preferences, and settings that tak
3986
4523
 
3987
4524
  | Attribute | Values | Default | Description |
3988
4525
  |---|---|---|---|
4526
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
3989
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. |
3990
4528
  | `disabled` | `boolean` | `false` | Stop the switch reacting and exclude it from the form submission. Also disabled by an enclosing `<fieldset disabled>`. |
3991
4529
  | `value` | `string` | `on` | Submitted under `name` while checked (like a native checkbox). |
@@ -3998,6 +4536,18 @@ On/off toggle for feature flags, notification preferences, and settings that tak
3998
4536
  |---|---|---|
3999
4537
  | `void-change` | `{ value: string; checked: boolean }` | |
4000
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
+
4001
4551
  Example:
4002
4552
 
4003
4553
  ```html
@@ -4030,6 +4580,40 @@ overflows, and fades its edges while there is more to scroll to. `max-height` ma
4030
4580
  scroll vertically too, which is what `sticky-header` needs; without it a sticky header sticks to
4031
4581
  the page.
4032
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
+
4033
4617
  | Attribute | Values | Default | Description |
4034
4618
  |---|---|---|---|
4035
4619
  | `striped` | `boolean` | `false` | Shade every other body row. |
@@ -4043,6 +4627,143 @@ the page.
4043
4627
  | `sticky-column` | `boolean` | `false` | Keeps the first column in view while the table scrolls horizontally. |
4044
4628
  | `max-height` | `string \| null` | | Height (a CSS length) at which a scrollable table scrolls vertically. |
4045
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>`.
4046
4767
 
4047
4768
  Example:
4048
4769
 
@@ -4087,6 +4808,7 @@ Markup: `<void-tabs value="a"><void-tabs-list><void-tabs-trigger value="a">A</vo
4087
4808
 
4088
4809
  | Attribute | Values | Default | Description |
4089
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. |
4090
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`. |
4091
4813
  | `size` | `sm\|md\|lg` | `md` | Size step of the tabs: `sm`, `md` (default) or `lg`. |
4092
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. |
@@ -4095,6 +4817,18 @@ Markup: `<void-tabs value="a"><void-tabs-list><void-tabs-trigger value="a">A</vo
4095
4817
  |---|---|---|
4096
4818
  | `void-change` | `{ value: string }` | The user selected a tab. |
4097
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
+
4098
4832
  Example:
4099
4833
 
4100
4834
  ```html
@@ -4213,6 +4947,12 @@ anywhere else it has no role.
4213
4947
  |---|---|---|
4214
4948
  | `void-remove` | `(no detail)` | |
4215
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
+
4216
4956
  Example:
4217
4957
 
4218
4958
  ```html
@@ -4225,11 +4965,12 @@ Multi-tag input field for email recipients, category labels, keyword tagging, an
4225
4965
 
4226
4966
  | Attribute | Values | Default | Description |
4227
4967
  |---|---|---|---|
4968
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"add":["Enter",";"]}`); `[]` switches an action off. See the keyboard guide. |
4228
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. |
4229
4970
  | `disabled` | `boolean` | `false` | Stop the field accepting input and removing tags, and exclude the values from the form submission. |
4230
4971
  | `readonly` | `boolean` | `false` | Show the tags but do not let the user add or remove any. Still submitted. |
4231
4972
  | `max` | `number` | `Infinity` | Maximum number of tags. Once reached, the entry field is hidden. Unlimited by default. |
4232
- | `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...`). |
4233
4974
  | `size` | `sm\|md\|lg` | `md` | Size step: `sm`, `md` (default) or `lg`. |
4234
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`. |
4235
4976
  | `variant` | `filled\|outline` | `outline` | How the tags are drawn: `outline` (default) or `filled`. |
@@ -4241,6 +4982,23 @@ Multi-tag input field for email recipients, category labels, keyword tagging, an
4241
4982
  |---|---|---|
4242
4983
  | `void-change` | `{ value: TagValue[] }` | |
4243
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
+
4244
5002
  Example:
4245
5003
 
4246
5004
  ```html
@@ -4323,6 +5081,12 @@ Markup: `<void-toast color="success"><void-toast-title>Saved</void-toast-title><
4323
5081
  |---|---|---|
4324
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`. |
4325
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
+
4326
5090
  Attributes that do not exist (and what to write instead):
4327
5091
 
4328
5092
  - `heading`: write the title as <void-toast-title>...</void-toast-title> before the description
@@ -4392,6 +5156,12 @@ is visible there, but the page outside the dialog (the container included) stays
4392
5156
  |---|---|---|---|
4393
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. |
4394
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
+
4395
5165
  Example:
4396
5166
 
4397
5167
  ```html
@@ -4449,6 +5219,7 @@ Pressable toggle button for toolbar actions and editor formatting controls with
4449
5219
 
4450
5220
  | Attribute | Values | Default | Description |
4451
5221
  |---|---|---|---|
5222
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. |
4452
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`. |
4453
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`. |
4454
5225
  | `disabled` | `boolean` | `false` | Ignore clicks and keys, and take the toggle out of the tab order. A `<fieldset disabled>` ancestor does the same. |
@@ -4460,6 +5231,12 @@ Pressable toggle button for toolbar actions and editor formatting controls with
4460
5231
  |---|---|---|
4461
5232
  | `void-change` | `{ value: string; pressed: boolean }` | |
4462
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
+
4463
5240
  Example:
4464
5241
 
4465
5242
  ```html
@@ -4472,6 +5249,7 @@ Multi-button toggle set for text editor toolbars and filter chips where one or m
4472
5249
 
4473
5250
  | Attribute | Values | Default | Description |
4474
5251
  |---|---|---|---|
5252
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"next":["ArrowRight"]}`); `[]` switches an action off. See the keyboard guide. |
4475
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`. |
4476
5254
  | `multiple` | `boolean` | `false` | Let several toggles be pressed at once. Without it pressing one releases the others. |
4477
5255
  | `disabled` | `boolean` | `false` | Stop every toggle reacting and exclude the value from the form submission. |
@@ -4485,6 +5263,19 @@ Multi-button toggle set for text editor toolbars and filter chips where one or m
4485
5263
  |---|---|---|
4486
5264
  | `void-change` | `{ value: string[] } \| { value: string }` | |
4487
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
+
4488
5279
  Example:
4489
5280
 
4490
5281
  ```html
@@ -4540,6 +5331,7 @@ Markup: `<void-tooltip><void-tooltip-trigger><void-button>Copy</void-button></vo
4540
5331
 
4541
5332
  | Attribute | Values | Default | Description |
4542
5333
  |---|---|---|---|
5334
+ | `keys` | `KeyOverrides \| null` | | Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. |
4543
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. |
4544
5336
  | `align` | `start\|center\|end` | `center` | Alignment with the trigger along that side. |
4545
5337
  | `delay` | `number` | `200` | Milliseconds the pointer rests on the trigger before the content appears (keyboard focus shows it at once). Defaults to 200. |
@@ -4550,6 +5342,14 @@ Markup: `<void-tooltip><void-tooltip-trigger><void-button>Copy</void-button></vo
4550
5342
  | `void-open` | `{ reason: 'hover' \| 'focus' \| 'api' }` | The tooltip appeared. |
4551
5343
  | `void-close` | `{ reason: 'hover' \| 'blur' \| 'escape' \| 'parent' \| 'api' }` | The tooltip is hiding. |
4552
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
+
4553
5353
  Attributes that do not exist (and what to write instead):
4554
5354
 
4555
5355
  - `visible`: the shown state is the open attribute