@ui-sdk/vue 0.0.0-stage → 0.1.0-beta.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 (262) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +10 -2
  3. package/dist/accordion.d.ts +561 -0
  4. package/dist/accordion.js +24 -0
  5. package/dist/agent.d.ts +2 -0
  6. package/dist/agent.js +7 -0
  7. package/dist/alert-dialog.d.ts +231 -0
  8. package/dist/alert-dialog.js +33 -0
  9. package/dist/async-options.d.ts +18 -0
  10. package/dist/async-options.js +40 -0
  11. package/dist/autocomplete.d.ts +384 -0
  12. package/dist/autocomplete.js +344 -0
  13. package/dist/avatar.d.ts +40 -0
  14. package/dist/avatar.js +28 -0
  15. package/dist/button.d.ts +52 -0
  16. package/dist/button.js +43 -0
  17. package/dist/calendar-context.d.ts +10 -0
  18. package/dist/calendar-context.js +7 -0
  19. package/dist/calendar.d.ts +311 -0
  20. package/dist/calendar.js +349 -0
  21. package/dist/carousel.d.ts +236 -0
  22. package/dist/carousel.js +204 -0
  23. package/dist/checkbox.d.ts +211 -0
  24. package/dist/checkbox.js +151 -0
  25. package/dist/children.d.ts +41 -0
  26. package/dist/children.js +135 -0
  27. package/dist/collapsible.d.ts +54 -0
  28. package/dist/collapsible.js +18 -0
  29. package/dist/color-picker.d.ts +187 -0
  30. package/dist/color-picker.js +158 -0
  31. package/dist/color.d.ts +2 -0
  32. package/dist/color.js +21 -0
  33. package/dist/combobox.d.ts +517 -0
  34. package/dist/combobox.js +531 -0
  35. package/dist/command.d.ts +322 -0
  36. package/dist/command.js +345 -0
  37. package/dist/controller-target.d.ts +49 -0
  38. package/dist/controller-target.js +112 -0
  39. package/dist/create-parts.d.ts +126 -0
  40. package/dist/create-parts.js +206 -0
  41. package/dist/date-input.d.ts +133 -0
  42. package/dist/date-input.js +31 -0
  43. package/dist/date-picker.d.ts +328 -0
  44. package/dist/date-picker.js +354 -0
  45. package/dist/date.d.ts +2 -0
  46. package/dist/date.js +59 -0
  47. package/dist/dialog-parts.d.ts +259 -0
  48. package/dist/dialog-parts.js +300 -0
  49. package/dist/dialog.d.ts +251 -0
  50. package/dist/dialog.js +25 -0
  51. package/dist/drawer.d.ts +304 -0
  52. package/dist/drawer.js +373 -0
  53. package/dist/editor-context.d.ts +4 -0
  54. package/dist/editor-context.js +5 -0
  55. package/dist/field-context.d.ts +26 -0
  56. package/dist/field-context.js +44 -0
  57. package/dist/field.d.ts +154 -0
  58. package/dist/field.js +240 -0
  59. package/dist/file-input.d.ts +212 -0
  60. package/dist/file-input.js +255 -0
  61. package/dist/form-inputs.d.ts +16 -0
  62. package/dist/form-inputs.js +25 -0
  63. package/dist/gesture.d.ts +1 -0
  64. package/dist/gesture.js +15 -0
  65. package/dist/history.d.ts +2 -0
  66. package/dist/history.js +11 -0
  67. package/dist/hover-card.d.ts +137 -0
  68. package/dist/hover-card.js +153 -0
  69. package/dist/image-cropper.d.ts +74 -0
  70. package/dist/image-cropper.js +36 -0
  71. package/dist/image.d.ts +2 -0
  72. package/dist/image.js +5 -0
  73. package/dist/index.d.ts +59 -0
  74. package/dist/index.js +60 -0
  75. package/dist/input.d.ts +120 -0
  76. package/dist/input.js +73 -0
  77. package/dist/item-icon.d.ts +34 -0
  78. package/dist/item-icon.js +63 -0
  79. package/dist/label.d.ts +16 -0
  80. package/dist/label.js +8 -0
  81. package/dist/lifecycle.d.ts +11 -0
  82. package/dist/lifecycle.js +91 -0
  83. package/dist/list-items.d.ts +38 -0
  84. package/dist/list-items.js +59 -0
  85. package/dist/list-text.d.ts +7 -0
  86. package/dist/list-text.js +15 -0
  87. package/dist/listbox.d.ts +273 -0
  88. package/dist/listbox.js +126 -0
  89. package/dist/menu.d.ts +678 -0
  90. package/dist/menu.js +607 -0
  91. package/dist/menubar-context.d.ts +5 -0
  92. package/dist/menubar-context.js +5 -0
  93. package/dist/menubar.d.ts +61 -0
  94. package/dist/menubar.js +48 -0
  95. package/dist/meter.d.ts +41 -0
  96. package/dist/meter.js +37 -0
  97. package/dist/navigation-menu.d.ts +228 -0
  98. package/dist/navigation-menu.js +195 -0
  99. package/dist/number-input.d.ts +176 -0
  100. package/dist/number-input.js +231 -0
  101. package/dist/number.d.ts +2 -0
  102. package/dist/number.js +39 -0
  103. package/dist/nuxt/entries.json +977 -0
  104. package/dist/nuxt/module.d.ts +18 -0
  105. package/dist/nuxt/module.js +31 -0
  106. package/dist/nuxt/registrations.d.ts +22 -0
  107. package/dist/nuxt/registrations.js +22 -0
  108. package/dist/observe.d.ts +2 -0
  109. package/dist/observe.js +7 -0
  110. package/dist/otp-input.d.ts +142 -0
  111. package/dist/otp-input.js +130 -0
  112. package/dist/overlays.d.ts +40 -0
  113. package/dist/overlays.js +118 -0
  114. package/dist/pagination.d.ts +201 -0
  115. package/dist/pagination.js +146 -0
  116. package/dist/password-input.d.ts +144 -0
  117. package/dist/password-input.js +134 -0
  118. package/dist/popover.d.ts +211 -0
  119. package/dist/popover.js +258 -0
  120. package/dist/popup.d.ts +60 -0
  121. package/dist/popup.js +89 -0
  122. package/dist/preferences.d.ts +44 -0
  123. package/dist/preferences.js +102 -0
  124. package/dist/primitive.d.ts +2 -0
  125. package/dist/primitive.js +11 -0
  126. package/dist/progress.d.ts +41 -0
  127. package/dist/progress.js +37 -0
  128. package/dist/radio.d.ts +164 -0
  129. package/dist/radio.js +145 -0
  130. package/dist/rating.d.ts +149 -0
  131. package/dist/rating.js +146 -0
  132. package/dist/renderless.d.ts +4 -0
  133. package/dist/renderless.js +28 -0
  134. package/dist/resizable.d.ts +54 -0
  135. package/dist/resizable.js +22 -0
  136. package/dist/scroll-area.d.ts +72 -0
  137. package/dist/scroll-area.js +77 -0
  138. package/dist/segmented-control.d.ts +151 -0
  139. package/dist/segmented-control.js +110 -0
  140. package/dist/segmented-input.d.ts +76 -0
  141. package/dist/segmented-input.js +115 -0
  142. package/dist/select.d.ts +458 -0
  143. package/dist/select.js +468 -0
  144. package/dist/separator.d.ts +14 -0
  145. package/dist/separator.js +8 -0
  146. package/dist/shortcuts.d.ts +32 -0
  147. package/dist/shortcuts.js +56 -0
  148. package/dist/slider.d.ts +65 -0
  149. package/dist/slider.js +194 -0
  150. package/dist/switch.d.ts +103 -0
  151. package/dist/switch.js +71 -0
  152. package/dist/tabs.d.ts +338 -0
  153. package/dist/tabs.js +27 -0
  154. package/dist/text-control.d.ts +89 -0
  155. package/dist/text-control.js +51 -0
  156. package/dist/text-match.d.ts +2 -0
  157. package/dist/text-match.js +7 -0
  158. package/dist/textarea.d.ts +106 -0
  159. package/dist/textarea.js +68 -0
  160. package/dist/time-input.d.ts +131 -0
  161. package/dist/time-input.js +32 -0
  162. package/dist/timeline.d.ts +81 -0
  163. package/dist/timeline.js +30 -0
  164. package/dist/toast-parts.d.ts +203 -0
  165. package/dist/toast-parts.js +270 -0
  166. package/dist/toast.d.ts +2 -0
  167. package/dist/toast.js +21 -0
  168. package/dist/toggle-props.d.ts +22 -0
  169. package/dist/toggle-props.js +14 -0
  170. package/dist/toggle.d.ts +199 -0
  171. package/dist/toggle.js +129 -0
  172. package/dist/token-input.d.ts +136 -0
  173. package/dist/token-input.js +214 -0
  174. package/dist/toolbar-context.d.ts +7 -0
  175. package/dist/toolbar-context.js +20 -0
  176. package/dist/toolbar.d.ts +120 -0
  177. package/dist/toolbar.js +77 -0
  178. package/dist/tooltip.d.ts +160 -0
  179. package/dist/tooltip.js +224 -0
  180. package/dist/tree.d.ts +300 -0
  181. package/dist/tree.js +209 -0
  182. package/dist/trigger-menu.d.ts +452 -0
  183. package/dist/trigger-menu.js +254 -0
  184. package/dist/use-primitive.d.ts +132 -0
  185. package/dist/use-primitive.js +462 -0
  186. package/dist/waterfall.d.ts +201 -0
  187. package/dist/waterfall.js +171 -0
  188. package/docs/README.md +89 -0
  189. package/docs/agents.md +1523 -0
  190. package/docs/components/accordion.md +1369 -0
  191. package/docs/components/alert-dialog.md +799 -0
  192. package/docs/components/autocomplete.md +1857 -0
  193. package/docs/components/avatar.md +272 -0
  194. package/docs/components/button.md +435 -0
  195. package/docs/components/calendar.md +1589 -0
  196. package/docs/components/carousel.md +1171 -0
  197. package/docs/components/checkbox.md +1008 -0
  198. package/docs/components/collapsible.md +536 -0
  199. package/docs/components/color-picker.md +706 -0
  200. package/docs/components/combobox.md +3504 -0
  201. package/docs/components/command.md +1481 -0
  202. package/docs/components/date-input.md +536 -0
  203. package/docs/components/date-picker.md +1244 -0
  204. package/docs/components/dialog.md +1397 -0
  205. package/docs/components/drawer.md +1166 -0
  206. package/docs/components/field.md +538 -0
  207. package/docs/components/file-input.md +611 -0
  208. package/docs/components/hover-card.md +505 -0
  209. package/docs/components/image-cropper.md +556 -0
  210. package/docs/components/input.md +306 -0
  211. package/docs/components/label.md +203 -0
  212. package/docs/components/listbox.md +1004 -0
  213. package/docs/components/menu.md +1229 -0
  214. package/docs/components/menubar.md +443 -0
  215. package/docs/components/meter.md +315 -0
  216. package/docs/components/navigation-menu.md +1523 -0
  217. package/docs/components/number-input.md +1029 -0
  218. package/docs/components/otp-input.md +512 -0
  219. package/docs/components/pagination.md +613 -0
  220. package/docs/components/password-input.md +649 -0
  221. package/docs/components/popover.md +1448 -0
  222. package/docs/components/preferences.md +208 -0
  223. package/docs/components/progress.md +423 -0
  224. package/docs/components/radio.md +785 -0
  225. package/docs/components/rating.md +416 -0
  226. package/docs/components/resizable.md +910 -0
  227. package/docs/components/scroll-area.md +915 -0
  228. package/docs/components/segmented-control.md +435 -0
  229. package/docs/components/select.md +2015 -0
  230. package/docs/components/separator.md +229 -0
  231. package/docs/components/slider.md +1084 -0
  232. package/docs/components/switch.md +565 -0
  233. package/docs/components/tabs.md +944 -0
  234. package/docs/components/textarea.md +299 -0
  235. package/docs/components/time-input.md +224 -0
  236. package/docs/components/timeline.md +654 -0
  237. package/docs/components/toast.md +1224 -0
  238. package/docs/components/toggle.md +500 -0
  239. package/docs/components/token-input.md +953 -0
  240. package/docs/components/toolbar.md +739 -0
  241. package/docs/components/tooltip.md +818 -0
  242. package/docs/components/tree.md +1306 -0
  243. package/docs/components/trigger-menu.md +1223 -0
  244. package/docs/components/waterfall.md +717 -0
  245. package/docs/controllers.md +71 -0
  246. package/docs/core.md +8027 -0
  247. package/docs/custom-parts.md +89 -0
  248. package/docs/first-component.md +83 -0
  249. package/docs/forms.md +122 -0
  250. package/docs/installation.md +72 -0
  251. package/docs/introduction.md +32 -0
  252. package/docs/lists-and-menus.md +122 -0
  253. package/docs/llms.txt +1502 -0
  254. package/docs/parts-and-composition.md +85 -0
  255. package/docs/popups.md +108 -0
  256. package/docs/rendering.md +56 -0
  257. package/docs/server-rendering.md +180 -0
  258. package/docs/state-and-events.md +100 -0
  259. package/docs/styling-and-animation.md +148 -0
  260. package/docs/utilities/async-options.md +348 -0
  261. package/docs/utilities/shortcuts.md +159 -0
  262. package/package.json +352 -3
@@ -0,0 +1,944 @@
1
+ # Tabs
2
+
3
+ Switch between related panels with one tab selected at a time.
4
+
5
+ Use Tabs when several views share the same space, such as settings sections or a preview and its source. Each tab opens the panel with the same value.
6
+
7
+ <ComponentExample
8
+ name="tabs/basic"
9
+ inspect
10
+ caption="Choose Password to show its panel. Use the left and right arrow keys to move between the tabs."
11
+ />
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install @ui-sdk/vue @ui-sdk/core
17
+ ```
18
+
19
+ ## Composition
20
+
21
+ Use the following composition to build a `Tabs`:
22
+
23
+ ```text
24
+ Tabs
25
+ ├── TabsList
26
+ │ ├── TabsTab
27
+ │ └── TabsTab
28
+ ├── TabsPanel
29
+ └── TabsPanel
30
+ ```
31
+
32
+ Give each tab and its panel the same unique `value`. Give the list an accessible name. Set `default-value` to choose the initial tab; otherwise, the first enabled tab is selected.
33
+
34
+ ## Usage
35
+
36
+ Import the parts and put them together:
37
+
38
+ ```vue
39
+ <script setup lang="ts">
40
+ import { Tabs, TabsList, TabsPanel, TabsTab } from "@ui-sdk/vue/tabs"
41
+ </script>
42
+
43
+ <template>
44
+ <Tabs default-value="account">
45
+ <TabsList aria-label="Settings">
46
+ <TabsTab value="account">Account</TabsTab>
47
+ <TabsTab value="password">Password</TabsTab>
48
+ </TabsList>
49
+ <TabsPanel value="account">Manage your profile.</TabsPanel>
50
+ <TabsPanel value="password">Choose a new password.</TabsPanel>
51
+ </Tabs>
52
+ </template>
53
+ ```
54
+
55
+ ## Build Your Own
56
+
57
+ `@ui-sdk/vue/tabs` comes with ready-made Tabs. If you'd like to build your own, with your own names, start from the `tabs` primitive in `@ui-sdk/core`:
58
+
59
+ ```ts title="segments.ts"
60
+ import { tabs } from "@ui-sdk/core/tabs"
61
+ import { createParts } from "@ui-sdk/vue/primitive"
62
+
63
+ const {
64
+ Root: Segments,
65
+ List: SegmentList,
66
+ Tab: Segment,
67
+ Panel: SegmentPanel,
68
+ } = createParts(tabs, { root: "div", list: "div", tab: "button", panel: "div" })
69
+
70
+ export { Segment, SegmentList, SegmentPanel, Segments }
71
+ ```
72
+
73
+ ```vue
74
+ <template>
75
+ <Segments default-value="day">
76
+ <SegmentList aria-label="Range">
77
+ <Segment value="day">Day</Segment>
78
+ <Segment value="week">Week</Segment>
79
+ </SegmentList>
80
+ <SegmentPanel value="day">128 visitors today.</SegmentPanel>
81
+ <SegmentPanel value="week">1,024 visitors this week.</SegmentPanel>
82
+ </Segments>
83
+ </template>
84
+ ```
85
+
86
+ Add `"tab-icon": "span"` and `indicator: "span"` to the elements to get the `TabIcon` and `Indicator` parts too. Each part keeps the behavior, state and data attributes of its ready-made counterpart. See [Rendering](../rendering.md) and [Custom Parts](../custom-parts.md) for more.
87
+
88
+ ## Vertical
89
+
90
+ Set `orientation="vertical"` to use Up and Down Arrow instead. Style the list as a column beside the panels to match.
91
+
92
+ ```vue title="vertical.vue"
93
+ <script setup lang="ts">
94
+ import { Tabs, TabsList, TabsPanel, TabsTab } from "@ui-sdk/vue/tabs"
95
+ </script>
96
+
97
+ <template>
98
+ <Tabs default-value="general" orientation="vertical">
99
+ <TabsList aria-label="Preferences">
100
+ <TabsTab value="general">General</TabsTab>
101
+ <TabsTab value="security">Security</TabsTab>
102
+ <TabsTab value="integrations">Integrations</TabsTab>
103
+ </TabsList>
104
+ <TabsPanel value="general"
105
+ >Choose your language, time zone and the page you start on.</TabsPanel
106
+ >
107
+ <TabsPanel value="security"
108
+ >Manage passkeys, signed-in sessions and recovery codes.</TabsPanel
109
+ >
110
+ <TabsPanel value="integrations"
111
+ >Connect your calendar and chat apps to get reminders.</TabsPanel
112
+ >
113
+ </Tabs>
114
+ </template>
115
+ ```
116
+
117
+ Focus General, then press Down Arrow to choose Security. Up Arrow moves back through the vertical list.
118
+
119
+ ## Disabled
120
+
121
+ Add `disabled` to a tab to prevent selection. Arrow keys can still focus it so people can discover it.
122
+
123
+ ```vue title="disabled.vue"
124
+ <script setup lang="ts">
125
+ import { Tabs, TabsList, TabsPanel, TabsTab } from "@ui-sdk/vue/tabs"
126
+ </script>
127
+
128
+ <template>
129
+ <Tabs default-value="overview">
130
+ <TabsList aria-label="Dashboard">
131
+ <TabsTab value="overview">Overview</TabsTab>
132
+ <TabsTab value="analytics">Analytics</TabsTab>
133
+ <TabsTab value="reports" disabled>Reports</TabsTab>
134
+ </TabsList>
135
+ <TabsPanel value="overview"
136
+ >Revenue, visitors and sign-ups for the last 30 days.</TabsPanel
137
+ >
138
+ <TabsPanel value="analytics"
139
+ >Where your visitors come from and the pages they read most.</TabsPanel
140
+ >
141
+ <TabsPanel value="reports"
142
+ >Monthly reports are available on the Pro plan.</TabsPanel
143
+ >
144
+ </Tabs>
145
+ </template>
146
+ ```
147
+
148
+ Use the arrow keys to reach Reports. It can receive focus, but pressing it leaves the current panel selected.
149
+
150
+ ## Icons
151
+
152
+ Put decorative icons in `TabsTabIcon` so they stay out of the tab’s accessible name. Add `mirror` to directional icons, such as Reply, to flip them in right-to-left text. An icon-only tab still needs an `aria-label`.
153
+
154
+ ```vue title="icons.vue"
155
+ <script setup lang="ts">
156
+ import { ArchiveIcon, MailIcon, ReplyIcon } from "@lucide/vue"
157
+ import {
158
+ Tabs,
159
+ TabsList,
160
+ TabsPanel,
161
+ TabsTab,
162
+ TabsTabIcon,
163
+ } from "@ui-sdk/vue/tabs"
164
+ </script>
165
+
166
+ <template>
167
+ <Tabs default-value="inbox">
168
+ <TabsList aria-label="Mail">
169
+ <TabsTab value="inbox">
170
+ <TabsTabIcon>
171
+ <MailIcon />
172
+ </TabsTabIcon>
173
+ Inbox
174
+ </TabsTab>
175
+ <TabsTab value="replies">
176
+ <TabsTabIcon mirror>
177
+ <ReplyIcon />
178
+ </TabsTabIcon>
179
+ Replies
180
+ </TabsTab>
181
+ <TabsTab value="archive">
182
+ <TabsTabIcon>
183
+ <ArchiveIcon />
184
+ </TabsTabIcon>
185
+ Archive
186
+ </TabsTab>
187
+ </TabsList>
188
+ <TabsPanel value="inbox"
189
+ >3 new messages from Inès Moreau and Kofi Mensah.</TabsPanel
190
+ >
191
+ <TabsPanel value="replies"
192
+ >Wren Takahashi replied to your message about the launch.</TabsPanel
193
+ >
194
+ <TabsPanel value="archive"
195
+ >Messages you archived stay here and in search.</TabsPanel
196
+ >
197
+ </Tabs>
198
+ </template>
199
+ ```
200
+
201
+ Choose Replies. Its directional icon mirrors when the surrounding page uses right-to-left text.
202
+
203
+ ## Manual Activation
204
+
205
+ Set `activation="manual"` when opening a panel takes time, such as a view that fetches data. Arrow keys move focus; Enter or Space selects the focused tab.
206
+
207
+ ```vue
208
+ <Tabs activation="manual" />
209
+ ```
210
+
211
+ A panel becomes a tab stop only when it has no focusable content. A panel with a field lets Tab go straight to the field.
212
+
213
+ ```vue title="manual.vue"
214
+ <script setup lang="ts">
215
+ import { Field, FieldLabel } from "@ui-sdk/vue/field"
216
+ import { Input } from "@ui-sdk/vue/input"
217
+ import { Tabs, TabsList, TabsPanel, TabsTab } from "@ui-sdk/vue/tabs"
218
+ </script>
219
+
220
+ <template>
221
+ <Tabs default-value="preview" activation="manual">
222
+ <TabsList aria-label="Snippet">
223
+ <TabsTab value="preview">Preview</TabsTab>
224
+ <TabsTab value="code">Code</TabsTab>
225
+ </TabsList>
226
+ <TabsPanel value="preview"
227
+ >Welcome back, Hollis. You have 3 unread messages.</TabsPanel
228
+ >
229
+ <TabsPanel value="code">
230
+ <Field>
231
+ <FieldLabel>Source</FieldLabel>
232
+ <Input default-value='<Welcome name="Hollis" unread={3} />' />
233
+ </Field>
234
+ </TabsPanel>
235
+ </Tabs>
236
+ </template>
237
+ ```
238
+
239
+ Focus Preview, then press Right Arrow. Code receives focus; press Enter or Space to show its panel. Tab then moves into the Source field.
240
+
241
+ ## Loop
242
+
243
+ Arrow keys normally wrap around at either end. Set `:loop="false"` to stop there instead.
244
+
245
+ ```vue title="loop.vue"
246
+ <script setup lang="ts">
247
+ import { Tabs, TabsList, TabsPanel, TabsTab } from "@ui-sdk/vue/tabs"
248
+
249
+ const ranges = [
250
+ {
251
+ value: "day",
252
+ label: "Day",
253
+ content: "128 visitors today, up 12% from yesterday.",
254
+ },
255
+ {
256
+ value: "week",
257
+ label: "Week",
258
+ content: "1,024 visitors this week, up 8% from last week.",
259
+ },
260
+ {
261
+ value: "month",
262
+ label: "Month",
263
+ content: "4,210 visitors this month, down 3% from last month.",
264
+ },
265
+ {
266
+ value: "year",
267
+ label: "Year",
268
+ content: "48,930 visitors this year, up 21% from last year.",
269
+ },
270
+ ]
271
+ </script>
272
+
273
+ <template>
274
+ <Tabs default-value="day" :loop="false">
275
+ <TabsList aria-label="Range">
276
+ <TabsTab v-for="range in ranges" :key="range.value" :value="range.value">
277
+ {{ range.label }}
278
+ </TabsTab>
279
+ </TabsList>
280
+ <TabsPanel v-for="range in ranges" :key="range.value" :value="range.value">
281
+ {{ range.content }}
282
+ </TabsPanel>
283
+ </Tabs>
284
+ </template>
285
+ ```
286
+
287
+ Focus Year and press Right Arrow. Focus stays at the end because looping is off.
288
+
289
+ ## Indicator
290
+
291
+ `TabsIndicator` measures the selected tab. Position it inside a relative tab list and use its [CSS variables](#styling-tabsindicator) to make a marker that follows the selection. It measures again when a tab or the list changes size.
292
+
293
+ ```css
294
+ [data-slot="tabs-list"] {
295
+ position: relative;
296
+ }
297
+
298
+ [data-slot="tabs-indicator"] {
299
+ position: absolute;
300
+ top: var(--active-tab-top);
301
+ left: var(--active-tab-left);
302
+ width: var(--active-tab-width);
303
+ height: var(--active-tab-height);
304
+ transition-property: top, left, width, height;
305
+ transition-duration: 200ms;
306
+
307
+ &[data-activation-direction="none"] {
308
+ transition: none;
309
+ }
310
+ }
311
+ ```
312
+
313
+ Add transitions for the properties you animate. Skip them while `data-activation-direction="none"` to avoid animating the first placement.
314
+
315
+ ```vue title="indicator.vue"
316
+ <script setup lang="ts">
317
+ import {
318
+ Tabs,
319
+ TabsIndicator,
320
+ TabsList,
321
+ TabsPanel,
322
+ TabsTab,
323
+ } from "@ui-sdk/vue/tabs"
324
+ import { ref } from "vue"
325
+
326
+ const orientations = [
327
+ { value: "horizontal", label: "Horizontal" },
328
+ { value: "vertical", label: "Vertical" },
329
+ ] as const
330
+
331
+ const orientation = ref<"horizontal" | "vertical">("horizontal")
332
+ </script>
333
+
334
+ <template>
335
+ <div>
336
+ <div data-slot="controls" role="group" aria-label="Orientation">
337
+ <button
338
+ v-for="option in orientations"
339
+ :key="option.value"
340
+ type="button"
341
+ data-size="sm"
342
+ :aria-pressed="orientation === option.value"
343
+ @click="orientation = option.value"
344
+ >
345
+ {{ option.label }}
346
+ </button>
347
+ </div>
348
+ <Tabs default-value="music" :orientation="orientation">
349
+ <TabsList aria-label="Library">
350
+ <TabsTab value="music">Music</TabsTab>
351
+ <TabsTab value="podcasts">Podcasts</TabsTab>
352
+ <TabsTab value="audiobooks">Audiobooks</TabsTab>
353
+ <TabsIndicator />
354
+ </TabsList>
355
+ <TabsPanel value="music"
356
+ >312 songs in 24 albums, synced to this device.</TabsPanel
357
+ >
358
+ <TabsPanel value="podcasts"
359
+ >8 shows you follow, with 3 new episodes.</TabsPanel
360
+ >
361
+ <TabsPanel value="audiobooks"
362
+ >2 books in progress, 6 hours left in total.</TabsPanel
363
+ >
364
+ </Tabs>
365
+ </div>
366
+ </template>
367
+ ```
368
+
369
+ Choose Podcasts, then choose Vertical. The same indicator measures and follows the selected tab in either layout.
370
+
371
+ ## Keep Mounted
372
+
373
+ Panels normally unmount when another tab is selected. Add `keep-mounted` to a panel to keep its content hidden in the page, preserving local state such as a draft.
374
+
375
+ ```vue title="keep-mounted.vue"
376
+ <script setup lang="ts">
377
+ import { Field, FieldLabel } from "@ui-sdk/vue/field"
378
+ import { Textarea } from "@ui-sdk/vue/textarea"
379
+ import {
380
+ Tabs,
381
+ TabsIndicator,
382
+ TabsList,
383
+ TabsPanel,
384
+ TabsTab,
385
+ } from "@ui-sdk/vue/tabs"
386
+ </script>
387
+
388
+ <template>
389
+ <Tabs default-value="reply">
390
+ <TabsList aria-label="Comment">
391
+ <TabsTab value="reply">Reply</TabsTab>
392
+ <TabsTab value="formatting">Formatting</TabsTab>
393
+ <TabsIndicator />
394
+ </TabsList>
395
+ <TabsPanel value="reply" keep-mounted>
396
+ <Field>
397
+ <FieldLabel>Message</FieldLabel>
398
+ <Textarea rows="3" placeholder="Write a reply…" />
399
+ </Field>
400
+ </TabsPanel>
401
+ <TabsPanel value="formatting">
402
+ <p>Use **bold**, _italics_ and `code` to format your reply.</p>
403
+ <p>Paste a link on its own line to show a preview.</p>
404
+ </TabsPanel>
405
+ </Tabs>
406
+ </template>
407
+ ```
408
+
409
+ Write a message, switch to Formatting, then return to Reply. Your draft is still there.
410
+
411
+ ## Find in Page
412
+
413
+ Add `hidden-until-found` to the tabs or a panel to keep closed content available to the browser’s Find command. A match selects its tab with the reason `find-in-page`. This also keeps the panel mounted.
414
+
415
+ Server-rendered panels retain `hidden="until-found"`, so their content is available to Find before hydration.
416
+
417
+ ```vue title="find-in-page.vue"
418
+ <script setup lang="ts">
419
+ import { Tabs, TabsList, TabsPanel, TabsTab } from "@ui-sdk/vue/tabs"
420
+
421
+ const policies = [
422
+ {
423
+ value: "shipping",
424
+ label: "Shipping",
425
+ text: "Orders leave our warehouse within two working days. Express delivery arrives the next morning.",
426
+ },
427
+ {
428
+ value: "returns",
429
+ label: "Returns",
430
+ text: "Send anything back within 30 days. Opened electronics carry a restocking fee of 10 percent.",
431
+ },
432
+ {
433
+ value: "warranty",
434
+ label: "Warranty",
435
+ text: "Every product has a two-year warranty. Batteries are covered for one year from delivery.",
436
+ },
437
+ ]
438
+ </script>
439
+
440
+ <template>
441
+ <Tabs default-value="shipping" hidden-until-found>
442
+ <TabsList aria-label="Policies">
443
+ <TabsTab v-for="policy in policies" :key="policy.value" :value="policy.value">
444
+ {{ policy.label }}
445
+ </TabsTab>
446
+ </TabsList>
447
+ <TabsPanel v-for="policy in policies" :key="policy.value" :value="policy.value">
448
+ {{ policy.text }}
449
+ </TabsPanel>
450
+ </Tabs>
451
+ </template>
452
+ ```
453
+
454
+ Use your browser’s Find command to search for “restocking fee”. Returns opens to reveal the match.
455
+
456
+ ## Animation
457
+
458
+ Panels expose `data-starting-style` as they enter and `data-ending-style` as they leave. The previous panel stays mounted through its exit animation, then unmounts or hides if it is kept mounted.
459
+
460
+ Use `data-activation-direction` to choose a slide direction. Put the panels in the same grid cell so they overlap during the transition, as this example does.
461
+
462
+ ```vue title="animation.vue"
463
+ <script setup lang="ts">
464
+ import {
465
+ Tabs,
466
+ TabsIndicator,
467
+ TabsList,
468
+ TabsPanel,
469
+ TabsTab,
470
+ } from "@ui-sdk/vue/tabs"
471
+ </script>
472
+
473
+ <template>
474
+ <Tabs default-value="overview">
475
+ <TabsList aria-label="Project">
476
+ <TabsTab value="overview">Overview</TabsTab>
477
+ <TabsTab value="activity">Activity</TabsTab>
478
+ <TabsTab value="settings">Settings</TabsTab>
479
+ <TabsIndicator />
480
+ </TabsList>
481
+ <div data-slot="stack">
482
+ <TabsPanel value="overview"
483
+ >The launch is on track for Friday, with 4 of 6 tasks done.</TabsPanel
484
+ >
485
+ <TabsPanel value="activity"
486
+ >Inès Moreau deployed to production and Kofi Mensah left a
487
+ review.</TabsPanel
488
+ >
489
+ <TabsPanel value="settings"
490
+ >Rename the project, transfer it to another team or archive
491
+ it.</TabsPanel
492
+ >
493
+ </div>
494
+ </Tabs>
495
+ </template>
496
+ ```
497
+
498
+ Move between Overview, Activity and Settings. The panels slide in the direction you moved.
499
+
500
+ ## Controlled
501
+
502
+ Use `v-model:value` to own the selected tab. [State and Events](../state-and-events.md) covers the shared pattern. Call `details.cancel()` in the change callback to reject a change.
503
+
504
+ `@value-change` receives the new value and a [reason](#reasons), such as `item-press`, `list-navigation`, or `imperative`. It does not run for the initial selection. A [controller](../controllers.md) lets another control select a tab too.
505
+
506
+ ```vue title="controlled.vue"
507
+ <script setup lang="ts">
508
+ import { createTabsController } from "@ui-sdk/core/tabs"
509
+ import {
510
+ Tabs,
511
+ TabsIndicator,
512
+ TabsList,
513
+ TabsPanel,
514
+ TabsTab,
515
+ } from "@ui-sdk/vue/tabs"
516
+ import { ref } from "vue"
517
+ import { useLog } from "./log"
518
+
519
+ const log = useLog()
520
+ const tabs = createTabsController()
521
+ const value = ref<string | null>("inbox")
522
+ </script>
523
+
524
+ <template>
525
+ <div>
526
+ <div data-slot="controls">
527
+ <button type="button" @click="tabs.select('sent')">Show Sent Mail</button>
528
+ </div>
529
+ <Tabs
530
+ v-model:value="value"
531
+ @value-change="
532
+ (next, details) => log(`value: ${next} (${details.reason})`)
533
+ "
534
+ :controller="tabs"
535
+ >
536
+ <TabsList aria-label="Mail">
537
+ <TabsTab value="inbox">Inbox</TabsTab>
538
+ <TabsTab value="drafts">Drafts</TabsTab>
539
+ <TabsTab value="sent">Sent</TabsTab>
540
+ <TabsIndicator />
541
+ </TabsList>
542
+ <TabsPanel value="inbox"
543
+ >3 unread messages from Hollis Grant and Inès Moreau.</TabsPanel
544
+ >
545
+ <TabsPanel value="drafts"
546
+ >2 drafts, the last one edited yesterday at 4:12 PM.</TabsPanel
547
+ >
548
+ <TabsPanel value="sent"
549
+ >12 messages sent this week, all delivered.</TabsPanel
550
+ >
551
+ </Tabs>
552
+ </div>
553
+ </template>
554
+ ```
555
+
556
+ Choose Drafts, then press Show Sent Mail. The console logs each new value with its reason.
557
+
558
+ ## Links
559
+
560
+ Render a tab as a link when selection should navigate. It keeps its tab role; arrow keys follow the link when they select it. Modified clicks, such as Cmd-click, keep their normal browser behavior without selecting the tab.
561
+
562
+ ```vue
563
+ <TabsTab value="activity">
564
+ <template #render="{ props, children }">
565
+ <a v-bind="props" href="#activity"><component :is="children" /></a>
566
+ </template>
567
+ Activity
568
+ </TabsTab>
569
+ ```
570
+
571
+ ```vue title="links.vue"
572
+ <script setup lang="ts">
573
+ import {
574
+ Tabs,
575
+ TabsIndicator,
576
+ TabsList,
577
+ TabsPanel,
578
+ TabsTab,
579
+ } from "@ui-sdk/vue/tabs"
580
+
581
+ const pages = [
582
+ {
583
+ value: "overview",
584
+ href: "#project-overview",
585
+ label: "Overview",
586
+ content:
587
+ "Hollis Grant started this project in March. It has 14 open issues.",
588
+ },
589
+ {
590
+ value: "activity",
591
+ href: "#project-activity",
592
+ label: "Activity",
593
+ content:
594
+ "Wren Takahashi merged 3 pull requests and closed 5 issues this week.",
595
+ },
596
+ {
597
+ value: "members",
598
+ href: "#project-members",
599
+ label: "Members",
600
+ content:
601
+ "Hollis Grant owns the project. Wren Takahashi and 3 others can edit it.",
602
+ },
603
+ ]
604
+ </script>
605
+
606
+ <template>
607
+ <Tabs default-value="overview">
608
+ <TabsList aria-label="Project">
609
+ <TabsTab v-for="page in pages" :key="page.value" :value="page.value">
610
+ <template #render="{ props, children }">
611
+ <a v-bind="props" :href="page.href">
612
+ <component :is="children" />
613
+ </a>
614
+ </template>
615
+ {{ page.label }}
616
+ </TabsTab>
617
+ <TabsIndicator />
618
+ </TabsList>
619
+ <TabsPanel v-for="page in pages" :key="page.value" :value="page.value">
620
+ {{ page.content }}
621
+ </TabsPanel>
622
+ </Tabs>
623
+ </template>
624
+ ```
625
+
626
+ Choose Activity. Its panel opens and the URL hash changes. Modified clicks keep the link’s usual browser behavior.
627
+
628
+ ## Query String
629
+
630
+ Use the URL as the source of the selected value, and validate it against your tab values. Read the parameter on the server when possible, then pass it as the controlled value. Write changes through your router so browser navigation and the rendered page stay in sync. For a plain client page, keep the rest of the URL when updating it:
631
+
632
+ ```ts
633
+ function saveSelectedTab(value: string | null) {
634
+ const url = new URL(location.href)
635
+ if (value === null) {
636
+ url.searchParams.delete("tab")
637
+ } else {
638
+ url.searchParams.set("tab", value)
639
+ }
640
+ history.replaceState(null, "", url)
641
+ }
642
+ ```
643
+
644
+ Call this from `@value-change` after accepting the value. Read it again on `popstate` if your page uses browser history directly; remove that listener when the view unmounts.
645
+
646
+ ## URL Hash
647
+
648
+ A hash such as `#activity` works on a client-rendered page. Read it after mount and on `hashchange`, then select the matching tab. Setting `location.hash` adds a history entry. The server cannot read the hash, so give the page an initial tab while it loads.
649
+
650
+ ## Route Tabs
651
+
652
+ When each tab is a route, render [links](#links) and derive the controlled value from the current path. Let navigation update the value. You do not also need a change handler that navigates to the same route.
653
+
654
+ ## Scroll into View
655
+
656
+ If the list scrolls, selecting a tab through a controller or the URL scrolls it into view inside that list. Pointer and arrow-key selection focus the tab, so the browser reveals it as part of focusing it.
657
+
658
+ ## Custom Rendering
659
+
660
+ Use the `#render` slot to change a part’s element or add to its content, as in the [links](#links) example. [Parts and Composition](../parts-and-composition.md) covers the shared rendering API. Each part’s state is listed under [State](#state).
661
+
662
+ ```vue title="render.vue"
663
+ <script setup lang="ts">
664
+ import { Tabs, TabsList, TabsPanel, TabsTab } from "@ui-sdk/vue/tabs"
665
+
666
+ const folders = [
667
+ {
668
+ value: "inbox",
669
+ label: "Inbox",
670
+ count: 12,
671
+ content: "12 conversations, 3 of them unread.",
672
+ },
673
+ {
674
+ value: "unread",
675
+ label: "Unread",
676
+ count: 3,
677
+ content: "Hollis Grant, Inès Moreau and Kofi Mensah wrote to you.",
678
+ },
679
+ {
680
+ value: "archived",
681
+ label: "Archived",
682
+ count: 0,
683
+ content: "Nothing archived yet. Archived mail stays searchable.",
684
+ },
685
+ ]
686
+ </script>
687
+
688
+ <template>
689
+ <Tabs default-value="inbox">
690
+ <TabsList aria-label="Mail">
691
+ <TabsTab v-for="folder in folders" :key="folder.value" :value="folder.value">
692
+ <template #render="{ props, children }">
693
+ <button v-bind="props">
694
+ <component :is="children" />
695
+ <span v-if="folder.count > 0" data-slot="badge">{{
696
+ folder.count
697
+ }}</span>
698
+ </button>
699
+ </template>
700
+ {{ folder.label }}
701
+ </TabsTab>
702
+ </TabsList>
703
+ <TabsPanel v-for="folder in folders" :key="folder.value" :value="folder.value">
704
+ {{ folder.content }}
705
+ </TabsPanel>
706
+ </Tabs>
707
+ </template>
708
+ ```
709
+
710
+ Each tab renders its own button with an unread count after the label. Choose Unread to see who wrote to you.
711
+
712
+ ## Styling
713
+
714
+ Parts are unstyled. Use `data-selected` and `data-disabled` to style a tab, and `data-selected` on a panel that shows. `data-orientation` on every part lets one stylesheet lay out horizontal and vertical tabs. Icon parts also set `data-has-icon` on the tab and `data-has-icons` on the list, which can help align mixed text and icon tabs.
715
+
716
+ The indicator’s position and size are measured from the tab list into the variables below. Use them for an underline, a background, or a marker beside a vertical list.
717
+
718
+ Each part has a `data-slot`, such as `tabs-tab`, and its state attributes are listed under [Data Attributes](#data-attributes).
719
+
720
+ ### TabsIndicator
721
+ - `--active-tab-left`: Distance from the tab list's left edge to the selected tab.
722
+ - `--active-tab-right`: Distance from the tab list's right edge to the selected tab.
723
+ - `--active-tab-top`: Distance from the tab list's top edge to the selected tab.
724
+ - `--active-tab-bottom`: Distance from the tab list's bottom edge to the selected tab.
725
+ - `--active-tab-width`: Width of the selected tab.
726
+ - `--active-tab-height`: Height of the selected tab.
727
+
728
+ ## Data Attributes
729
+
730
+ ### Tabs
731
+ `[data-slot="tabs"]`
732
+
733
+ - `data-orientation` (`horizontal`, `vertical`): Which arrow keys move between tabs.
734
+ - `data-activation-direction` (`none`, `left`, `right`, `up`, `down`): Which way the last selection moved on screen. Use it to slide panels in from the right side.
735
+
736
+ ### TabsList
737
+ `[data-slot="tabs-list"]`
738
+
739
+ - `data-orientation` (`horizontal`, `vertical`): Which arrow keys move between tabs.
740
+ - `data-activation-direction` (`none`, `left`, `right`, `up`, `down`): Which way the last selection moved on screen. Use it to slide panels in from the right side.
741
+ - `data-has-icons`: Present while any tab inside holds an icon part, so items without one can line up.
742
+
743
+ ### TabsTab
744
+ `[data-slot="tabs-tab"]`
745
+
746
+ - `data-selected`: Present on the selected tab and its panel.
747
+ - `data-orientation` (`horizontal`, `vertical`): Which arrow keys move between tabs.
748
+ - `data-activation-direction` (`none`, `left`, `right`, `up`, `down`): Which way the last selection moved on screen. Use it to slide panels in from the right side.
749
+ - `data-disabled`: Present when the tab can't be selected.
750
+ - `data-has-icon`: Present on a tab while it holds an icon part.
751
+
752
+ ### TabsTabIcon
753
+ `[data-slot="tabs-tab-icon"]`
754
+
755
+ - `data-mirror`: Present on an icon that flips in right-to-left text, with `mirror`.
756
+
757
+ ### TabsIndicator
758
+ `[data-slot="tabs-indicator"]`
759
+
760
+ - `data-orientation` (`horizontal`, `vertical`): Which arrow keys move between tabs.
761
+ - `data-activation-direction` (`none`, `left`, `right`, `up`, `down`): Which way the last selection moved on screen. Use it to slide panels in from the right side.
762
+
763
+ ### TabsPanel
764
+ `[data-slot="tabs-panel"]`
765
+
766
+ - `data-selected`: Present on the selected tab and its panel.
767
+ - `data-orientation` (`horizontal`, `vertical`): Which arrow keys move between tabs.
768
+ - `data-activation-direction` (`none`, `left`, `right`, `up`, `down`): Which way the last selection moved on screen. Use it to slide panels in from the right side.
769
+ - `data-starting-style`: Present for a panel's first frame. Style the state you animate from.
770
+ - `data-ending-style`: Present while the previous panel animates out. Style the state you animate to.
771
+
772
+ ## API Reference
773
+
774
+ Props are the same as below, in kebab case, and callbacks are events.
775
+
776
+ ### Tabs
777
+
778
+ - `value?` (`T | null`): The selected tab's value. Pass it to control the tabs. `null` selects nothing.
779
+ - `defaultValue?` (`T | null`): The tab selected at first, when uncontrolled. Defaults to the first enabled tab, which never calls `@value-change`.
780
+ - `@value-change` (`((value: T | null, details: ChangeDetails<TabsValueChangeReason>) => void)`): Runs when the selection wants to change. `details.reason` says why, and `details.cancel()` stops it.
781
+ - `orientation?` (`TabsOrientation`): Which arrow keys move between tabs: left and right, or up and down.
782
+ - `activation?` (`"automatic" | "manual"`): `"automatic"` selects a tab as soon as arrow keys focus it. `"manual"` waits for Enter or Space.
783
+ - `loop?` (`boolean`): Whether arrow keys wrap from the last tab to the first.
784
+ - `hiddenUntilFound?` (`boolean`): Keeps hidden panels in the page as `hidden="until-found"`, so the browser's find in page can match their text and select their tab. Implies `keepMounted`.
785
+ - `controller?` (`{ getValue: () => T | null; setValue: (value: T | null, options?: TabsChangeOptions) => boolean; select: (value: T, options?: TabsChangeOptions) => boolean; focus: () => void; }`): Selects tabs from anywhere. Create one with `createTabsController()`.
786
+ - `debug?` (`boolean`): Logs every state change with its reason to the console, in development builds.
787
+
788
+ ### TabsList
789
+
790
+ The list takes no options of its own, only the attributes of the element it renders.
791
+
792
+ ### TabsTab
793
+
794
+ - `value` (`string`): Identifies the tab and pairs it with the panel of the same value.
795
+ - `disabled?` (`boolean`): Keeps the tab focusable but stops it from being selected, as the tabs pattern asks.
796
+
797
+ ### TabsTabIcon
798
+
799
+ - `mirror?` (`boolean`): Flips the icon horizontally in right-to-left text, for icons that point a way, like arrows and chevrons. Icons that picture a thing, like a clock or a check, stay as they are.
800
+
801
+ ### TabsIndicator
802
+
803
+ The indicator takes no props of its own. Its [CSS variables](#styling-tabsindicator) hold the selected tab's box.
804
+
805
+ ### TabsPanel
806
+
807
+ - `value` (`string`): The value of the tab this panel belongs to.
808
+ - `keepMounted?` (`boolean`): Whether the panel stays in the page, hidden, while its tab isn't selected.
809
+ - `hiddenUntilFound?` (`boolean`): Whether the panel stays findable with `hidden="until-found"` while its tab isn't selected. Overrides the tabs'.
810
+
811
+ ### State
812
+
813
+ What render functions, state-based class names and slots receive, per part.
814
+
815
+ `Tabs`:
816
+
817
+ - `value` (`T | null`): The selected tab's value.
818
+ - `orientation` (`TabsOrientation`): The tabs' `orientation` option, or `"horizontal"` when it's unset or invalid.
819
+ - `direction` (`Direction`): Which way the last selection moved.
820
+
821
+ `TabsList`:
822
+
823
+ - `orientation` (`TabsOrientation`): The tabs' `orientation` option, or `"horizontal"` when it's unset or invalid.
824
+
825
+ `TabsTab`:
826
+
827
+ - `selected` (`boolean`): Whether this tab's value is the tabs' `value`.
828
+ - `disabled` (`boolean`): Whether this tab can't be selected.
829
+
830
+ `TabsTabIcon`:
831
+
832
+ - `mirror` (`boolean`): Whether it flips in right-to-left text.
833
+
834
+ `TabsPanel`:
835
+
836
+ - `selected` (`boolean`): Whether this panel's tab is selected. False while it animates out.
837
+
838
+ `TabsIndicator`:
839
+
840
+ - `orientation` (`TabsOrientation`): The tabs' `orientation` option, or `"horizontal"` when it's unset or invalid.
841
+ - `direction` (`Direction`): Which way the last selection moved.
842
+
843
+ ### Reasons
844
+
845
+ `details.reason` says why the selection changed.
846
+
847
+ - `item-press` (`MouseEvent | KeyboardEvent`): A member of a collection was chosen: a menu item, a tab, a radio or a checkbox item.
848
+ - `list-navigation` (`KeyboardEvent`): Arrow, Home or End keys moved the selection, typing picked an item, or Ctrl or ⌘ with A selected every item of a listbox.
849
+ - `find-in-page` (`Event`): The browser's find in page matched hidden content.
850
+ - `item-removed` (`none`): The selected item left the page, and another was picked.
851
+ - `imperative` (`none`): A controller or `api` call, or a property set on a web component.
852
+
853
+ ### Controller
854
+
855
+ Create one with `createTabsController()` and pass it as `controller`.
856
+
857
+ Every write method takes an optional `{ reason, event }`, runs `@value-change` like a press, and returns `false` when the change is canceled.
858
+
859
+ - `getValue()` (`() => T | null`): The selected tab's value, or null when nothing is selected.
860
+ - `setValue(value, options?)` (`(value: T | null, options?: TabsChangeOptions | undefined) => boolean`): Selects a tab, or nothing with `null`. Disabled tabs never select. Returns false when canceled.
861
+ - `select(value, options?)` (`(value: T, options?: TabsChangeOptions | undefined) => boolean`): Selects a tab, the same as `setValue`.
862
+ - `focus()` (`() => void`): Moves focus to the selected tab, or the tab that holds the tab stop.
863
+
864
+ ### Events
865
+
866
+ Events get the new value first, then the details. `v-model` only updates when `@value-change` wasn't canceled. `@value-change` never runs on mount.
867
+
868
+ | Binding | On | Receives |
869
+ | --------------- | ------ | ------------------------------------------------------------- |
870
+ | `v-model:value` | `Tabs` | The selected tab's value |
871
+ | `@value-change` | `Tabs` | `(value, details)`: the new value, and the [reason](#reasons) |
872
+
873
+ ## Accessibility
874
+
875
+ Tabs follow the [WAI-ARIA tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/). The list is a `tablist`, each tab controls its panel, and each panel is labelled by its tab.
876
+
877
+ ### Keyboard
878
+
879
+ Tab enters the list at the selected tab and leaves it on the next Tab. Left and Right Arrow move between tabs and select them, or only move focus with `activation="manual"`, where Enter or Space selects. Up and Down Arrow do the same in a vertical list. Home and End move to the first and last tabs. The list reads `dir="rtl"` from the page or any ancestor, and Left and Right follow the reading direction, with no provider.
880
+
881
+ ### Tested Behavior
882
+
883
+ Every line below is an automated test.
884
+
885
+ **Selection**
886
+
887
+ - The default tab is selected and shows its panel.
888
+ - Clicking a tab selects it and shows its panel.
889
+ - Clicking a disabled tab does nothing.
890
+ - Clicking the selected tab keeps it selected.
891
+ - A change can be cancelled.
892
+ - Without a default value, the first enabled tab is selected.
893
+ - Without a default value, the first render already selects the first enabled tab.
894
+
895
+ **Keyboard navigation**
896
+
897
+ - Tab moves focus to the selected tab.
898
+ - ArrowRight and ArrowLeft move focus and select the tab.
899
+ - Disabled tabs are focusable but never selected.
900
+ - Focus wraps at both ends.
901
+ - Home and End move to the first and last tabs.
902
+ - ArrowUp and ArrowDown do nothing in a horizontal tab list.
903
+ - Arrow keys with a modifier are left to the browser.
904
+ - Keys pressed in quick succession are never lost.
905
+ - Tab moves focus from the tab list into the selected panel.
906
+ - Shift+Tab from the panel returns to the selected tab.
907
+
908
+ **Manual activation**
909
+
910
+ - Arrow keys move focus without selecting.
911
+ - Enter selects the focused tab.
912
+ - Space selects the focused tab.
913
+ - Enter on a disabled tab does nothing.
914
+
915
+ **Vertical**
916
+
917
+ - The tab list reports its orientation.
918
+ - ArrowDown and ArrowUp move between tabs.
919
+ - ArrowLeft and ArrowRight do nothing in a vertical tab list.
920
+
921
+ **Panels**
922
+
923
+ - The selected tab controls its panel, and the panel is labelled by its tab.
924
+ - With keepMounted, hidden panels stay in the page.
925
+ - With keepMounted, a class that sets display doesn't show hidden panels.
926
+
927
+ Runs in React, Vue and web components.
928
+
929
+ Beyond the pattern's baseline:
930
+
931
+ **Enhancements**
932
+
933
+ - In manual mode, re-entering the tab list focuses the selected tab.
934
+ - A panel that holds a field is not a tab stop of its own.
935
+ - A controller selects a tab from anywhere.
936
+ - An infinite exit animation still unmounts the panel.
937
+
938
+ Runs in React, Vue and web components.
939
+
940
+ Screen readers hear the same thing in each tested framework, recorded by a virtual screen reader:
941
+
942
+ - Announcements while using the tabs with a keyboard.
943
+
944
+ Runs in React, Vue and web components.