@slotted/react 0.1.0-beta.42 → 0.1.0-beta.43

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 (298) hide show
  1. package/dist/{app-shell-D54YkU7E.js → app-shell-DsWhsSMU.js} +3 -2
  2. package/dist/app-shell.js +1 -1
  3. package/dist/attachment-TZykYNu5.js +300 -0
  4. package/dist/attachment.js +2 -2
  5. package/dist/{avatar-group-bJaZE1_C.js → avatar-group-Bzmmj2HI.js} +2 -1
  6. package/dist/avatar-group.js +1 -1
  7. package/dist/{carousel-B9nMK7Yf.js → carousel-CRNz-T3g.js} +1 -1
  8. package/dist/carousel.js +1 -1
  9. package/dist/{command-palette-C90CzfQi.js → command-palette-Bgf5tfCI.js} +160 -156
  10. package/dist/command-palette.js +1 -1
  11. package/dist/{data-grid-D106baPp.js → data-grid-DUft3rJb.js} +1 -1
  12. package/dist/data-grid.js +1 -1
  13. package/dist/{data-list-BA0xrySM.js → data-list-Dv3orBtf.js} +15 -15
  14. package/dist/data-list.js +1 -1
  15. package/dist/detail-panel-Cke3ZFU3.js +342 -0
  16. package/dist/detail-panel.js +2 -2
  17. package/dist/docs/action-bar.examples.md +768 -0
  18. package/dist/docs/action-bar.json +74 -50
  19. package/dist/docs/action-bar.md +49 -311
  20. package/dist/docs/app-shell.examples.md +1221 -64
  21. package/dist/docs/app-shell.json +92 -60
  22. package/dist/docs/app-shell.md +92 -57
  23. package/dist/docs/attachment.examples.md +689 -0
  24. package/dist/docs/attachment.json +69 -37
  25. package/dist/docs/attachment.md +44 -203
  26. package/dist/docs/avatar-group.json +111 -23
  27. package/dist/docs/avatar-group.md +487 -28
  28. package/dist/docs/button-group.json +98 -2
  29. package/dist/docs/button-group.md +411 -8
  30. package/dist/docs/calendar.examples.md +512 -0
  31. package/dist/docs/calendar.json +72 -24
  32. package/dist/docs/calendar.md +18 -147
  33. package/dist/docs/carousel.examples.md +868 -0
  34. package/dist/docs/carousel.json +58 -50
  35. package/dist/docs/carousel.md +66 -300
  36. package/dist/docs/cascader.examples.md +1269 -0
  37. package/dist/docs/cascader.json +72 -16
  38. package/dist/docs/cascader.md +78 -154
  39. package/dist/docs/chart.examples.md +734 -24
  40. package/dist/docs/chart.json +93 -13
  41. package/dist/docs/chart.md +28 -7
  42. package/dist/docs/clock.json +71 -15
  43. package/dist/docs/clock.md +326 -21
  44. package/dist/docs/code-block.json +79 -55
  45. package/dist/docs/code-block.md +417 -74
  46. package/dist/docs/color-picker.json +60 -12
  47. package/dist/docs/color-picker.md +245 -22
  48. package/dist/docs/column-manager.examples.md +764 -0
  49. package/dist/docs/column-manager.json +68 -12
  50. package/dist/docs/column-manager.md +44 -203
  51. package/dist/docs/command-palette.examples.md +747 -0
  52. package/dist/docs/command-palette.json +48 -24
  53. package/dist/docs/command-palette.md +60 -339
  54. package/dist/docs/currency-field.examples.md +355 -73
  55. package/dist/docs/currency-field.json +96 -64
  56. package/dist/docs/currency-field.md +57 -50
  57. package/dist/docs/dashboard-grid.examples.md +629 -0
  58. package/dist/docs/dashboard-grid.json +64 -16
  59. package/dist/docs/dashboard-grid.md +34 -152
  60. package/dist/docs/data-list.examples.md +1556 -0
  61. package/dist/docs/data-list.json +58 -18
  62. package/dist/docs/data-list.md +139 -224
  63. package/dist/docs/date-field.examples.md +543 -0
  64. package/dist/docs/date-field.json +64 -24
  65. package/dist/docs/date-field.md +22 -168
  66. package/dist/docs/datetime-field.examples.md +699 -0
  67. package/dist/docs/datetime-field.json +79 -31
  68. package/dist/docs/datetime-field.md +24 -269
  69. package/dist/docs/datetime-range-picker.examples.md +682 -0
  70. package/dist/docs/datetime-range-picker.json +117 -61
  71. package/dist/docs/datetime-range-picker.md +59 -224
  72. package/dist/docs/description-list.examples.md +652 -0
  73. package/dist/docs/description-list.json +49 -25
  74. package/dist/docs/description-list.md +33 -188
  75. package/dist/docs/detail-panel.examples.md +1177 -0
  76. package/dist/docs/detail-panel.json +69 -53
  77. package/dist/docs/detail-panel.md +114 -324
  78. package/dist/docs/entity-picker.examples.md +1037 -0
  79. package/dist/docs/entity-picker.json +66 -18
  80. package/dist/docs/entity-picker.md +56 -246
  81. package/dist/docs/event-calendar.examples.md +749 -49
  82. package/dist/docs/event-calendar.json +46 -22
  83. package/dist/docs/event-calendar.md +81 -11
  84. package/dist/docs/field-group.examples.md +554 -0
  85. package/dist/docs/field-group.json +98 -34
  86. package/dist/docs/field-group.md +55 -133
  87. package/dist/docs/filter-bar.examples.md +772 -0
  88. package/dist/docs/filter-bar.json +41 -25
  89. package/dist/docs/filter-bar.md +42 -246
  90. package/dist/docs/form.examples.md +579 -0
  91. package/dist/docs/form.json +87 -39
  92. package/dist/docs/form.md +53 -177
  93. package/dist/docs/fullscreen.examples.md +558 -0
  94. package/dist/docs/fullscreen.json +58 -18
  95. package/dist/docs/fullscreen.md +50 -169
  96. package/dist/docs/highlight.json +57 -25
  97. package/dist/docs/highlight.md +402 -50
  98. package/dist/docs/icon.json +85 -5
  99. package/dist/docs/icon.md +401 -10
  100. package/dist/docs/image.examples.md +670 -0
  101. package/dist/docs/image.json +44 -28
  102. package/dist/docs/image.md +24 -176
  103. package/dist/docs/import-export-center.examples.md +1280 -0
  104. package/dist/docs/import-export-center.json +67 -27
  105. package/dist/docs/import-export-center.md +121 -226
  106. package/dist/docs/list-item.examples.md +769 -0
  107. package/dist/docs/list-item.json +110 -38
  108. package/dist/docs/list-item.md +84 -201
  109. package/dist/docs/listbox.examples.md +858 -0
  110. package/dist/docs/listbox.json +76 -28
  111. package/dist/docs/listbox.md +41 -263
  112. package/dist/docs/markdown.json +79 -55
  113. package/dist/docs/markdown.md +581 -85
  114. package/dist/docs/media-viewer.examples.md +1038 -0
  115. package/dist/docs/media-viewer.json +70 -15
  116. package/dist/docs/media-viewer.md +84 -135
  117. package/dist/docs/message-scroller.examples.md +1193 -0
  118. package/dist/docs/message-scroller.json +41 -17
  119. package/dist/docs/message-scroller.md +80 -134
  120. package/dist/docs/message.examples.md +944 -0
  121. package/dist/docs/message.json +64 -16
  122. package/dist/docs/message.md +34 -326
  123. package/dist/docs/meter.json +58 -26
  124. package/dist/docs/meter.md +312 -32
  125. package/dist/docs/navigation-menu.examples.md +1107 -0
  126. package/dist/docs/navigation-menu.json +57 -41
  127. package/dist/docs/navigation-menu.md +105 -298
  128. package/dist/docs/notification-center.examples.md +1045 -0
  129. package/dist/docs/notification-center.json +71 -15
  130. package/dist/docs/notification-center.md +76 -266
  131. package/dist/docs/otp-input.examples.md +490 -0
  132. package/dist/docs/otp-input.json +65 -25
  133. package/dist/docs/otp-input.md +20 -191
  134. package/dist/docs/page-header.examples.md +1041 -0
  135. package/dist/docs/page-header.json +75 -43
  136. package/dist/docs/page-header.md +79 -291
  137. package/dist/docs/page.examples.md +633 -0
  138. package/dist/docs/page.json +48 -16
  139. package/dist/docs/page.md +62 -129
  140. package/dist/docs/prompt-composer.examples.md +630 -0
  141. package/dist/docs/prompt-composer.json +66 -18
  142. package/dist/docs/prompt-composer.md +35 -161
  143. package/dist/docs/prose.json +69 -37
  144. package/dist/docs/prose.md +393 -75
  145. package/dist/docs/rating.examples.md +525 -0
  146. package/dist/docs/rating.json +92 -28
  147. package/dist/docs/rating.md +27 -241
  148. package/dist/docs/saved-views.examples.md +1108 -0
  149. package/dist/docs/saved-views.json +53 -21
  150. package/dist/docs/saved-views.md +86 -171
  151. package/dist/docs/scroll-area.examples.md +837 -0
  152. package/dist/docs/scroll-area.json +64 -24
  153. package/dist/docs/scroll-area.md +57 -140
  154. package/dist/docs/section.examples.md +676 -0
  155. package/dist/docs/section.json +68 -20
  156. package/dist/docs/section.md +39 -162
  157. package/dist/docs/segmented-control.examples.md +480 -0
  158. package/dist/docs/segmented-control.json +76 -28
  159. package/dist/docs/segmented-control.md +20 -191
  160. package/dist/docs/side-navigation.examples.md +1468 -0
  161. package/dist/docs/side-navigation.json +53 -53
  162. package/dist/docs/side-navigation.md +79 -354
  163. package/dist/docs/slider.examples.md +505 -0
  164. package/dist/docs/slider.json +91 -51
  165. package/dist/docs/slider.md +47 -212
  166. package/dist/docs/sparkline.json +60 -36
  167. package/dist/docs/sparkline.md +447 -71
  168. package/dist/docs/split-button.examples.md +509 -0
  169. package/dist/docs/split-button.json +73 -41
  170. package/dist/docs/split-button.md +64 -194
  171. package/dist/docs/splitter.examples.md +921 -0
  172. package/dist/docs/splitter.json +94 -46
  173. package/dist/docs/splitter.md +75 -182
  174. package/dist/docs/stat-card.examples.md +725 -0
  175. package/dist/docs/stat-card.json +89 -41
  176. package/dist/docs/stat-card.md +55 -227
  177. package/dist/docs/status-indicator.json +80 -32
  178. package/dist/docs/status-indicator.md +409 -65
  179. package/dist/docs/stepper.json +53 -21
  180. package/dist/docs/stepper.md +369 -48
  181. package/dist/docs/table-of-contents.examples.md +550 -0
  182. package/dist/docs/table-of-contents.json +60 -28
  183. package/dist/docs/table-of-contents.md +70 -205
  184. package/dist/docs/tags-input.examples.md +541 -0
  185. package/dist/docs/tags-input.json +64 -16
  186. package/dist/docs/tags-input.md +15 -262
  187. package/dist/docs/time-field.examples.md +587 -0
  188. package/dist/docs/time-field.json +69 -29
  189. package/dist/docs/time-field.md +21 -223
  190. package/dist/docs/time-picker.json +117 -53
  191. package/dist/docs/time-picker.md +499 -54
  192. package/dist/docs/time-range-picker.examples.md +750 -0
  193. package/dist/docs/time-range-picker.json +139 -75
  194. package/dist/docs/time-range-picker.md +63 -225
  195. package/dist/docs/timeline.examples.md +617 -0
  196. package/dist/docs/timeline.json +44 -28
  197. package/dist/docs/timeline.md +34 -208
  198. package/dist/docs/toolbar.json +56 -16
  199. package/dist/docs/toolbar.md +357 -63
  200. package/dist/docs/top-navigation.examples.md +1206 -140
  201. package/dist/docs/top-navigation.json +49 -33
  202. package/dist/docs/top-navigation.md +87 -36
  203. package/dist/docs/tour.examples.md +960 -0
  204. package/dist/docs/tour.json +57 -25
  205. package/dist/docs/tour.md +60 -244
  206. package/dist/docs/transfer.examples.md +631 -0
  207. package/dist/docs/transfer.json +80 -16
  208. package/dist/docs/transfer.md +41 -170
  209. package/dist/docs/typography.json +96 -0
  210. package/dist/docs/typography.md +352 -4
  211. package/dist/docs/upload.examples.md +555 -53
  212. package/dist/docs/upload.json +62 -30
  213. package/dist/docs/upload.md +46 -11
  214. package/dist/docs/wizard.examples.md +1389 -0
  215. package/dist/docs/wizard.json +89 -49
  216. package/dist/docs/wizard.md +122 -263
  217. package/dist/{entity-picker-CC4VoC3p.js → entity-picker-C78f3Z0o.js} +9 -6
  218. package/dist/entity-picker.js +1 -1
  219. package/dist/{event-calendar-CjmF_e0H.js → event-calendar-DJPoCi-O.js} +1 -1
  220. package/dist/event-calendar.js +1 -1
  221. package/dist/{filter-bar-B3QJD7SZ.js → filter-bar-D61wiQFP.js} +1 -1
  222. package/dist/filter-bar.js +1 -1
  223. package/dist/{import-export-center-CW8YVZev.js → import-export-center-mqvmlzwB.js} +44 -36
  224. package/dist/import-export-center.js +1 -1
  225. package/dist/index.js +58 -58
  226. package/dist/{markdown-BdskE4-L.js → markdown-8CtV4k44.js} +2 -2
  227. package/dist/markdown.js +1 -1
  228. package/dist/{media-viewer-zEXcwfEY.js → media-viewer-C_cbuAq-.js} +64 -60
  229. package/dist/media-viewer.js +2 -2
  230. package/dist/message-P91bEGyV.js +455 -0
  231. package/dist/message.js +2 -2
  232. package/dist/{page-header-DmwBGwlm.js → page-header-jeAIQSZM.js} +103 -108
  233. package/dist/page-header.js +1 -1
  234. package/dist/section-CVTQdWBl.js +216 -0
  235. package/dist/section.js +2 -2
  236. package/dist/{segmented-control-CbK7SurB.js → segmented-control-BSMVjukr.js} +1 -1
  237. package/dist/segmented-control.js +1 -1
  238. package/dist/{side-navigation-CKRETc8E.js → side-navigation-BQzBxz2B.js} +179 -179
  239. package/dist/side-navigation.js +1 -1
  240. package/dist/{stat-card-CL3Xe6pV.js → stat-card-BpGZiFbG.js} +12 -14
  241. package/dist/stat-card.js +1 -1
  242. package/dist/{stepper-DHdrANZI.js → stepper-Cxb_tHnA.js} +130 -127
  243. package/dist/stepper.js +2 -2
  244. package/dist/styles/carousel.css +1 -1
  245. package/dist/styles/index.css +1 -1
  246. package/dist/styles.css +1 -1
  247. package/dist/{timeline-BiL2CXfn.js → timeline-ZngK6zLC.js} +9 -6
  248. package/dist/timeline.js +1 -1
  249. package/dist/top-navigation-YSEQzBhD.js +744 -0
  250. package/dist/top-navigation.js +2 -2
  251. package/dist/{transfer-sKUvmEKe.js → transfer-Cv5yQuTN.js} +1 -1
  252. package/dist/transfer.js +1 -1
  253. package/dist/types/attachment/attachment-parts.d.ts +24 -11
  254. package/dist/types/attachment/attachment-parts.d.ts.map +1 -1
  255. package/dist/types/attachment/attachment.d.ts +3 -3
  256. package/dist/types/attachment/attachment.d.ts.map +1 -1
  257. package/dist/types/avatar-group/avatar-group.d.ts.map +1 -1
  258. package/dist/types/carousel/carousel-parts.d.ts +2 -2
  259. package/dist/types/command-palette/command-palette.d.ts.map +1 -1
  260. package/dist/types/data-list/data-list.d.ts.map +1 -1
  261. package/dist/types/detail-panel/detail-panel-parts.d.ts +10 -3
  262. package/dist/types/detail-panel/detail-panel-parts.d.ts.map +1 -1
  263. package/dist/types/detail-panel/detail-panel.d.ts.map +1 -1
  264. package/dist/types/detail-panel/detail-panel.types.d.ts +7 -0
  265. package/dist/types/detail-panel/detail-panel.types.d.ts.map +1 -1
  266. package/dist/types/entity-picker/entity-picker.d.ts.map +1 -1
  267. package/dist/types/import-export-center/import-export-center.d.ts.map +1 -1
  268. package/dist/types/media-viewer/index.d.ts +2 -2
  269. package/dist/types/media-viewer/index.d.ts.map +1 -1
  270. package/dist/types/media-viewer/media-viewer-bar.d.ts +3 -1
  271. package/dist/types/media-viewer/media-viewer-bar.d.ts.map +1 -1
  272. package/dist/types/media-viewer/media-viewer.types.d.ts +1 -0
  273. package/dist/types/media-viewer/media-viewer.types.d.ts.map +1 -1
  274. package/dist/types/message/message-parts.d.ts +7 -0
  275. package/dist/types/message/message-parts.d.ts.map +1 -1
  276. package/dist/types/message/message.d.ts.map +1 -1
  277. package/dist/types/page-header/page-header-parts.d.ts.map +1 -1
  278. package/dist/types/section/section-parts.d.ts +16 -8
  279. package/dist/types/section/section-parts.d.ts.map +1 -1
  280. package/dist/types/section/section.d.ts.map +1 -1
  281. package/dist/types/segmented-control/segmented-control-parts.d.ts.map +1 -1
  282. package/dist/types/side-navigation/side-navigation-parts.d.ts.map +1 -1
  283. package/dist/types/stat-card/stat-card-delta.d.ts.map +1 -1
  284. package/dist/types/stat-card/stat-card-parts.d.ts +3 -3
  285. package/dist/types/stat-card/stat-card-parts.d.ts.map +1 -1
  286. package/dist/types/stepper/stepper-parts.d.ts +11 -2
  287. package/dist/types/stepper/stepper-parts.d.ts.map +1 -1
  288. package/dist/types/stepper/stepper.d.ts.map +1 -1
  289. package/dist/types/timeline/timeline-parts.d.ts.map +1 -1
  290. package/dist/types/top-navigation/top-navigation.d.ts.map +1 -1
  291. package/dist/{wizard-4c0X7Bx_.js → wizard-Dfryz1id.js} +214 -214
  292. package/dist/wizard.js +1 -1
  293. package/package.json +6 -6
  294. package/dist/attachment-MqczA38F.js +0 -292
  295. package/dist/detail-panel-EImAtksY.js +0 -327
  296. package/dist/message-D1Dd6Y2k.js +0 -452
  297. package/dist/section-D_qOfdxR.js +0 -213
  298. package/dist/top-navigation-D8IHPOmm.js +0 -744
@@ -0,0 +1,868 @@
1
+ <!-- index: ./index.md -->
2
+ # carousel
3
+
4
+ `data-ui="carousel"` · Slides that scroll one page at a time.
5
+
6
+ ## Examples
7
+
8
+ ### Playground
9
+
10
+ A slideshow of the workshop’s pieces with every axis below the canvas. Press next, drag with the mouse, swipe on a touch screen, or focus the viewport and use the arrows: the dots, the counter and the slide names follow.
11
+
12
+ Excerpt — not a complete module
13
+
14
+ ```tsx
15
+ <Carousel aria-label="Autumn Collection">
16
+ <CarouselViewport>
17
+ {pieces.map((piece) => (
18
+ <CarouselSlide key={piece.name}>
19
+ <Image alt={piece.name} ratio="landscape" src={piece.image} />
20
+ </CarouselSlide>
21
+ ))}
22
+ </CarouselViewport>
23
+ <CarouselPrevious />
24
+ <CarouselNext />
25
+ <CarouselControls>
26
+ <CarouselIndicators />
27
+ <CarouselCounter />
28
+ </CarouselControls>
29
+ </Carousel>;
30
+ ```
31
+
32
+ ### A column of slides
33
+
34
+ orientation="vertical" turns the scroller and both arrows a quarter; the keys that page it are now ArrowUp and ArrowDown, and ArrowLeft and ArrowRight are left to the page. The column needs a height, which --slotted-carousel-viewport-size gives it.
35
+
36
+ Example
37
+
38
+ ```tsx
39
+ import {
40
+ Carousel,
41
+ CarouselNext,
42
+ CarouselPrevious,
43
+ CarouselSlide,
44
+ CarouselViewport,
45
+ } from '@slotted/react/carousel';
46
+ import { Card, CardBody } from '@slotted/react/card';
47
+ import { Heading, Text } from '@slotted/react/typography';
48
+
49
+ const NOTICES = [
50
+ {
51
+ title: 'Carrier cutoff moved',
52
+ body: 'The Antwerp pickup now leaves at 16:30 instead of 18:00.',
53
+ },
54
+ { title: 'Cycle count, aisle 14', body: 'Counts start Monday at 06:00 and close by noon.' },
55
+ { title: 'Dock 3 maintenance', body: 'The dock leveler is out of service until Thursday.' },
56
+ {
57
+ title: 'Peak season hires',
58
+ body: 'Twelve temporary pickers join the night shift on 3 November.',
59
+ },
60
+ ];
61
+
62
+ export default function CarouselOrientationExample() {
63
+ return (
64
+ <Carousel aria-label="Operations notices" orientation="vertical" slidesPerView={2}>
65
+ <CarouselViewport>
66
+ {NOTICES.map((notice) => (
67
+ <CarouselSlide key={notice.title}>
68
+ <Card>
69
+ <CardBody>
70
+ <Heading level={2} size="sm">
71
+ {notice.title}
72
+ </Heading>
73
+ <Text size="sm" tone="muted">
74
+ {notice.body}
75
+ </Text>
76
+ </CardBody>
77
+ </Card>
78
+ </CarouselSlide>
79
+ ))}
80
+ </CarouselViewport>
81
+ <CarouselPrevious />
82
+ <CarouselNext />
83
+ </Carousel>
84
+ );
85
+ }
86
+ ```
87
+
88
+ ### Slide or fade
89
+
90
+ slide moves the track on a spring timed by the theme’s long duration, which keeps the speed of a hand that lets go or of a movement it interrupts; fade stacks the slides and crossfades them — the arriving one on the enter curve, the leaving one faster on the exit curve. Under reduced motion both change at once.
91
+
92
+ Example
93
+
94
+ ```tsx
95
+ import {
96
+ Carousel,
97
+ CarouselControls,
98
+ CarouselIndicators,
99
+ CarouselNext,
100
+ CarouselPrevious,
101
+ CarouselSlide,
102
+ CarouselViewport,
103
+ } from '@slotted/react/carousel';
104
+ import { Card, CardBody } from '@slotted/react/card';
105
+ import { Stack } from '@slotted/react/stack';
106
+ import { Heading, Text } from '@slotted/react/typography';
107
+
108
+ const NOTICES = [
109
+ {
110
+ title: 'Carrier cutoff moved',
111
+ body: 'The Antwerp pickup now leaves at 16:30 instead of 18:00.',
112
+ },
113
+ { title: 'Cycle count, aisle 14', body: 'Counts start Monday at 06:00 and close by noon.' },
114
+ { title: 'Dock 3 maintenance', body: 'The dock leveler is out of service until Thursday.' },
115
+ {
116
+ title: 'Peak season hires',
117
+ body: 'Twelve temporary pickers join the night shift on 3 November.',
118
+ },
119
+ ];
120
+
121
+ export default function CarouselTransitionExample() {
122
+ return (
123
+ <Stack gap={6}>
124
+ <Stack gap={2}>
125
+ <Text size="sm" tone="muted">
126
+ transition="slide"
127
+ </Text>
128
+ <Carousel aria-label="Notices that slide" loop transition="slide">
129
+ <CarouselViewport>
130
+ {NOTICES.map((notice) => (
131
+ <CarouselSlide key={notice.title}>
132
+ <Card>
133
+ <CardBody>
134
+ <Heading level={2} size="sm">
135
+ {notice.title}
136
+ </Heading>
137
+ <Text size="sm" tone="muted">
138
+ {notice.body}
139
+ </Text>
140
+ </CardBody>
141
+ </Card>
142
+ </CarouselSlide>
143
+ ))}
144
+ </CarouselViewport>
145
+ <CarouselControls>
146
+ <CarouselPrevious />
147
+ <CarouselIndicators />
148
+ <CarouselNext />
149
+ </CarouselControls>
150
+ </Carousel>
151
+ </Stack>
152
+ <Stack gap={2}>
153
+ <Text size="sm" tone="muted">
154
+ transition="fade"
155
+ </Text>
156
+ <Carousel aria-label="Notices that fade" loop transition="fade">
157
+ <CarouselViewport>
158
+ {NOTICES.map((notice) => (
159
+ <CarouselSlide key={notice.title}>
160
+ <Card>
161
+ <CardBody>
162
+ <Heading level={2} size="sm">
163
+ {notice.title}
164
+ </Heading>
165
+ <Text size="sm" tone="muted">
166
+ {notice.body}
167
+ </Text>
168
+ </CardBody>
169
+ </Card>
170
+ </CarouselSlide>
171
+ ))}
172
+ </CarouselViewport>
173
+ <CarouselControls>
174
+ <CarouselPrevious />
175
+ <CarouselIndicators />
176
+ <CarouselNext />
177
+ </CarouselControls>
178
+ </Carousel>
179
+ </Stack>
180
+ </Stack>
181
+ );
182
+ }
183
+ ```
184
+
185
+ ### Centered, with the neighbors showing
186
+
187
+ align="center" makes every slide a page and centers it; --slotted-carousel-peek pads the viewport so the slides either side show at its edges. Press a slide that peeks and it comes to the center.
188
+
189
+ Example
190
+
191
+ ```tsx
192
+ import {
193
+ Carousel,
194
+ CarouselControls,
195
+ CarouselIndicators,
196
+ CarouselNext,
197
+ CarouselPrevious,
198
+ CarouselSlide,
199
+ CarouselViewport,
200
+ } from '@slotted/react/carousel';
201
+ import { Badge } from '@slotted/react/badge';
202
+ import { Card, CardBody } from '@slotted/react/card';
203
+ import { Stack } from '@slotted/react/stack';
204
+ import { Heading, Text } from '@slotted/react/typography';
205
+
206
+ const DOCKS = [
207
+ { name: 'Dock 1', status: 'Loading', tone: 'info' },
208
+ { name: 'Dock 2', status: 'Free', tone: 'success' },
209
+ { name: 'Dock 3', status: 'Maintenance', tone: 'warning' },
210
+ { name: 'Dock 4', status: 'Blocked', tone: 'danger' },
211
+ { name: 'Dock 5', status: 'Free', tone: 'success' },
212
+ { name: 'Dock 6', status: 'Unloading', tone: 'info' },
213
+ ] as const;
214
+
215
+ const ALIGNMENTS = ['start', 'center'] as const;
216
+
217
+ export default function CarouselAlignExample() {
218
+ return (
219
+ <Stack gap={6}>
220
+ {ALIGNMENTS.map((align) => (
221
+ <Stack key={align} gap={2}>
222
+ <Text size="sm" tone="muted">
223
+ align="{align}"
224
+ </Text>
225
+ <Carousel align={align} aria-label={`Docks, aligned to the ${align}`} slidesPerView={3}>
226
+ <CarouselViewport>
227
+ {DOCKS.map((dock) => (
228
+ <CarouselSlide key={dock.name}>
229
+ <Card>
230
+ <CardBody>
231
+ <Heading level={2} size="sm">
232
+ {dock.name}
233
+ </Heading>
234
+ <Badge tone={dock.tone}>{dock.status}</Badge>
235
+ </CardBody>
236
+ </Card>
237
+ </CarouselSlide>
238
+ ))}
239
+ </CarouselViewport>
240
+ <CarouselPrevious />
241
+ <CarouselNext />
242
+ <CarouselControls>
243
+ <CarouselIndicators />
244
+ </CarouselControls>
245
+ </Carousel>
246
+ </Stack>
247
+ ))}
248
+ </Stack>
249
+ );
250
+ }
251
+ ```
252
+
253
+ ### Over the picture, or beside the row
254
+
255
+ arrows="inset" stands previous and next over the ends of the viewport, for a slideshow; "outside" gives them columns of their own, so a row of cards keeps its whole width and no arrow covers the first card.
256
+
257
+ Excerpt — not a complete module
258
+
259
+ ```tsx
260
+ <Carousel aria-label="Best sellers" arrows="outside" slidesPerView={3}>
261
+ <CarouselViewport>{cards}</CarouselViewport>
262
+ <CarouselPrevious />
263
+ <CarouselNext />
264
+ </Carousel>;
265
+ ```
266
+
267
+ ### Three control sizes
268
+
269
+ size steps the round controls along the control scale — 30, 34 and 38 pixels at comfortable — and the density shrinks them with every other control. The dots keep the 24-pixel target in every size.
270
+
271
+ Example
272
+
273
+ ```tsx
274
+ import {
275
+ Carousel,
276
+ CarouselControls,
277
+ CarouselIndicators,
278
+ CarouselNext,
279
+ CarouselPrevious,
280
+ CarouselSlide,
281
+ CarouselViewport,
282
+ } from '@slotted/react/carousel';
283
+ import { Card, CardBody } from '@slotted/react/card';
284
+ import { Stack } from '@slotted/react/stack';
285
+ import { Heading, Text } from '@slotted/react/typography';
286
+
287
+ const NOTICES = [
288
+ {
289
+ title: 'Carrier cutoff moved',
290
+ body: 'The Antwerp pickup now leaves at 16:30 instead of 18:00.',
291
+ },
292
+ { title: 'Cycle count, aisle 14', body: 'Counts start Monday at 06:00 and close by noon.' },
293
+ { title: 'Dock 3 maintenance', body: 'The dock leveler is out of service until Thursday.' },
294
+ {
295
+ title: 'Peak season hires',
296
+ body: 'Twelve temporary pickers join the night shift on 3 November.',
297
+ },
298
+ ];
299
+
300
+ const SIZES = ['sm', 'md', 'lg'] as const;
301
+
302
+ export default function CarouselSizesExample() {
303
+ return (
304
+ <Stack gap={6}>
305
+ {SIZES.map((size) => (
306
+ <Stack key={size} gap={2}>
307
+ <Text size="sm" tone="muted">
308
+ size="{size}"
309
+ </Text>
310
+ <Carousel aria-label={`Notices, size ${size}`} size={size}>
311
+ <CarouselViewport>
312
+ {NOTICES.slice(0, 3).map((notice) => (
313
+ <CarouselSlide key={notice.title}>
314
+ <Card>
315
+ <CardBody>
316
+ <Heading level={2} size="sm">
317
+ {notice.title}
318
+ </Heading>
319
+ </CardBody>
320
+ </Card>
321
+ </CarouselSlide>
322
+ ))}
323
+ </CarouselViewport>
324
+ <CarouselControls>
325
+ <CarouselPrevious />
326
+ <CarouselIndicators />
327
+ <CarouselNext />
328
+ </CarouselControls>
329
+ </Carousel>
330
+ </Stack>
331
+ ))}
332
+ </Stack>
333
+ );
334
+ }
335
+ ```
336
+
337
+ ### Dots, a line, and many pages
338
+
339
+ dots draw the current page as a bar three dots long; line shares the width between segments; past eight pages the dots window themselves, the ones two steps away shrink and the rest fold away while staying in the arrow ring.
340
+
341
+ Example
342
+
343
+ ```tsx
344
+ import {
345
+ Carousel,
346
+ CarouselControls,
347
+ CarouselCounter,
348
+ CarouselIndicators,
349
+ CarouselSlide,
350
+ CarouselViewport,
351
+ } from '@slotted/react/carousel';
352
+ import { Card, CardBody } from '@slotted/react/card';
353
+ import { Stack } from '@slotted/react/stack';
354
+ import { Heading, Text } from '@slotted/react/typography';
355
+
356
+ const ZONES = [
357
+ 'Ambient',
358
+ 'Chilled',
359
+ 'Frozen',
360
+ 'Bulk',
361
+ 'Pick face',
362
+ 'Returns',
363
+ 'Hazmat',
364
+ 'Quarantine',
365
+ 'Overflow',
366
+ 'Mezzanine',
367
+ ];
368
+
369
+ const ROWS = [
370
+ { label: 'variant="dots"', name: 'Zones, dots', variant: 'dots', zones: ZONES.slice(0, 5) },
371
+ { label: 'variant="line"', name: 'Zones, line', variant: 'line', zones: ZONES.slice(0, 5) },
372
+ { label: 'variant="dots", ten pages', name: 'All zones, dots', variant: 'dots', zones: ZONES },
373
+ ] as const;
374
+
375
+ export default function CarouselIndicatorsExample() {
376
+ return (
377
+ <Stack gap={6}>
378
+ {ROWS.map((row) => (
379
+ <Stack key={row.name} gap={2}>
380
+ <Text size="sm" tone="muted">
381
+ {row.label}
382
+ </Text>
383
+ <Carousel aria-label={row.name}>
384
+ <CarouselViewport>
385
+ {row.zones.map((zone) => (
386
+ <CarouselSlide key={zone}>
387
+ <Card>
388
+ <CardBody>
389
+ <Heading level={2} size="sm">
390
+ {zone}
391
+ </Heading>
392
+ </CardBody>
393
+ </Card>
394
+ </CarouselSlide>
395
+ ))}
396
+ </CarouselViewport>
397
+ <CarouselControls>
398
+ <CarouselIndicators variant={row.variant} />
399
+ <CarouselCounter />
400
+ </CarouselControls>
401
+ </Carousel>
402
+ </Stack>
403
+ ))}
404
+ </Stack>
405
+ );
406
+ }
407
+ ```
408
+
409
+ ### A product gallery
410
+
411
+ variant="thumbnails" with a function child draws each indicator from the consumer’s picture. The strip scrolls on its own when it holds more than it shows, and keeps the current picture in view — one carousel, nothing to synchronize.
412
+
413
+ Example
414
+
415
+ ```tsx
416
+ import {
417
+ Carousel,
418
+ CarouselIndicator,
419
+ CarouselIndicators,
420
+ CarouselNext,
421
+ CarouselPrevious,
422
+ CarouselSlide,
423
+ CarouselViewport,
424
+ } from '@slotted/react/carousel';
425
+ import { Image } from '@slotted/react/image';
426
+
427
+ const SITES = [
428
+ { name: 'Rotterdam dock', src: picture('Rotterdam dock', '#1e3a5f') },
429
+ { name: 'Cold storage', src: picture('Cold storage', '#0f766e') },
430
+ { name: 'Cross-dock', src: picture('Cross-dock', '#7c2d12') },
431
+ { name: 'Returns hall', src: picture('Returns hall', '#4c1d95') },
432
+ { name: 'Outbound lanes', src: picture('Outbound lanes', '#374151') },
433
+ ];
434
+
435
+ export default function CarouselThumbnailsExample() {
436
+ return (
437
+ <Carousel aria-label="Northwind site photos">
438
+ <CarouselViewport>
439
+ {SITES.map((site) => (
440
+ <CarouselSlide key={site.name}>
441
+ <Image alt={site.name} ratio="landscape" src={site.src} />
442
+ </CarouselSlide>
443
+ ))}
444
+ </CarouselViewport>
445
+ <CarouselPrevious />
446
+ <CarouselNext />
447
+ <CarouselIndicators aria-label="Site photos" variant="thumbnails">
448
+ {(page) => (
449
+ <CarouselIndicator key={page} page={page}>
450
+ <img alt={SITES[page]?.name ?? ''} src={SITES[page]?.src ?? ''} />
451
+ </CarouselIndicator>
452
+ )}
453
+ </CarouselIndicators>
454
+ </Carousel>
455
+ );
456
+ }
457
+
458
+ function picture(name: string, color: string) {
459
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 500"><rect width="800" height="500" fill="${color}"/><text x="400" y="270" fill="#ffffff" font-family="sans-serif" font-size="56" text-anchor="middle">${name}</text></svg>`;
460
+
461
+ return `data:image/svg+xml,${encodeURIComponent(svg)}`;
462
+ }
463
+ ```
464
+
465
+ ### A rotation the reader controls
466
+
467
+ autoplay turns it on; the current dot fills over the delay. Hovering holds it with the time that was left, a hidden browser tab holds it, and the first keyboard focus inside stops it until the rotation control starts it again.
468
+
469
+ Example
470
+
471
+ ```tsx
472
+ import {
473
+ Carousel,
474
+ CarouselAutoplay,
475
+ CarouselControls,
476
+ CarouselIndicators,
477
+ CarouselSlide,
478
+ CarouselViewport,
479
+ } from '@slotted/react/carousel';
480
+ import { Image } from '@slotted/react/image';
481
+
482
+ const SITES = [
483
+ { name: 'Rotterdam dock', src: picture('Rotterdam dock', '#1e3a5f') },
484
+ { name: 'Cold storage', src: picture('Cold storage', '#0f766e') },
485
+ { name: 'Cross-dock', src: picture('Cross-dock', '#7c2d12') },
486
+ { name: 'Returns hall', src: picture('Returns hall', '#4c1d95') },
487
+ { name: 'Outbound lanes', src: picture('Outbound lanes', '#374151') },
488
+ ];
489
+
490
+ export default function CarouselAutoplayExample() {
491
+ return (
492
+ <Carousel aria-label="Northwind site highlights" autoplay={6000} loop>
493
+ <CarouselViewport>
494
+ {SITES.map((site) => (
495
+ <CarouselSlide key={site.name}>
496
+ <Image alt={site.name} ratio="landscape" src={site.src} />
497
+ </CarouselSlide>
498
+ ))}
499
+ </CarouselViewport>
500
+ <CarouselControls placement="overlay">
501
+ <CarouselAutoplay />
502
+ <CarouselIndicators />
503
+ </CarouselControls>
504
+ </Carousel>
505
+ );
506
+ }
507
+
508
+ function picture(name: string, color: string) {
509
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 500"><rect width="800" height="500" fill="${color}"/><text x="400" y="270" fill="#ffffff" font-family="sans-serif" font-size="56" text-anchor="middle">${name}</text></svg>`;
510
+
511
+ return `data:image/svg+xml,${encodeURIComponent(svg)}`;
512
+ }
513
+ ```
514
+
515
+ ### A row of cards that pages by what it shows
516
+
517
+ slidesPerView={3} sizes the cards; the pages are read from the layout, so the row pages by three and its last page ends flush. --slotted-carousel-slide-min-size keeps a card readable when the container narrows: at 240 pixels the same carousel shows one card and the edge of the next.
518
+
519
+ Example
520
+
521
+ ```tsx
522
+ import {
523
+ Carousel,
524
+ CarouselControls,
525
+ CarouselIndicators,
526
+ CarouselNext,
527
+ CarouselPrevious,
528
+ CarouselSlide,
529
+ CarouselViewport,
530
+ } from '@slotted/react/carousel';
531
+ import { Badge } from '@slotted/react/badge';
532
+ import { Card, CardBody } from '@slotted/react/card';
533
+ import { Heading, Text } from '@slotted/react/typography';
534
+
535
+ const PRODUCTS = [
536
+ { name: 'Pallet wrap', price: '€14.50', stock: 'In stock', tone: 'success' },
537
+ { name: 'Thermal labels', price: '€32.00', stock: 'Low stock', tone: 'warning' },
538
+ { name: 'Cold-chain crate', price: '€96.00', stock: 'Out of stock', tone: 'danger' },
539
+ { name: 'Handheld scanner', price: '€389.00', stock: 'In stock', tone: 'success' },
540
+ { name: 'Safety vest', price: '€9.90', stock: 'Backorder', tone: 'info' },
541
+ { name: 'Pallet jack', price: '€420.00', stock: 'In stock', tone: 'success' },
542
+ ] as const;
543
+
544
+ export default function CarouselMultipleExample() {
545
+ return (
546
+ <Carousel aria-label="Warehouse supplies" arrows="outside" slidesPerView={3}>
547
+ <CarouselViewport>
548
+ {PRODUCTS.map((product) => (
549
+ <CarouselSlide key={product.name}>
550
+ <Card>
551
+ <CardBody>
552
+ <Heading level={2} size="sm">
553
+ {product.name}
554
+ </Heading>
555
+ <Text numeric="tabular" size="sm">
556
+ {product.price}
557
+ </Text>
558
+ <Badge tone={product.tone}>{product.stock}</Badge>
559
+ </CardBody>
560
+ </Card>
561
+ </CarouselSlide>
562
+ ))}
563
+ </CarouselViewport>
564
+ <CarouselPrevious />
565
+ <CarouselNext />
566
+ <CarouselControls>
567
+ <CarouselIndicators variant="line" />
568
+ </CarouselControls>
569
+ </Carousel>
570
+ );
571
+ }
572
+ ```
573
+
574
+ ### Past the last page
575
+
576
+ loop sends next on the last page to the first and previous on the first to the last; the track travels back rather than cloning a slide, so ids, focus and form state stay single. Without it the controls at the ends say they have nowhere to go.
577
+
578
+ Excerpt — not a complete module
579
+
580
+ ```tsx
581
+ <Carousel aria-label="Collection" loop>
582
+ …
583
+ </Carousel>;
584
+ ```
585
+
586
+ ### A page the application owns
587
+
588
+ page and onPageChange make the page the application’s; the request carries the reason — pointer, keyboard, scroll, timeout, resize, programmatic. The buttons outside the carousel move it through the same state, and the log shows each request.
589
+
590
+ Example
591
+
592
+ ```tsx
593
+ import { useState } from 'react';
594
+ import {
595
+ Carousel,
596
+ CarouselAutoplay,
597
+ CarouselControls,
598
+ CarouselIndicators,
599
+ CarouselSlide,
600
+ CarouselViewport,
601
+ } from '@slotted/react/carousel';
602
+ import type { CarouselPageRequest, CarouselPlayingRequest } from '@slotted/react/carousel';
603
+ import { Button } from '@slotted/react/button';
604
+ import { Card, CardBody } from '@slotted/react/card';
605
+ import { Inline } from '@slotted/react/inline';
606
+ import { Stack } from '@slotted/react/stack';
607
+ import { Heading, Text } from '@slotted/react/typography';
608
+
609
+ const NOTICES = [
610
+ {
611
+ title: 'Carrier cutoff moved',
612
+ body: 'The Antwerp pickup now leaves at 16:30 instead of 18:00.',
613
+ },
614
+ { title: 'Cycle count, aisle 14', body: 'Counts start Monday at 06:00 and close by noon.' },
615
+ { title: 'Dock 3 maintenance', body: 'The dock leveler is out of service until Thursday.' },
616
+ {
617
+ title: 'Peak season hires',
618
+ body: 'Twelve temporary pickers join the night shift on 3 November.',
619
+ },
620
+ ];
621
+
622
+ export default function CarouselControlledExample() {
623
+ const [page, setPage] = useState(0);
624
+ const [playing, setPlaying] = useState(false);
625
+ const [lastRequest, setLastRequest] = useState('No request yet.');
626
+
627
+ function handlePageChange(next: number, request: CarouselPageRequest) {
628
+ setPage(next);
629
+ setLastRequest(`Page ${next + 1} requested by ${request.reason}.`);
630
+ }
631
+
632
+ function handlePlayingChange(next: boolean, request: CarouselPlayingRequest) {
633
+ setPlaying(next);
634
+ setLastRequest(`Rotation ${next ? 'started' : 'stopped'} by ${request.reason}.`);
635
+ }
636
+
637
+ function handlePrevious() {
638
+ setPage((page + NOTICES.length - 1) % NOTICES.length);
639
+ }
640
+
641
+ function handleNext() {
642
+ setPage((page + 1) % NOTICES.length);
643
+ }
644
+
645
+ return (
646
+ <Stack gap={4}>
647
+ <Carousel
648
+ aria-label="Operations notices"
649
+ autoplay={4000}
650
+ loop
651
+ onPageChange={handlePageChange}
652
+ onPlayingChange={handlePlayingChange}
653
+ page={page}
654
+ playing={playing}
655
+ >
656
+ <CarouselViewport>
657
+ {NOTICES.map((notice) => (
658
+ <CarouselSlide key={notice.title}>
659
+ <Card>
660
+ <CardBody>
661
+ <Heading level={2} size="sm">
662
+ {notice.title}
663
+ </Heading>
664
+ <Text size="sm" tone="muted">
665
+ {notice.body}
666
+ </Text>
667
+ </CardBody>
668
+ </Card>
669
+ </CarouselSlide>
670
+ ))}
671
+ </CarouselViewport>
672
+ <CarouselControls>
673
+ <CarouselAutoplay />
674
+ <CarouselIndicators />
675
+ </CarouselControls>
676
+ </Carousel>
677
+ <Inline gap={2}>
678
+ <Button onClick={handlePrevious} variant="outline">
679
+ Previous notice
680
+ </Button>
681
+ <Button onClick={handleNext} variant="outline">
682
+ Next notice
683
+ </Button>
684
+ </Inline>
685
+ <Text size="sm" tone="muted">
686
+ {lastRequest}
687
+ </Text>
688
+ </Stack>
689
+ );
690
+ }
691
+ ```
692
+
693
+ ### Every control in every state
694
+
695
+ Hover lifts a round control onto the neutral hover ground, a press shrinks it to 94 percent, focus draws the ring two pixels out; at an end it keeps its place in the disabled ink. Use Tab to see the rings.
696
+
697
+ Excerpt — not a complete module
698
+
699
+ ```tsx
700
+ <CarouselControls>
701
+ <CarouselPrevious />
702
+ <CarouselIndicators />
703
+ <CarouselNext />
704
+ </CarouselControls>;
705
+ ```
706
+
707
+ ### Content Carousel does not choose
708
+
709
+ Cards of different heights stand at the height of the tallest; a long name wraps inside its card; a right-to-left page mirrors the track, the arrows and the dots, and the counter still reads first to last.
710
+
711
+ Excerpt — not a complete module
712
+
713
+ ```tsx
714
+ <div dir="rtl">
715
+ <Carousel aria-label="Gallery" slidesPerView={2}>
716
+ …
717
+ </Carousel>
718
+ </div>;
719
+ ```
720
+
721
+ ### Nothing yet, and loading
722
+
723
+ With no slide the indicators draw nothing and the counter reads 0 / 0; the empty state is a ResultState the consumer puts in the viewport. While the pieces load, skeleton slides with the same anatomy hold the height.
724
+
725
+ Example
726
+
727
+ ```tsx
728
+ import {
729
+ Carousel,
730
+ CarouselControls,
731
+ CarouselCounter,
732
+ CarouselIndicators,
733
+ CarouselNext,
734
+ CarouselPrevious,
735
+ CarouselViewport,
736
+ } from '@slotted/react/carousel';
737
+ import {
738
+ ResultState,
739
+ ResultStateContent,
740
+ ResultStateDescription,
741
+ ResultStateTitle,
742
+ } from '@slotted/react/result-state';
743
+
744
+ export default function CarouselEmptyExample() {
745
+ return (
746
+ <Carousel aria-label="Pending shipments">
747
+ <CarouselViewport>
748
+ <ResultState>
749
+ <ResultStateContent>
750
+ <ResultStateTitle>No shipments waiting</ResultStateTitle>
751
+ <ResultStateDescription>
752
+ Shipments appear here once a carrier books a pickup.
753
+ </ResultStateDescription>
754
+ </ResultStateContent>
755
+ </ResultState>
756
+ </CarouselViewport>
757
+ <CarouselPrevious />
758
+ <CarouselNext />
759
+ <CarouselControls>
760
+ <CarouselIndicators />
761
+ <CarouselCounter />
762
+ </CarouselControls>
763
+ </Carousel>
764
+ );
765
+ }
766
+ ```
767
+
768
+ ### Inside a product page
769
+
770
+ The gallery beside the buy box, as a product page lays them out: the picture and its thumbnails on the start, the name, the price and the action on the end. handleRef.scrollToSlide takes the gallery to the picture of the color chosen.
771
+
772
+ Example
773
+
774
+ ```tsx
775
+ import { useRef, useState } from 'react';
776
+ import {
777
+ Carousel,
778
+ CarouselIndicator,
779
+ CarouselIndicators,
780
+ CarouselSlide,
781
+ CarouselViewport,
782
+ } from '@slotted/react/carousel';
783
+ import type { CarouselHandle } from '@slotted/react/carousel';
784
+ import { Button } from '@slotted/react/button';
785
+ import { Image } from '@slotted/react/image';
786
+ import { Segment, SegmentedControl } from '@slotted/react/segmented-control';
787
+ import { Stack } from '@slotted/react/stack';
788
+ import { Heading, Text } from '@slotted/react/typography';
789
+
790
+ const FINISHES = [
791
+ { label: 'Graphite', value: 'graphite', src: picture('Graphite', '#374151') },
792
+ { label: 'Cobalt', value: 'cobalt', src: picture('Cobalt', '#1e3a8a') },
793
+ { label: 'Sand', value: 'sand', src: picture('Sand', '#a16207') },
794
+ ];
795
+
796
+ export default function CarouselCompositionExample() {
797
+ const gallery = useRef<CarouselHandle>(null);
798
+ const [page, setPage] = useState(0);
799
+
800
+ const finish = FINISHES[page]?.value;
801
+
802
+ function handleFinishChange(value: string) {
803
+ gallery.current?.scrollToSlide(FINISHES.findIndex((item) => item.value === value));
804
+ }
805
+
806
+ return (
807
+ <Stack gap={4}>
808
+ <Carousel
809
+ aria-label="Label printer photos"
810
+ handleRef={gallery}
811
+ onPageChange={(next) => {
812
+ setPage(next);
813
+ }}
814
+ >
815
+ <CarouselViewport>
816
+ {FINISHES.map((item) => (
817
+ <CarouselSlide key={item.value}>
818
+ <Image alt={`Label printer, ${item.label}`} ratio="landscape" src={item.src} />
819
+ </CarouselSlide>
820
+ ))}
821
+ </CarouselViewport>
822
+ <CarouselIndicators aria-label="Photos" variant="thumbnails">
823
+ {(index) => (
824
+ <CarouselIndicator key={index} page={index}>
825
+ <img alt={FINISHES[index]?.label ?? ''} src={FINISHES[index]?.src ?? ''} />
826
+ </CarouselIndicator>
827
+ )}
828
+ </CarouselIndicators>
829
+ </Carousel>
830
+ <Stack gap={1}>
831
+ <Heading level={2} size="md">
832
+ Thermal label printer
833
+ </Heading>
834
+ <Text numeric="tabular">€249.00</Text>
835
+ </Stack>
836
+ <SegmentedControl aria-label="Finish" onValueChange={handleFinishChange} value={finish}>
837
+ {FINISHES.map((item) => (
838
+ <Segment key={item.value} value={item.value}>
839
+ {item.label}
840
+ </Segment>
841
+ ))}
842
+ </SegmentedControl>
843
+ <Button>Add to order</Button>
844
+ </Stack>
845
+ );
846
+ }
847
+
848
+ function picture(name: string, color: string) {
849
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 500"><rect width="800" height="500" fill="${color}"/><text x="400" y="270" fill="#ffffff" font-family="sans-serif" font-size="56" text-anchor="middle">${name}</text></svg>`;
850
+
851
+ return `data:image/svg+xml,${encodeURIComponent(svg)}`;
852
+ }
853
+ ```
854
+
855
+ ### The keyboard
856
+
857
+ Tab reaches the rotation control, the viewport, the arrows and then one tab stop in the dots. In the viewport the arrows, PageUp, PageDown, Home and End move a page; in the dots the arrows move and show, and stop at the ends. Holding a key moves without animating.
858
+
859
+ Excerpt — not a complete module
860
+
861
+ ```tsx
862
+ <Carousel aria-label="Collection">
863
+ <CarouselViewport>{slides}</CarouselViewport>
864
+ <CarouselControls>
865
+ <CarouselIndicators />
866
+ </CarouselControls>
867
+ </Carousel>;
868
+ ```