@webtides/element-library 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/CHANGELOG.md +300 -0
  2. package/README.md +72 -56
  3. package/all.js +16 -0
  4. package/catalog.js +17 -1
  5. package/custom-elements.json +15912 -10065
  6. package/package.json +1 -1
  7. package/src/components/accordion/accordion.changelog.md +11 -0
  8. package/src/components/accordion/accordion.js +15 -3
  9. package/src/components/accordion/accordion.readme.md +27 -1
  10. package/src/components/accordion/accordion.style.js +19 -0
  11. package/src/components/app-bar/app-bar.changelog.md +24 -0
  12. package/src/components/app-bar/app-bar.define.js +3 -0
  13. package/src/components/app-bar/app-bar.js +91 -0
  14. package/src/components/app-bar/app-bar.readme.md +130 -0
  15. package/src/components/app-bar/app-bar.style.js +103 -0
  16. package/src/components/app-frame/app-frame.changelog.md +59 -0
  17. package/src/components/app-frame/app-frame.define.js +3 -0
  18. package/src/components/app-frame/app-frame.events.js +6 -0
  19. package/src/components/app-frame/app-frame.js +1085 -0
  20. package/src/components/app-frame/app-frame.readme.md +425 -0
  21. package/src/components/app-frame/app-frame.style.js +534 -0
  22. package/src/components/button/button.changelog.md +21 -0
  23. package/src/components/button/button.events.js +3 -0
  24. package/src/components/button/button.js +145 -3
  25. package/src/components/button/button.readme.md +72 -4
  26. package/src/components/button/button.style.js +167 -8
  27. package/src/components/button-group/button-group.changelog.md +10 -0
  28. package/src/components/button-group/button-group.readme.md +2 -0
  29. package/src/components/button-group/button-group.style.js +6 -2
  30. package/src/components/checkbox-group-field/checkbox-group-field.changelog.md +6 -0
  31. package/src/components/checkbox-group-field/checkbox-group-field.js +7 -2
  32. package/src/components/checkbox-group-field/checkbox-group-field.readme.md +23 -1
  33. package/src/components/combobox-field/combobox-field.changelog.md +6 -0
  34. package/src/components/combobox-field/combobox-field.readme.md +8 -0
  35. package/src/components/combobox-field/combobox-field.style.js +2 -0
  36. package/src/components/date-field/date-field.changelog.md +6 -0
  37. package/src/components/date-field/date-field.readme.md +10 -0
  38. package/src/components/date-field/date-field.style.js +8 -3
  39. package/src/components/description-list/description-list.changelog.md +42 -0
  40. package/src/components/description-list/description-list.define.js +3 -0
  41. package/src/components/description-list/description-list.js +49 -0
  42. package/src/components/description-list/description-list.readme.md +161 -0
  43. package/src/components/description-list/description-list.style.js +169 -0
  44. package/src/components/dialog/dialog.changelog.md +7 -0
  45. package/src/components/dialog/dialog.readme.md +5 -0
  46. package/src/components/dialog/dialog.style.js +17 -2
  47. package/src/components/divider/divider.changelog.md +6 -0
  48. package/src/components/divider/divider.readme.md +1 -1
  49. package/src/components/divider/divider.style.js +6 -0
  50. package/src/components/drawer/drawer.changelog.md +7 -0
  51. package/src/components/drawer/drawer.readme.md +7 -6
  52. package/src/components/drawer/drawer.style.js +35 -2
  53. package/src/components/dropdown/dropdown.readme.md +6 -1
  54. package/src/components/file-field/file-field.changelog.md +8 -0
  55. package/src/components/file-field/file-field.js +135 -5
  56. package/src/components/file-field/file-field.readme.md +35 -6
  57. package/src/components/file-field/file-field.style.js +71 -0
  58. package/src/components/form-field/form-field.js +1 -1
  59. package/src/components/input-field/input-field.changelog.md +10 -0
  60. package/src/components/input-field/input-field.js +192 -14
  61. package/src/components/input-field/input-field.readme.md +88 -2
  62. package/src/components/input-field/input-field.style.js +2 -0
  63. package/src/components/list/list.changelog.md +30 -0
  64. package/src/components/list/list.define.js +3 -0
  65. package/src/components/list/list.js +68 -0
  66. package/src/components/list/list.readme.md +123 -0
  67. package/src/components/list/list.style.js +56 -0
  68. package/src/components/list-item/list-item.changelog.md +40 -0
  69. package/src/components/list-item/list-item.define.js +3 -0
  70. package/src/components/list-item/list-item.js +130 -0
  71. package/src/components/list-item/list-item.readme.md +144 -0
  72. package/src/components/list-item/list-item.style.js +246 -0
  73. package/src/components/menu/menu.changelog.md +44 -0
  74. package/src/components/menu/menu.define.js +3 -0
  75. package/src/components/menu/menu.events.js +5 -0
  76. package/src/components/menu/menu.js +793 -0
  77. package/src/components/menu/menu.readme.md +313 -0
  78. package/src/components/menu/menu.style.js +59 -0
  79. package/src/components/menu-group/menu-group.changelog.md +20 -0
  80. package/src/components/menu-group/menu-group.define.js +3 -0
  81. package/src/components/menu-group/menu-group.js +44 -0
  82. package/src/components/menu-group/menu-group.readme.md +74 -0
  83. package/src/components/menu-group/menu-group.style.js +38 -0
  84. package/src/components/menu-item/menu-item.changelog.md +32 -0
  85. package/src/components/menu-item/menu-item.define.js +3 -0
  86. package/src/components/menu-item/menu-item.js +168 -0
  87. package/src/components/menu-item/menu-item.readme.md +132 -0
  88. package/src/components/menu-item/menu-item.style.js +117 -0
  89. package/src/components/nav/nav.changelog.md +35 -0
  90. package/src/components/nav/nav.define.js +3 -0
  91. package/src/components/nav/nav.js +212 -0
  92. package/src/components/nav/nav.readme.md +248 -0
  93. package/src/components/nav/nav.style.js +269 -0
  94. package/src/components/nav-item/nav-item.changelog.md +25 -0
  95. package/src/components/nav-item/nav-item.define.js +3 -0
  96. package/src/components/nav-item/nav-item.js +75 -0
  97. package/src/components/nav-item/nav-item.readme.md +111 -0
  98. package/src/components/nav-item/nav-item.style.js +159 -0
  99. package/src/components/otp-field/otp-field.changelog.md +6 -0
  100. package/src/components/otp-field/otp-field.readme.md +8 -0
  101. package/src/components/otp-field/otp-field.style.js +8 -3
  102. package/src/components/pagination/pagination.changelog.md +8 -0
  103. package/src/components/pagination/pagination.js +123 -49
  104. package/src/components/pagination/pagination.readme.md +24 -6
  105. package/src/components/pagination/pagination.style.js +11 -1
  106. package/src/components/password-field/password-field.changelog.md +7 -0
  107. package/src/components/password-field/password-field.readme.md +11 -1
  108. package/src/components/password-field/password-field.style.js +2 -0
  109. package/src/components/popover/popover.changelog.md +6 -0
  110. package/src/components/popover/popover.style.js +1 -0
  111. package/src/components/radio-field/radio-field.changelog.md +6 -0
  112. package/src/components/radio-field/radio-field.js +7 -2
  113. package/src/components/radio-field/radio-field.readme.md +23 -1
  114. package/src/components/scroll-to-top/scroll-to-top.changelog.md +7 -5
  115. package/src/components/scroll-to-top/scroll-to-top.js +16 -12
  116. package/src/components/scroll-to-top/scroll-to-top.readme.md +2 -0
  117. package/src/components/segmented-field/segmented-field.changelog.md +27 -0
  118. package/src/components/segmented-field/segmented-field.define.js +3 -0
  119. package/src/components/segmented-field/segmented-field.js +175 -0
  120. package/src/components/segmented-field/segmented-field.readme.md +140 -0
  121. package/src/components/segmented-field/segmented-field.style.js +193 -0
  122. package/src/components/splitter/splitter.changelog.md +24 -0
  123. package/src/components/splitter/splitter.define.js +3 -0
  124. package/src/components/splitter/splitter.events.js +4 -0
  125. package/src/components/splitter/splitter.js +237 -0
  126. package/src/components/splitter/splitter.readme.md +164 -0
  127. package/src/components/splitter/splitter.style.js +100 -0
  128. package/src/components/status-bar/status-bar.changelog.md +25 -0
  129. package/src/components/status-bar/status-bar.define.js +3 -0
  130. package/src/components/status-bar/status-bar.js +74 -0
  131. package/src/components/status-bar/status-bar.readme.md +139 -0
  132. package/src/components/status-bar/status-bar.style.js +122 -0
  133. package/src/components/tab-group/tab-group.changelog.md +7 -0
  134. package/src/components/tab-group/tab-group.js +30 -9
  135. package/src/components/tab-group/tab-group.readme.md +14 -0
  136. package/src/components/textarea-field/textarea-field.changelog.md +6 -0
  137. package/src/components/textarea-field/textarea-field.js +14 -1
  138. package/src/components/textarea-field/textarea-field.readme.md +23 -1
  139. package/src/components/toast/toast.changelog.md +6 -0
  140. package/src/components/toast/toast.readme.md +5 -3
  141. package/src/components/toast/toast.style.js +22 -6
  142. package/src/components/toolbar/toolbar.changelog.md +24 -0
  143. package/src/components/toolbar/toolbar.define.js +3 -0
  144. package/src/components/toolbar/toolbar.js +233 -0
  145. package/src/components/toolbar/toolbar.readme.md +156 -0
  146. package/src/components/toolbar/toolbar.style.js +49 -0
  147. package/src/components/tooltip/tooltip.changelog.md +11 -0
  148. package/src/components/tooltip/tooltip.js +51 -4
  149. package/src/components/tooltip/tooltip.readme.md +26 -1
  150. package/src/components/tree/tree.changelog.md +23 -0
  151. package/src/components/tree/tree.define.js +3 -0
  152. package/src/components/tree/tree.js +138 -0
  153. package/src/components/tree/tree.readme.md +119 -0
  154. package/src/components/tree/tree.style.js +16 -0
  155. package/src/components/tree-item/tree-item.changelog.md +23 -0
  156. package/src/components/tree-item/tree-item.define.js +3 -0
  157. package/src/components/tree-item/tree-item.events.js +3 -0
  158. package/src/components/tree-item/tree-item.js +246 -0
  159. package/src/components/tree-item/tree-item.readme.md +128 -0
  160. package/src/components/tree-item/tree-item.style.js +226 -0
  161. package/src/styles/appearance.style.js +47 -0
  162. package/src/styles/choice-group.style.js +27 -1
  163. package/src/styles/input-control.style.js +87 -0
  164. package/src/styles/modal.style.js +14 -1
  165. package/src/styles/native.css +100 -0
  166. package/src/styles/size.style.js +41 -0
  167. package/src/utils/floating.js +15 -1
  168. package/src/utils/focus.js +69 -0
  169. package/src/utils/options.js +35 -0
  170. package/src/utils/scroll.js +24 -0
  171. package/src/utils/text-entry-attributes.js +13 -0
  172. package/types/all.d.ts +16 -0
  173. package/types/src/components/accordion/accordion.d.ts +3 -1
  174. package/types/src/components/app-bar/app-bar.d.ts +43 -0
  175. package/types/src/components/app-bar/app-bar.define.d.ts +1 -0
  176. package/types/src/components/app-bar/app-bar.style.d.ts +2 -0
  177. package/types/src/components/app-frame/app-frame.d.ts +497 -0
  178. package/types/src/components/app-frame/app-frame.define.d.ts +1 -0
  179. package/types/src/components/app-frame/app-frame.events.d.ts +7 -0
  180. package/types/src/components/app-frame/app-frame.style.d.ts +8 -0
  181. package/types/src/components/button/button.d.ts +61 -0
  182. package/types/src/components/button/button.events.d.ts +4 -0
  183. package/types/src/components/checkbox-group-field/checkbox-group-field.d.ts +5 -2
  184. package/types/src/components/combobox-field/combobox-field.d.ts +10 -0
  185. package/types/src/components/date-field/date-field.d.ts +10 -0
  186. package/types/src/components/description-list/description-list.d.ts +34 -0
  187. package/types/src/components/description-list/description-list.define.d.ts +1 -0
  188. package/types/src/components/description-list/description-list.style.d.ts +2 -0
  189. package/types/src/components/file-field/file-field.d.ts +68 -3
  190. package/types/src/components/form-field/form-field.d.ts +1 -1
  191. package/types/src/components/input-field/input-field.d.ts +99 -0
  192. package/types/src/components/list/list.d.ts +41 -0
  193. package/types/src/components/list/list.define.d.ts +1 -0
  194. package/types/src/components/list/list.style.d.ts +2 -0
  195. package/types/src/components/list-item/list-item.d.ts +64 -0
  196. package/types/src/components/list-item/list-item.define.d.ts +1 -0
  197. package/types/src/components/list-item/list-item.style.d.ts +2 -0
  198. package/types/src/components/menu/menu.d.ts +362 -0
  199. package/types/src/components/menu/menu.define.d.ts +1 -0
  200. package/types/src/components/menu/menu.events.d.ts +6 -0
  201. package/types/src/components/menu/menu.style.d.ts +2 -0
  202. package/types/src/components/menu-group/menu-group.d.ts +24 -0
  203. package/types/src/components/menu-group/menu-group.define.d.ts +1 -0
  204. package/types/src/components/menu-group/menu-group.style.d.ts +2 -0
  205. package/types/src/components/menu-item/menu-item.d.ts +80 -0
  206. package/types/src/components/menu-item/menu-item.define.d.ts +1 -0
  207. package/types/src/components/menu-item/menu-item.style.d.ts +2 -0
  208. package/types/src/components/nav/nav.d.ts +103 -0
  209. package/types/src/components/nav/nav.define.d.ts +1 -0
  210. package/types/src/components/nav/nav.style.d.ts +2 -0
  211. package/types/src/components/nav-item/nav-item.d.ts +39 -0
  212. package/types/src/components/nav-item/nav-item.define.d.ts +1 -0
  213. package/types/src/components/nav-item/nav-item.style.d.ts +2 -0
  214. package/types/src/components/otp-field/otp-field.d.ts +10 -0
  215. package/types/src/components/pagination/pagination.d.ts +31 -2
  216. package/types/src/components/password-field/password-field.d.ts +10 -0
  217. package/types/src/components/radio-field/radio-field.d.ts +5 -2
  218. package/types/src/components/scroll-to-top/scroll-to-top.d.ts +6 -5
  219. package/types/src/components/segmented-field/segmented-field.d.ts +85 -0
  220. package/types/src/components/segmented-field/segmented-field.define.d.ts +1 -0
  221. package/types/src/components/segmented-field/segmented-field.style.d.ts +2 -0
  222. package/types/src/components/splitter/splitter.d.ts +127 -0
  223. package/types/src/components/splitter/splitter.define.d.ts +1 -0
  224. package/types/src/components/splitter/splitter.events.d.ts +5 -0
  225. package/types/src/components/splitter/splitter.style.d.ts +2 -0
  226. package/types/src/components/status-bar/status-bar.d.ts +44 -0
  227. package/types/src/components/status-bar/status-bar.define.d.ts +1 -0
  228. package/types/src/components/status-bar/status-bar.style.d.ts +2 -0
  229. package/types/src/components/tab-group/tab-group.d.ts +17 -0
  230. package/types/src/components/textarea-field/textarea-field.d.ts +7 -0
  231. package/types/src/components/toolbar/toolbar.d.ts +96 -0
  232. package/types/src/components/toolbar/toolbar.define.d.ts +1 -0
  233. package/types/src/components/toolbar/toolbar.style.d.ts +2 -0
  234. package/types/src/components/tooltip/tooltip.d.ts +26 -0
  235. package/types/src/components/tree/tree.d.ts +62 -0
  236. package/types/src/components/tree/tree.define.d.ts +1 -0
  237. package/types/src/components/tree/tree.style.d.ts +2 -0
  238. package/types/src/components/tree-item/tree-item.d.ts +106 -0
  239. package/types/src/components/tree-item/tree-item.define.d.ts +1 -0
  240. package/types/src/components/tree-item/tree-item.events.d.ts +4 -0
  241. package/types/src/components/tree-item/tree-item.style.d.ts +2 -0
  242. package/types/src/styles/appearance.style.d.ts +31 -0
  243. package/types/src/styles/choice-group.style.d.ts +1 -1
  244. package/types/src/styles/input-control.style.d.ts +15 -0
  245. package/types/src/styles/modal.style.d.ts +5 -0
  246. package/types/src/styles/size.style.d.ts +24 -0
  247. package/types/src/utils/floating.d.ts +11 -0
  248. package/types/src/utils/focus.d.ts +25 -0
  249. package/types/src/utils/options.d.ts +17 -0
  250. package/types/src/utils/scroll.d.ts +11 -0
  251. package/types/src/utils/text-entry-attributes.d.ts +10 -0
  252. package/web-types.json +2935 -308
@@ -57,6 +57,13 @@ const style = css`
57
57
  transition: background var(--el-duration-md, 0s) var(--el-ease, linear);
58
58
  }
59
59
 
60
+ /* A page that is a link (\`href\`) has the box of a button: a button counts its sizes from
61
+ its border and has no line under its text. */
62
+ a[part~='button'] {
63
+ box-sizing: border-box;
64
+ text-decoration: none;
65
+ }
66
+
60
67
  [part~='ellipsis'] {
61
68
  color: var(--el-color-fg-muted, inherit);
62
69
  user-select: none;
@@ -140,7 +147,10 @@ const style = css`
140
147
  }
141
148
  }
142
149
 
143
- [part~='button'][disabled] {
150
+ /* The way back on the first page and the way on at the last one: a button that is disabled,
151
+ or a link without an address. */
152
+ [part~='button'][disabled],
153
+ [part~='button'][aria-disabled='true'] {
144
154
  background: transparent;
145
155
  opacity: 0.55;
146
156
  cursor: not-allowed;
@@ -12,6 +12,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
12
12
 
13
13
  ## Unreleased
14
14
 
15
+ ## [0.5.0] - 2026-11-27
16
+
17
+ ### Added
18
+
19
+ - Takes content of the page into its control, an element with `slot="start"` or `slot="end"`, and has the button that empties it (`clearable`, `clear-label`), as `el-input-field`, which it extends. Its own button, the one that shows the password, stays beside the control. ([#168](https://github.com/webtides/element-library/issues/168))
20
+ - `maxlength` and `minlength` are passed on to the input, as in `el-input-field`: a password that is typed shorter than `minlength` makes the field invalid, with its `error-message`. ([#190](https://github.com/webtides/element-library/issues/190))
21
+
15
22
  ## [0.3.0] - 2026-11-17
16
23
 
17
24
  ### Added
@@ -29,7 +29,7 @@ import '@webtides/element-library/password-field/define';
29
29
 
30
30
  #### Properties/Attributes
31
31
 
32
- Inherits all of `input-field`'s properties (`name`, `value`, `size`, `placeholder`, `required`, `disabled`, `label`, `labelScreenReaderOnly`, `errorMessage`, `helpMessage`, `pattern`, `valid`, `touched`, and the keyboard and autofill hints `autocomplete`, `inputmode`, `enterkeyhint`, `autocapitalize`, `autocorrect`, `spellcheck`) and adds:
32
+ Inherits all of `input-field`'s properties (`name`, `value`, `size`, `placeholder`, `required`, `disabled`, `label`, `labelScreenReaderOnly`, `errorMessage`, `helpMessage`, `pattern`, `maxlength`, `minlength`, `valid`, `touched`, and the keyboard and autofill hints `autocomplete`, `inputmode`, `enterkeyhint`, `autocapitalize`, `autocorrect`, `spellcheck`) and adds:
33
33
 
34
34
  | Name | Type | Default | Description |
35
35
  | --- | --- | --- | --- |
@@ -62,6 +62,16 @@ The label, the help message, the control and the error message stack in a column
62
62
 
63
63
  On a touch screen (`@media (any-pointer: coarse)`) the reveal button is at least `--el-touch-target` wide and high, the input at least that high, and the clear cross of an invalid field at least that wide and high. Without that token, and on a fine pointer, the sizes stay as they are.
64
64
 
65
+ ## Content in the control
66
+
67
+ As [`el-input-field`](../input-field/input-field.readme.md#content-in-the-control), which this field extends, it takes an element of the page with `slot="start"` or `slot="end"` into its control, and `clearable="true"` adds a button that empties it (`clear-label` is its name).
68
+
69
+ ```html
70
+ <el-password-field name="password" label="Password" minlength="12"><span slot="end">min. 12</span></el-password-field>
71
+ ```
72
+
73
+ The button that shows the password is not part of the control: it stands after it, as it does without content.
74
+
65
75
  ## Accessibility
66
76
 
67
77
  - The reveal button is a real `<button>` with an `aria-label` that flips between "Show password" and "Hide password", and an `aria-pressed` state, so its purpose and state are announced. Set `show-label` and `hide-label` to translate the two labels.
@@ -1,6 +1,7 @@
1
1
  import hostStyle from '../../styles/host.style.js';
2
2
  import formControlStyle from '../../styles/form-control.style.js';
3
3
  import sizeStyle from '../../styles/size.style.js';
4
+ import inputControlStyle from '../../styles/input-control.style.js';
4
5
 
5
6
  const css = String.raw;
6
7
 
@@ -81,5 +82,6 @@ export default [
81
82
  hostStyle('el-password-field'),
82
83
  formControlStyle('el-password-field'),
83
84
  sizeStyle('el-password-field'),
85
+ inputControlStyle('el-password-field'),
84
86
  style,
85
87
  ].join('\n');
@@ -12,6 +12,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
12
12
 
13
13
  ## Unreleased
14
14
 
15
+ ## [0.5.0] - 2026-11-27
16
+
17
+ ### Changed
18
+
19
+ - The panel is no part of a row of joined buttons: it stops the property that pulls a button over its neighbour there (`--_el-group-overlap`), as the ones for the corners and the line. ([#206](https://github.com/webtides/element-library/issues/206))
20
+
15
21
  ## [0.3.0] - 2026-11-17
16
22
 
17
23
  ### Added
@@ -35,6 +35,7 @@ const style = css`
35
35
  --_el-group-radius-start: initial;
36
36
  --_el-group-radius-end: initial;
37
37
  --_el-group-divider: initial;
38
+ --_el-group-overlap: initial;
38
39
  }
39
40
  `;
40
41
 
@@ -12,6 +12,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
12
12
 
13
13
  ## Unreleased
14
14
 
15
+ ## [0.5.0] - 2026-11-27
16
+
17
+ ### Added
18
+
19
+ - An option can show something in front of its label: `color` is a colour that is drawn as a dot, `icon` the address of an SVG symbol, as an option of `el-segmented-field` has it. Things a user knows by their colour, tags or calendars, are found by it where they are chosen. Both are decorations, hidden from assistive technology: the label stays the name of the option. They are part of the option, so they work for options as an attribute and as a property, and are in server-rendered markup. The dot keeps its colour where the user forces colours. ([#198](https://github.com/webtides/element-library/issues/198))
20
+
15
21
  ## [0.3.0] - 2026-11-17
16
22
 
17
23
  ### Changed
@@ -1,6 +1,7 @@
1
1
  import { html, defineElement } from '@webtides/element-js';
2
2
  import FormField from '../form-field/form-field.js';
3
3
  import { focusLeft } from '../../utils/focus.js';
4
+ import { optionStartTemplate } from '../../utils/options.js';
4
5
  import style from './radio-field.style.js';
5
6
 
6
7
  /**
@@ -18,9 +19,12 @@ import style from './radio-field.style.js';
18
19
  * because of it. Inherits `valid` and `invalid` from `FormField`.
19
20
  *
20
21
  * @property {string | null} value - The selected option's value.
21
- * @property {Array<string | { value: string, label?: string, disabled?: boolean }>} options -
22
+ * @property {Array<string | { value: string, label?: string, disabled?: boolean, color?: string, icon?: string }>} options -
22
23
  * Options to render. Accepts plain strings (`['Yes', 'No']`) or option objects
23
- * (`[{ value, label, disabled? }]`). Strings are used as both value and label.
24
+ * (`[{ value, label, disabled? }]`). Strings are used as both value and label. An object can
25
+ * name a `color`, which is drawn as a dot in front of the label, and an `icon`, the address of
26
+ * an SVG symbol (`'#tag'`, `'/icons.svg#tag'`), which is drawn there as well. Both are
27
+ * decorations: the label stays the name of the option.
24
28
  */
25
29
  export default class RadioField extends FormField {
26
30
  constructor(options) {
@@ -151,6 +155,7 @@ export default class RadioField extends FormField {
151
155
  aria-describedby="${this._describedBy()}"
152
156
  />
153
157
  <span class="radio-indicator" aria-hidden="true"></span>
158
+ ${optionStartTemplate(option)}
154
159
  <span class="option-label">${label}</span>
155
160
  </label>
156
161
  `;
@@ -36,6 +36,28 @@ field.options = [
36
36
  ];
37
37
  ```
38
38
 
39
+ #### A colour or an icon in front of the label
40
+
41
+ Tags with a colour, calendars, categories with an icon: things a user knows by their colour are found by it where they are chosen. An option can name a `color`, which is drawn as a dot in front of its label, and an `icon`, the address of an SVG symbol, which is drawn there as well:
42
+
43
+ ```html
44
+ <svg width="0" height="0" style="position:absolute" aria-hidden="true">
45
+ <symbol id="icon-archive" viewBox="0 0 24 24">…</symbol>
46
+ </svg>
47
+
48
+ <el-radio-field
49
+ name="tags"
50
+ label="Calendar"
51
+ options='[{"value":"work","label":"Work","color":"#c81e1e"},{"value":"home","label":"Home","color":"#1e5fc8"},{"value":"archive","label":"Archive","icon":"#icon-archive"}]'
52
+ ></el-radio-field>
53
+ ```
54
+
55
+ - **`color`** is any colour of CSS. The dot has it where the user forces colours as well: it is the colour of a thing of the page, as the colour of a picture is.
56
+ - **`icon`** is the address of an SVG symbol: one of the page (`#icon-archive`) or of a file (`/icons.svg#archive`), as an option of [`el-segmented-field`](../segmented-field/segmented-field.readme.md) has it. The icon has the colour of the text and is 1.25em wide and high. An option with both shows the dot first.
57
+ - **Both are decorations.** They are hidden from assistive technology, and the label stays the name of the option: say in the label what the colour says to the eye.
58
+ - **As an attribute and as a property**, and in server-rendered markup: they are part of the option, as its label is.
59
+ - An option that names neither has nothing in front of its label, and a click on the dot or on the icon checks the option, as a click on its label does.
60
+
39
61
  ## API
40
62
 
41
63
  #### Properties/Attributes
@@ -45,7 +67,7 @@ Inherits all of `form-field`'s properties (`name`, `value`, `required`, `disable
45
67
  | Name | Type | Default | Description |
46
68
  | --- | --- | --- | --- |
47
69
  | `value` | `string \| null` | `null` | The selected option's value. |
48
- | `options` | `Array<string \| { value: string, label?: string, disabled?: boolean }>` | `[]` | Options to render. Strings are used as both value and label; objects allow a separate label/disabled. |
70
+ | `options` | `Array<string \| { value: string, label?: string, disabled?: boolean, color?: string, icon?: string }>` | `[]` | Options to render. Strings are used as both value and label; objects allow a separate label/disabled, and a `color` or an `icon` in front of the label. |
49
71
 
50
72
  #### Events
51
73
 
@@ -10,11 +10,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
10
10
  Uncomment headings as needed.
11
11
  -->
12
12
 
13
- <!-- ## Unreleased -->
14
- <!-- ### Added -->
15
- <!-- ### Changed -->
16
- <!-- ### Removed -->
17
- <!-- ### Fixed -->
13
+ ## Unreleased
14
+
15
+ ## [0.4.0] - 2026-11-27
16
+
17
+ ### Changed
18
+
19
+ - It scrolls the element around it that scrolls to the top, the content of an `el-app-frame` for example, and the window where there is none. Before, it scrolled the window whatever it was in. `duration` is ignored when that element has `scroll-behavior: smooth`. ([#176](https://github.com/webtides/element-library/issues/176))
18
20
 
19
21
  ## [0.1.0] - 2026-06-03
20
22
 
@@ -1,17 +1,19 @@
1
1
  import { StyledElement, defineElement } from '@webtides/element-js';
2
+ import { scrollContainer } from '../../utils/scroll.js';
2
3
  import style from './scroll-to-top.style.js';
3
4
 
4
5
  /**
5
- * Wraps any click-emitting child (`<a>`, `<button>`, …) and smoothly scrolls the window
6
- * to the top when the child is clicked.
6
+ * Wraps any click-emitting child (`<a>`, `<button>`, …) and smoothly scrolls to the top when the
7
+ * child is clicked: the window, or the element around it that scrolls, the content of an
8
+ * `el-app-frame` for example.
7
9
  *
8
10
  * @element el-scroll-to-top
9
11
  *
10
12
  * @slot - Default slot. Any child that emits a `click` event will trigger the scroll.
11
13
  *
12
14
  * @property {number} duration - Duration of the easing animation in milliseconds. Ignored
13
- * when the page's `html` element has `scroll-behavior: smooth` (the browser drives the
14
- * scroll in that case).
15
+ * when what scrolls has `scroll-behavior: smooth`, the `html` element for the window (the
16
+ * browser drives the scroll in that case).
15
17
  * @property {boolean} preventDefault - When `true`, the captured click's default action is
16
18
  * suppressed.
17
19
  */
@@ -45,19 +47,21 @@ export default class ScrollToTop extends StyledElement {
45
47
  }
46
48
 
47
49
  /**
48
- * Scroll the window to the top.
50
+ * Scroll to the top: the element around this one that scrolls, or the window.
49
51
  * @returns {void}
50
52
  */
51
53
  scrollToTop() {
52
- const htmlScroll = window
53
- .getComputedStyle(document.querySelectorAll('html')[0], null)
54
- .getPropertyValue('scroll-behavior');
54
+ const container = scrollContainer(this);
55
+ const target = container ?? window;
56
+ const behavior = getComputedStyle(container ?? document.documentElement).getPropertyValue('scroll-behavior');
55
57
 
56
- if (htmlScroll === 'smooth') {
57
- window.scrollTo(0, 0);
58
+ if (behavior === 'smooth') {
59
+ target.scrollTo(0, 0);
58
60
  } else {
59
61
  const duration = this.duration;
60
- const difference = document.documentElement.scrollTop || document.body.scrollTop;
62
+ const difference = container
63
+ ? container.scrollTop
64
+ : document.documentElement.scrollTop || document.body.scrollTop;
61
65
  const startTime = performance.now();
62
66
 
63
67
  // noinspection JSAnnotator
@@ -65,7 +69,7 @@ export default class ScrollToTop extends StyledElement {
65
69
  let normalizedTime = (timeStamp - startTime) / duration;
66
70
  if (normalizedTime > 1) normalizedTime = 1;
67
71
 
68
- window.scrollTo(0, difference * Math.cos(normalizedTime * Math.PI));
72
+ target.scrollTo(0, difference * Math.cos(normalizedTime * Math.PI));
69
73
  if (normalizedTime < 1) window.requestAnimationFrame(step);
70
74
  }
71
75
  window.requestAnimationFrame(step);
@@ -2,6 +2,8 @@
2
2
 
3
3
  `scroll-to-top` is a wrapper that smoothly scrolls the page to the top. Place any `click`-emitting child element inside (e.g. `<a>` or `<button>`); when it fires a `click`, `scroll-to-top` captures it and scrolls to the top.
4
4
 
5
+ It scrolls what scrolls it: the element around it that has more content than height and an overflow that scrolls, the content of an [`el-app-frame`](../app-frame/app-frame.readme.md) for example. Where there is none, it scrolls the window.
6
+
5
7
  ## How to use
6
8
 
7
9
  #### Install
@@ -0,0 +1,27 @@
1
+ # Change Log
2
+
3
+ All notable changes to this component live here. Versions refer to the parent `@webtides/element-library` release (see root [`CHANGELOG.md`](../../../CHANGELOG.md)); components no longer version independently.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/).
6
+
7
+ <!--
8
+ When your PR touches this component, add an entry under Unreleased and
9
+ mirror it (prefixed with the component name) in root CHANGELOG.md.
10
+ Uncomment headings as needed.
11
+ -->
12
+
13
+ ## Unreleased
14
+
15
+ ## [0.4.0] - 2026-11-27
16
+
17
+ ### Added
18
+
19
+ - Initial `el-segmented-field`: one choice of a few options as a row of joined buttons, which behaves like a group of radios. It extends `el-radio-field`: a native `<fieldset>`/`<legend>` with an `<input type="radio">` per option, so the one tab stop, the arrow keys, the value in the form, its reset and `required` are native, and the label, the help message and the error message are the ones of every field. `input-change` reports the value. ([#166](https://github.com/webtides/element-library/issues/166))
20
+ - `options` as `el-radio-field` has them: plain strings, or objects with a `value`, a `label` and `disabled`. The whole field can be disabled as well.
21
+ - An option with `icon`, the address of an SVG symbol (`#grid`, `/icons.svg#grid`), shows that icon in the place of its label. The label is then its name for assistive technology and its tooltip.
22
+ - The row looks like an `el-button-group`: two neighbours share one line, only the corners at the two ends are round (at the other ends in a text that runs from right to left), and the option with the keyboard focus lies over its neighbours. The row is never wider than its place: the options share the width then, and a label breaks into lines.
23
+ - The chosen option has a tint of its text colour and a ring inside of its edge, as a pressed `el-button`. The ring is a border, so it stays where the user forces colours.
24
+ - `size` (`small`, `medium`, `large`): an option is as high as an `el-button` of that size. On a touch screen it is at least `--el-touch-target` high and wide.
25
+ - The look is the stylesheet reading the native radios. A server-rendered field does not change when the element takes over, and it submits its value before the script has run.
26
+ - `label-screen-reader-only` hides the label from the eye and keeps it as the name of the group. The field hides it with its own stylesheet, so it works on a page without an `sr-only` class.
27
+ - In a container that gives its controls a size, an `el-toolbar`, the field takes it from there, while the page has not set `size` on the field itself. ([#194](https://github.com/webtides/element-library/issues/194))
@@ -0,0 +1,3 @@
1
+ import { define } from './segmented-field.js';
2
+
3
+ define();
@@ -0,0 +1,175 @@
1
+ import { html, defineElement } from '@webtides/element-js';
2
+ import RadioField from '../radio-field/radio-field.js';
3
+ import style from './segmented-field.style.js';
4
+
5
+ /**
6
+ * One choice of a few options, shown as a row of joined buttons: "List | Grid",
7
+ * "Day | Week | Month". It looks like an `el-button-group` and behaves like a group of radios,
8
+ * because it is one: a native `<fieldset>`/`<legend>` with an `<input type="radio">` per option
9
+ * (it extends `el-radio-field`). So the one tab stop, the arrow keys, the value in the form, its
10
+ * reset and `required` are native, and the label, the help message and the error message are the
11
+ * ones of every field.
12
+ *
13
+ * In a container that gives its controls a size, an `el-toolbar`, the field takes it from there,
14
+ * while the page has not set `size` on the field itself.
15
+ *
16
+ * @element el-segmented-field
17
+ *
18
+ * @fires {CustomEvent<string>} input-change - Fired when the chosen option changes. `detail` is
19
+ * its value. Bubbles.
20
+ *
21
+ * @cssstate touched - Set once the user has left the group, or the browser has refused a submit
22
+ * because of it. Inherits `valid` and `invalid` from `FormField`.
23
+ *
24
+ * @property {string | null} value - The value of the chosen option.
25
+ * @property {Array<string | { value: string, label?: string, icon?: string, disabled?: boolean }>} options -
26
+ * The options. Plain strings (`['Day', 'Week']`) are value and label at once; an object has a
27
+ * `value`, a `label`, and can be `disabled`. With `icon`, the address of an SVG symbol
28
+ * (`'#grid'`, `'/icons.svg#grid'`), the option shows that icon in the place of its label: the
29
+ * label is then its name for assistive technology and its tooltip.
30
+ * @property {'small'|'medium'|'large'} size - The size of the options: their height, their padding
31
+ * and their font size. Default `'medium'`. Reflected to the `size` attribute.
32
+ */
33
+ export default class SegmentedField extends RadioField {
34
+ constructor(options) {
35
+ super({
36
+ styles: [style],
37
+ ...options,
38
+ // The size module selects the host by this attribute.
39
+ propertyOptions: { size: { reflect: true }, ...options?.propertyOptions },
40
+ });
41
+ }
42
+
43
+ /**
44
+ * Whether the page has given the field a size of its own, see `_hasOwnSize()`.
45
+ * @private
46
+ * @type {boolean | undefined}
47
+ */
48
+ _ownSize = undefined;
49
+
50
+ properties() {
51
+ return {
52
+ ...super.properties(),
53
+ size: 'medium',
54
+ };
55
+ }
56
+
57
+ static observedAttributes = ['size'];
58
+
59
+ /**
60
+ * Whether the field is writing a property to its attribute right now, see `reflectProperty()`.
61
+ * @private
62
+ */
63
+ _reflecting = false;
64
+
65
+ connectedCallback() {
66
+ // Before element-js writes the default onto the element: after that, every field has a
67
+ // `size` attribute, and nothing says who wrote it.
68
+ this._ownSize ??= this.hasAttribute('size') || Object.hasOwn(this, 'size');
69
+ super.connectedCallback();
70
+ }
71
+
72
+ /**
73
+ * The page has written the `size` attribute, after the field was connected: the size is the
74
+ * field's own from now on, also when it is the default. The field writes the attribute itself
75
+ * as well, which says nothing.
76
+ */
77
+ attributeChangedCallback(name, oldValue, newValue) {
78
+ if (name !== 'size' || this._ownSize !== false || this._reflecting || newValue === null) return;
79
+ this._ownSize = true;
80
+ this.requestUpdate();
81
+ }
82
+
83
+ reflectProperty(options) {
84
+ // `attributeChangedCallback()` runs before `setAttribute()` returns.
85
+ this._reflecting = true;
86
+ try {
87
+ super.reflectProperty(options);
88
+ } finally {
89
+ this._reflecting = false;
90
+ }
91
+ }
92
+
93
+ watch() {
94
+ return {
95
+ ...super.watch(),
96
+ // A size that is set later, as an attribute or from a script, is the field's own.
97
+ size: () => {
98
+ this._ownSize = true;
99
+ },
100
+ };
101
+ }
102
+
103
+ /**
104
+ * Whether the page has given the field a size of its own. A field without one takes the size
105
+ * of a container that gives one to its controls, a toolbar. The template marks the row with
106
+ * the answer, and the stylesheet reads the mark. On the server no attribute has been written
107
+ * by the element: one that is there is the one of the page.
108
+ * @private
109
+ * @returns {boolean}
110
+ */
111
+ _hasOwnSize() {
112
+ if (this._ownSize === undefined) return !!this.hasAttribute?.('size');
113
+ // A size that is not the default was set by someone: the watcher has not run yet when the
114
+ // field renders with a size it has just got from a script.
115
+ return this._ownSize || this.size !== 'medium';
116
+ }
117
+
118
+ template() {
119
+ return html`
120
+ <fieldset
121
+ class="field ${this.classes().field}"
122
+ aria-describedby="${this._describedBy()}"
123
+ aria-errormessage="${this._idOf('error-message')}"
124
+ aria-invalid="${this.valid ? 'false' : 'true'}"
125
+ >
126
+ ${this.legendTemplate()} ${this.helpTemplate()}
127
+ <div class="options ${this._hasOwnSize() ? '' : 'options--inherit-size'}">${this.fieldTemplate()}</div>
128
+ ${this.errorTemplate()}
129
+ </fieldset>
130
+ `;
131
+ }
132
+
133
+ /** @private */
134
+ fieldTemplate() {
135
+ return this.options.map((option, index) => {
136
+ const value = option.value ?? option;
137
+ const label = option.label ?? value;
138
+ const optionDisabled = this.disabled || !!option.disabled;
139
+ const checked = this.value != null && String(this.value) === String(value);
140
+ const id = `segment-${this.uuid}-${index}`;
141
+
142
+ // The radio is hidden from the eye, and the segment after it is what is drawn in its
143
+ // place: it shows whether the radio is checked, has the focus or is disabled, by the
144
+ // stylesheet alone.
145
+ return html`
146
+ <label class="option" for="${id}" title="${option.icon ? label : null}">
147
+ <input
148
+ type="radio"
149
+ id="${id}"
150
+ name="${this.name}"
151
+ value="${value}"
152
+ ?checked="${checked}"
153
+ ?disabled="${optionDisabled}"
154
+ ?required="${this.required}"
155
+ aria-describedby="${this._describedBy()}"
156
+ />
157
+ <span class="segment">
158
+ ${
159
+ option.icon
160
+ ? html`<svg class="segment-icon" aria-hidden="true" focusable="false">
161
+ <use href="${option.icon}"></use>
162
+ </svg>
163
+ <span class="segment-name">${label}</span>`
164
+ : html`<span class="option-label">${label}</span>`
165
+ }
166
+ </span>
167
+ </label>
168
+ `;
169
+ });
170
+ }
171
+ }
172
+
173
+ export function define() {
174
+ defineElement('el-segmented-field', SegmentedField);
175
+ }
@@ -0,0 +1,140 @@
1
+ # SegmentedField
2
+
3
+ `segmented-field` is one choice of a few options, shown as a row of joined buttons: "List | Grid", "Day | Week | Month", the alignment of a text. It looks like an [`el-button-group`](../button-group/button-group.readme.md) and behaves like a group of radios, because it is one: it extends [`el-radio-field`](../radio-field/radio-field.readme.md) and renders a native `<fieldset>`/`<legend>` with an `<input type="radio">` per option. The one tab stop, the arrow keys, the value in the form, its reset and `required` are native.
4
+
5
+ It is headless by default: without a theme the options have a border and a text in the text colour of the page.
6
+
7
+ ## How to use
8
+
9
+ #### Install
10
+
11
+ ```sh
12
+ npm i --save @webtides/element-library
13
+ ```
14
+
15
+ #### Use
16
+
17
+ ```js
18
+ import '@webtides/element-library/segmented-field/define';
19
+ ```
20
+
21
+ ```html
22
+ <el-segmented-field
23
+ name="view"
24
+ label="Calendar"
25
+ value="week"
26
+ options='[{"value":"day","label":"Day"},{"value":"week","label":"Week"},{"value":"month","label":"Month"}]'
27
+ ></el-segmented-field>
28
+
29
+ <el-segmented-field name="plan" label="Plan" required="true" options='["Free","Team","Company"]'></el-segmented-field>
30
+ ```
31
+
32
+ The radios are one group by their `name`, as native radios are: give the field a name, and a name of its own on a page with several of them outside of a form.
33
+
34
+ #### The value
35
+
36
+ `value` is the value of the chosen option, which is what the form submits, and `null` while nothing is chosen. A choice cannot be taken back to none by the user: a radio group has no way to choose nothing. A script can, with `value = null`, and so can `form.reset()` for a field that was rendered without a choice.
37
+
38
+ ## API
39
+
40
+ #### Properties/Attributes
41
+
42
+ Inherits all of `form-field`'s properties (`name`, `value`, `required`, `disabled`, `label`, `labelScreenReaderOnly`, `errorMessage`, `helpMessage`, `valid`, `touched`) and adds:
43
+
44
+ | Name | Type | Default | Description |
45
+ | --- | --- | --- | --- |
46
+ | `value` | `string` | `null` | The value of the chosen option. |
47
+ | `options` | `Array<string \| { value, label?, icon?, disabled? }>` | `[]` | The options, as `el-radio-field` has them: plain strings, or objects with a `value`, a `label` and `disabled`. `icon` shows an icon in the place of the label, see [Icons](#icons). |
48
+ | `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | The size of the options: their height, their padding and their font size. Reflected to the `size` attribute. |
49
+
50
+ #### Events
51
+
52
+ | Name | Detail | Description |
53
+ | -------------- | -------------------- | ------------------------------------- |
54
+ | `input-change` | `string` (the value) | Fired when the chosen option changes. |
55
+
56
+ #### CSS States
57
+
58
+ | Name | Description |
59
+ | --------- | ----------------------------------------------------------------------------------------- |
60
+ | `touched` | Set once the user has left the group. Moving from one option to the next does not set it. |
61
+ | `valid` | Set while the field passes validation. |
62
+ | `invalid` | Set while the field fails validation (`required` with nothing chosen). |
63
+
64
+ #### CSS Custom Properties
65
+
66
+ Reads the design tokens of the library: `--el-color-border` for the border of an option, `--el-color-fg` for its text, `--el-radius-md` for the corners at the two ends of the row, `--el-control-height`, `--el-space-*` and `--el-font-size-*` for the size, `--el-color-accent` and `--el-focus-ring-width` for the focus ring.
67
+
68
+ ## The row
69
+
70
+ The options are joined: two neighbours share one line, and only the corners at the two ends of the row are round. In a text that runs from right to left the row starts at the right, with its round corners there.
71
+
72
+ The row is as wide as its options. It is never wider than its place: the options share the width then, and a label that does not fit breaks into lines, with all options as high as the highest. A segmented field is for a few short options; for more of them, or longer ones, an `el-radio-field` or an `el-select-field` is the better field.
73
+
74
+ An option is as high as an `el-button` of the same `size`.
75
+
76
+ ## The chosen option
77
+
78
+ The chosen option has a tint of its text colour and a ring inside of its edge, as a pressed `el-button` has. The ring is a shape and a border: it tells the option apart without a colour, and where the user forces colours it stays, a little wider.
79
+
80
+ All of it is the stylesheet reading the native radio (`:checked`): nothing is set from a script.
81
+
82
+ ## Icons
83
+
84
+ An option with `icon` shows that icon in the place of its label. `icon` is the address of an SVG symbol: one of the page (`#grid`) or of a file (`/icons.svg#grid`). The label is then not shown. It is the name of the option for assistive technology, and its tooltip for the pointer.
85
+
86
+ ```html
87
+ <svg width="0" height="0" style="position:absolute" aria-hidden="true">
88
+ <symbol id="icon-list" viewBox="0 0 24 24">…</symbol>
89
+ <symbol id="icon-grid" viewBox="0 0 24 24">…</symbol>
90
+ </svg>
91
+
92
+ <el-segmented-field
93
+ name="layout"
94
+ label="Layout"
95
+ value="list"
96
+ options='[{"value":"list","label":"List","icon":"#icon-list"},{"value":"grid","label":"Grid","icon":"#icon-grid"}]'
97
+ ></el-segmented-field>
98
+ ```
99
+
100
+ The icon has the colour of the text (`currentColor`) and is 1.25em wide and high. Every option needs a `label`, with an icon as well.
101
+
102
+ ## In a toolbar
103
+
104
+ In an [`el-toolbar`](../toolbar/toolbar.readme.md) the field takes the size of the toolbar, while the page has not set `size` on the field itself. Give it `label-screen-reader-only="true"`: the label stays the name of the group and is not shown.
105
+
106
+ ```html
107
+ <el-toolbar label="Tasks" size="small">
108
+ <el-segmented-field
109
+ name="view"
110
+ label="View"
111
+ label-screen-reader-only="true"
112
+ value="List"
113
+ options='["List","Board"]'
114
+ ></el-segmented-field>
115
+ </el-toolbar>
116
+ ```
117
+
118
+ The arrow keys of a toolbar move the focus from control to control, and the options of the field are controls of the toolbar. So there the left and right arrow keys go through the options without choosing: Space chooses the option with the focus, and the up and down arrow keys move the choice.
119
+
120
+ ## Disabled
121
+
122
+ `disabled="true"` disables the whole field: nothing can be chosen, and the form leaves it out. An option with `disabled: true` cannot be chosen, and the arrow keys skip it. A disabled option is faded.
123
+
124
+ ## Accessibility
125
+
126
+ - The field is a group (`<fieldset>`) named by its `label` (`<legend>`), and its options are native radios: a screen reader announces "radio button, 2 of 3" with the name of the option.
127
+ - It is one stop of the Tab key: the chosen option, or the first one while nothing is chosen. The arrow keys move the choice, around the ends, and Space chooses the option with the focus.
128
+ - The keyboard focus shows as a ring around the option, which lies over its neighbours while it has the focus.
129
+ - On a touch screen (`@media (any-pointer: coarse)`) an option is at least `--el-touch-target` high and wide.
130
+ - `label-screen-reader-only="true"` hides the label from the eye and keeps it as the name of the group, for a field in a toolbar. The field hides it with its own stylesheet; it needs no `sr-only` class of the page.
131
+
132
+ ## Server-side rendering
133
+
134
+ The field renders into the page, with native radios. Server-rendered, it looks the same before and after the element takes over: the row, the sizes and the chosen option are its stylesheet. Before the script has run, a click and the arrow keys choose, the form submits the value, and `required` holds. The script adds the events, the messages of the field and the reset to what was rendered.
135
+
136
+ ## What it is not
137
+
138
+ - **Not several options at once.** That is an [`el-checkbox-group-field`](../checkbox-group-field/checkbox-group-field.readme.md).
139
+ - **Not a row of buttons that each do something**, as in a toolbar. That is an [`el-button-group`](../button-group/button-group.readme.md).
140
+ - **Not a single button that stays pressed.** That is an `el-button` with [`toggle`](../button/button.readme.md#a-toggle-button).