@coinbase/cds-mcp-server 8.17.1 → 8.17.3

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 (269) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/mcp-docs/mobile/components/Accordion.txt +189 -0
  3. package/mcp-docs/mobile/components/AccordionItem.txt +30 -0
  4. package/mcp-docs/mobile/components/Alert.txt +156 -0
  5. package/mcp-docs/mobile/components/AreaChart.txt +266 -0
  6. package/mcp-docs/mobile/components/Avatar.txt +196 -0
  7. package/mcp-docs/mobile/components/AvatarButton.txt +226 -0
  8. package/mcp-docs/mobile/components/Banner.txt +222 -0
  9. package/mcp-docs/mobile/components/BarChart.txt +816 -0
  10. package/mcp-docs/mobile/components/Box.txt +174 -0
  11. package/mcp-docs/mobile/components/BrowserBar.txt +147 -0
  12. package/mcp-docs/mobile/components/Button.txt +199 -0
  13. package/mcp-docs/mobile/components/ButtonGroup.txt +80 -0
  14. package/mcp-docs/mobile/components/Carousel.txt +1084 -0
  15. package/mcp-docs/mobile/components/CartesianChart.txt +826 -0
  16. package/mcp-docs/mobile/components/CellMedia.txt +71 -0
  17. package/mcp-docs/mobile/components/Checkbox.txt +246 -0
  18. package/mcp-docs/mobile/components/CheckboxCell.txt +202 -0
  19. package/mcp-docs/mobile/components/CheckboxGroup.txt +285 -0
  20. package/mcp-docs/mobile/components/Chip.txt +195 -0
  21. package/mcp-docs/mobile/components/Coachmark.txt +158 -0
  22. package/mcp-docs/mobile/components/Collapsible.txt +105 -0
  23. package/mcp-docs/mobile/components/ContainedAssetCard.txt +135 -0
  24. package/mcp-docs/mobile/components/ContentCard.txt +366 -0
  25. package/mcp-docs/mobile/components/ContentCardBody.txt +136 -0
  26. package/mcp-docs/mobile/components/ContentCardFooter.txt +128 -0
  27. package/mcp-docs/mobile/components/ContentCardHeader.txt +146 -0
  28. package/mcp-docs/mobile/components/ContentCell.txt +227 -0
  29. package/mcp-docs/mobile/components/ControlGroup.txt +444 -0
  30. package/mcp-docs/mobile/components/DatePicker.txt +497 -0
  31. package/mcp-docs/mobile/components/Divider.txt +139 -0
  32. package/mcp-docs/mobile/components/DotCount.txt +146 -0
  33. package/mcp-docs/mobile/components/DotStatusColor.txt +59 -0
  34. package/mcp-docs/mobile/components/DotSymbol.txt +135 -0
  35. package/mcp-docs/mobile/components/Fallback.txt +158 -0
  36. package/mcp-docs/mobile/components/FloatingAssetCard.txt +156 -0
  37. package/mcp-docs/mobile/components/HStack.txt +235 -0
  38. package/mcp-docs/mobile/components/HeroSquare.txt +48 -0
  39. package/mcp-docs/mobile/components/Icon.txt +52 -0
  40. package/mcp-docs/mobile/components/IconButton.txt +269 -0
  41. package/mcp-docs/mobile/components/InputChip.txt +188 -0
  42. package/mcp-docs/mobile/components/Interactable.txt +187 -0
  43. package/mcp-docs/mobile/components/LineChart.txt +1325 -0
  44. package/mcp-docs/mobile/components/Link.txt +292 -0
  45. package/mcp-docs/mobile/components/ListCell.txt +391 -0
  46. package/mcp-docs/mobile/components/LogoMark.txt +85 -0
  47. package/mcp-docs/mobile/components/LogoWordMark.txt +94 -0
  48. package/mcp-docs/mobile/components/Lottie.txt +139 -0
  49. package/mcp-docs/mobile/components/LottieStatusAnimation.txt +47 -0
  50. package/mcp-docs/mobile/components/Modal.txt +84 -0
  51. package/mcp-docs/mobile/components/ModalBody.txt +34 -0
  52. package/mcp-docs/mobile/components/ModalFooter.txt +25 -0
  53. package/mcp-docs/mobile/components/ModalHeader.txt +28 -0
  54. package/mcp-docs/mobile/components/MultiContentModule.txt +380 -0
  55. package/mcp-docs/mobile/components/NavigationTitle.txt +132 -0
  56. package/mcp-docs/mobile/components/NavigationTitleSelect.txt +142 -0
  57. package/mcp-docs/mobile/components/NudgeCard.txt +90 -0
  58. package/mcp-docs/mobile/components/Numpad.txt +341 -0
  59. package/mcp-docs/mobile/components/Overlay.txt +152 -0
  60. package/mcp-docs/mobile/components/PageFooter.txt +161 -0
  61. package/mcp-docs/mobile/components/PageHeader.txt +186 -0
  62. package/mcp-docs/mobile/components/PeriodSelector.txt +408 -0
  63. package/mcp-docs/mobile/components/Pictogram.txt +48 -0
  64. package/mcp-docs/mobile/components/Point.txt +205 -0
  65. package/mcp-docs/mobile/components/PortalProvider.txt +79 -0
  66. package/mcp-docs/mobile/components/Pressable.txt +211 -0
  67. package/mcp-docs/mobile/components/ProgressBar.txt +130 -0
  68. package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +161 -0
  69. package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +138 -0
  70. package/mcp-docs/mobile/components/ProgressCircle.txt +237 -0
  71. package/mcp-docs/mobile/components/Radio.txt +242 -0
  72. package/mcp-docs/mobile/components/RadioCell.txt +202 -0
  73. package/mcp-docs/mobile/components/RadioGroup.txt +282 -0
  74. package/mcp-docs/mobile/components/ReferenceLine.txt +153 -0
  75. package/mcp-docs/mobile/components/RemoteImage.txt +106 -0
  76. package/mcp-docs/mobile/components/RemoteImageGroup.txt +61 -0
  77. package/mcp-docs/mobile/components/RollingNumber.txt +789 -0
  78. package/mcp-docs/mobile/components/Scrubber.txt +204 -0
  79. package/mcp-docs/mobile/components/SearchInput.txt +192 -0
  80. package/mcp-docs/mobile/components/SectionHeader.txt +205 -0
  81. package/mcp-docs/mobile/components/SegmentedTabs.txt +316 -0
  82. package/mcp-docs/mobile/components/Select.txt +212 -0
  83. package/mcp-docs/mobile/components/SelectChip.txt +324 -0
  84. package/mcp-docs/mobile/components/SelectOption.txt +85 -0
  85. package/mcp-docs/mobile/components/SlideButton.txt +331 -0
  86. package/mcp-docs/mobile/components/Spacer.txt +84 -0
  87. package/mcp-docs/mobile/components/Sparkline.txt +123 -0
  88. package/mcp-docs/mobile/components/SparklineGradient.txt +107 -0
  89. package/mcp-docs/mobile/components/SparklineInteractive.txt +157 -0
  90. package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +73 -0
  91. package/mcp-docs/mobile/components/Spinner.txt +49 -0
  92. package/mcp-docs/mobile/components/SpotIcon.txt +48 -0
  93. package/mcp-docs/mobile/components/SpotRectangle.txt +48 -0
  94. package/mcp-docs/mobile/components/SpotSquare.txt +48 -0
  95. package/mcp-docs/mobile/components/Stepper.txt +528 -0
  96. package/mcp-docs/mobile/components/SubBrandLogoMark.txt +126 -0
  97. package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +126 -0
  98. package/mcp-docs/mobile/components/Switch.txt +98 -0
  99. package/mcp-docs/mobile/components/TabIndicator.txt +49 -0
  100. package/mcp-docs/mobile/components/TabLabel.txt +154 -0
  101. package/mcp-docs/mobile/components/TabNavigation.txt +147 -0
  102. package/mcp-docs/mobile/components/TabbedChips.txt +143 -0
  103. package/mcp-docs/mobile/components/Tabs.txt +191 -0
  104. package/mcp-docs/mobile/components/Tag.txt +301 -0
  105. package/mcp-docs/mobile/components/Text.txt +212 -0
  106. package/mcp-docs/mobile/components/TextInput.txt +718 -0
  107. package/mcp-docs/mobile/components/ThemeProvider.txt +133 -0
  108. package/mcp-docs/mobile/components/Toast.txt +197 -0
  109. package/mcp-docs/mobile/components/Tooltip.txt +60 -0
  110. package/mcp-docs/mobile/components/TopNavBar.txt +162 -0
  111. package/mcp-docs/mobile/components/Tour.txt +159 -0
  112. package/mcp-docs/mobile/components/Tray.txt +253 -0
  113. package/mcp-docs/mobile/components/UpsellCard.txt +322 -0
  114. package/mcp-docs/mobile/components/VStack.txt +223 -0
  115. package/mcp-docs/mobile/components/XAxis.txt +622 -0
  116. package/mcp-docs/mobile/components/YAxis.txt +568 -0
  117. package/mcp-docs/mobile/getting-started/introduction.txt +99 -0
  118. package/mcp-docs/mobile/getting-started/mcp-server.txt +94 -0
  119. package/mcp-docs/mobile/getting-started/playground.txt +25 -0
  120. package/mcp-docs/mobile/hooks/useDimensions.txt +47 -0
  121. package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +215 -0
  122. package/mcp-docs/mobile/hooks/useTheme.txt +110 -0
  123. package/mcp-docs/mobile/routes.txt +132 -0
  124. package/mcp-docs/web/components/Accordion.txt +190 -0
  125. package/mcp-docs/web/components/AccordionItem.txt +32 -0
  126. package/mcp-docs/web/components/Alert.txt +165 -0
  127. package/mcp-docs/web/components/AreaChart.txt +511 -0
  128. package/mcp-docs/web/components/Avatar.txt +212 -0
  129. package/mcp-docs/web/components/AvatarButton.txt +241 -0
  130. package/mcp-docs/web/components/Banner.txt +227 -0
  131. package/mcp-docs/web/components/BarChart.txt +1268 -0
  132. package/mcp-docs/web/components/Box.txt +176 -0
  133. package/mcp-docs/web/components/Button.txt +213 -0
  134. package/mcp-docs/web/components/ButtonGroup.txt +80 -0
  135. package/mcp-docs/web/components/Calendar.txt +182 -0
  136. package/mcp-docs/web/components/Carousel.txt +1576 -0
  137. package/mcp-docs/web/components/CartesianChart.txt +1045 -0
  138. package/mcp-docs/web/components/CellMedia.txt +57 -0
  139. package/mcp-docs/web/components/Checkbox.txt +189 -0
  140. package/mcp-docs/web/components/CheckboxCell.txt +203 -0
  141. package/mcp-docs/web/components/CheckboxGroup.txt +220 -0
  142. package/mcp-docs/web/components/Chip.txt +197 -0
  143. package/mcp-docs/web/components/Coachmark.txt +189 -0
  144. package/mcp-docs/web/components/Collapsible.txt +120 -0
  145. package/mcp-docs/web/components/ContainedAssetCard.txt +233 -0
  146. package/mcp-docs/web/components/ContentCard.txt +368 -0
  147. package/mcp-docs/web/components/ContentCardBody.txt +138 -0
  148. package/mcp-docs/web/components/ContentCardFooter.txt +130 -0
  149. package/mcp-docs/web/components/ContentCardHeader.txt +148 -0
  150. package/mcp-docs/web/components/ContentCell.txt +220 -0
  151. package/mcp-docs/web/components/ControlGroup.txt +437 -0
  152. package/mcp-docs/web/components/DatePicker.txt +506 -0
  153. package/mcp-docs/web/components/Divider.txt +144 -0
  154. package/mcp-docs/web/components/DotCount.txt +150 -0
  155. package/mcp-docs/web/components/DotStatusColor.txt +59 -0
  156. package/mcp-docs/web/components/DotSymbol.txt +138 -0
  157. package/mcp-docs/web/components/Dropdown.txt +120 -0
  158. package/mcp-docs/web/components/Fallback.txt +164 -0
  159. package/mcp-docs/web/components/FloatingAssetCard.txt +251 -0
  160. package/mcp-docs/web/components/FullscreenAlert.txt +70 -0
  161. package/mcp-docs/web/components/FullscreenModal.txt +146 -0
  162. package/mcp-docs/web/components/FullscreenModalLayout.txt +188 -0
  163. package/mcp-docs/web/components/Grid.txt +237 -0
  164. package/mcp-docs/web/components/GridColumn.txt +210 -0
  165. package/mcp-docs/web/components/HStack.txt +237 -0
  166. package/mcp-docs/web/components/HeroSquare.txt +49 -0
  167. package/mcp-docs/web/components/Icon.txt +146 -0
  168. package/mcp-docs/web/components/IconButton.txt +391 -0
  169. package/mcp-docs/web/components/InputChip.txt +188 -0
  170. package/mcp-docs/web/components/Interactable.txt +194 -0
  171. package/mcp-docs/web/components/LineChart.txt +1577 -0
  172. package/mcp-docs/web/components/Link.txt +244 -0
  173. package/mcp-docs/web/components/ListCell.txt +397 -0
  174. package/mcp-docs/web/components/LogoMark.txt +85 -0
  175. package/mcp-docs/web/components/LogoWordMark.txt +94 -0
  176. package/mcp-docs/web/components/Lottie.txt +158 -0
  177. package/mcp-docs/web/components/LottieStatusAnimation.txt +58 -0
  178. package/mcp-docs/web/components/MediaQueryProvider.txt +109 -0
  179. package/mcp-docs/web/components/Modal.txt +193 -0
  180. package/mcp-docs/web/components/ModalBody.txt +118 -0
  181. package/mcp-docs/web/components/ModalFooter.txt +120 -0
  182. package/mcp-docs/web/components/ModalHeader.txt +124 -0
  183. package/mcp-docs/web/components/MultiContentModule.txt +382 -0
  184. package/mcp-docs/web/components/NavigationBar.txt +103 -0
  185. package/mcp-docs/web/components/NavigationTitle.txt +26 -0
  186. package/mcp-docs/web/components/NavigationTitleSelect.txt +46 -0
  187. package/mcp-docs/web/components/NudgeCard.txt +182 -0
  188. package/mcp-docs/web/components/Overlay.txt +172 -0
  189. package/mcp-docs/web/components/PageFooter.txt +185 -0
  190. package/mcp-docs/web/components/PageHeader.txt +244 -0
  191. package/mcp-docs/web/components/Pagination.txt +500 -0
  192. package/mcp-docs/web/components/PeriodSelector.txt +704 -0
  193. package/mcp-docs/web/components/Pictogram.txt +49 -0
  194. package/mcp-docs/web/components/Point.txt +461 -0
  195. package/mcp-docs/web/components/PortalProvider.txt +77 -0
  196. package/mcp-docs/web/components/Pressable.txt +194 -0
  197. package/mcp-docs/web/components/ProgressBar.txt +164 -0
  198. package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +213 -0
  199. package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +182 -0
  200. package/mcp-docs/web/components/ProgressCircle.txt +444 -0
  201. package/mcp-docs/web/components/Radio.txt +220 -0
  202. package/mcp-docs/web/components/RadioCell.txt +216 -0
  203. package/mcp-docs/web/components/RadioGroup.txt +289 -0
  204. package/mcp-docs/web/components/ReferenceLine.txt +452 -0
  205. package/mcp-docs/web/components/RemoteImage.txt +166 -0
  206. package/mcp-docs/web/components/RemoteImageGroup.txt +87 -0
  207. package/mcp-docs/web/components/RollingNumber.txt +1022 -0
  208. package/mcp-docs/web/components/Scrubber.txt +232 -0
  209. package/mcp-docs/web/components/SearchInput.txt +118 -0
  210. package/mcp-docs/web/components/SectionHeader.txt +218 -0
  211. package/mcp-docs/web/components/SegmentedTabs.txt +325 -0
  212. package/mcp-docs/web/components/Select.txt +225 -0
  213. package/mcp-docs/web/components/SelectChip.txt +315 -0
  214. package/mcp-docs/web/components/SelectOption.txt +166 -0
  215. package/mcp-docs/web/components/Sidebar.txt +350 -0
  216. package/mcp-docs/web/components/SidebarItem.txt +132 -0
  217. package/mcp-docs/web/components/SidebarMoreMenu.txt +31 -0
  218. package/mcp-docs/web/components/Spacer.txt +174 -0
  219. package/mcp-docs/web/components/Sparkline.txt +123 -0
  220. package/mcp-docs/web/components/SparklineGradient.txt +107 -0
  221. package/mcp-docs/web/components/SparklineInteractive.txt +154 -0
  222. package/mcp-docs/web/components/SparklineInteractiveHeader.txt +77 -0
  223. package/mcp-docs/web/components/Spinner.txt +129 -0
  224. package/mcp-docs/web/components/SpotIcon.txt +49 -0
  225. package/mcp-docs/web/components/SpotRectangle.txt +49 -0
  226. package/mcp-docs/web/components/SpotSquare.txt +49 -0
  227. package/mcp-docs/web/components/Stepper.txt +683 -0
  228. package/mcp-docs/web/components/SubBrandLogoMark.txt +126 -0
  229. package/mcp-docs/web/components/SubBrandLogoWordMark.txt +126 -0
  230. package/mcp-docs/web/components/Switch.txt +86 -0
  231. package/mcp-docs/web/components/TabIndicator.txt +49 -0
  232. package/mcp-docs/web/components/TabLabel.txt +159 -0
  233. package/mcp-docs/web/components/TabNavigation.txt +160 -0
  234. package/mcp-docs/web/components/TabbedChips.txt +156 -0
  235. package/mcp-docs/web/components/Table.txt +368 -0
  236. package/mcp-docs/web/components/TableBody.txt +84 -0
  237. package/mcp-docs/web/components/TableCaption.txt +103 -0
  238. package/mcp-docs/web/components/TableCell.txt +166 -0
  239. package/mcp-docs/web/components/TableCellFallback.txt +98 -0
  240. package/mcp-docs/web/components/TableFooter.txt +84 -0
  241. package/mcp-docs/web/components/TableHeader.txt +101 -0
  242. package/mcp-docs/web/components/TableRow.txt +141 -0
  243. package/mcp-docs/web/components/Tabs.txt +213 -0
  244. package/mcp-docs/web/components/Tag.txt +305 -0
  245. package/mcp-docs/web/components/Text.txt +233 -0
  246. package/mcp-docs/web/components/TextInput.txt +653 -0
  247. package/mcp-docs/web/components/ThemeProvider.txt +200 -0
  248. package/mcp-docs/web/components/TileButton.txt +159 -0
  249. package/mcp-docs/web/components/Toast.txt +204 -0
  250. package/mcp-docs/web/components/Tooltip.txt +90 -0
  251. package/mcp-docs/web/components/Tour.txt +180 -0
  252. package/mcp-docs/web/components/Tray.txt +289 -0
  253. package/mcp-docs/web/components/UpsellCard.txt +320 -0
  254. package/mcp-docs/web/components/VStack.txt +225 -0
  255. package/mcp-docs/web/components/XAxis.txt +620 -0
  256. package/mcp-docs/web/components/YAxis.txt +549 -0
  257. package/mcp-docs/web/getting-started/introduction.txt +99 -0
  258. package/mcp-docs/web/getting-started/mcp-server.txt +94 -0
  259. package/mcp-docs/web/getting-started/playground.txt +25 -0
  260. package/mcp-docs/web/hooks/useBreakpoints.txt +33 -0
  261. package/mcp-docs/web/hooks/useDimensions.txt +55 -0
  262. package/mcp-docs/web/hooks/useHasMounted.txt +55 -0
  263. package/mcp-docs/web/hooks/useIsoEffect.txt +42 -0
  264. package/mcp-docs/web/hooks/useMediaQuery.txt +94 -0
  265. package/mcp-docs/web/hooks/useOverlayContentContext.txt +217 -0
  266. package/mcp-docs/web/hooks/useScrollBlocker.txt +63 -0
  267. package/mcp-docs/web/hooks/useTheme.txt +105 -0
  268. package/mcp-docs/web/routes.txt +155 -0
  269. package/package.json +1 -1
@@ -0,0 +1,1084 @@
1
+ # Carousel
2
+
3
+ A flexible carousel component for displaying sequences of content with navigation and pagination options.
4
+
5
+ ## Import
6
+
7
+ ```jsx
8
+ import { Carousel } from '@coinbase/cds-mobile/carousel/Carousel'
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Required | Default | Description |
14
+ | --- | --- | --- | --- | --- |
15
+ | `NavigationComponent` | `CarouselNavigationComponent` | No | `DefaultCarouselNavigation` | Custom component to render navigation arrows. |
16
+ | `PaginationComponent` | `CarouselPaginationComponent` | No | `DefaultCarouselPagination` | Custom component to render pagination indicators. |
17
+ | `alignContent` | `flex-start \| flex-end \| center \| stretch \| space-between \| space-around \| space-evenly` | No | `-` | - |
18
+ | `alignItems` | `flex-start \| flex-end \| center \| stretch \| baseline` | No | `-` | - |
19
+ | `alignSelf` | `auto \| FlexAlignType` | No | `-` | - |
20
+ | `animated` | `boolean` | No | `-` | - |
21
+ | `aspectRatio` | `string \| number` | No | `-` | - |
22
+ | `background` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
23
+ | `borderBottomLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
24
+ | `borderBottomRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
25
+ | `borderBottomWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
26
+ | `borderColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
27
+ | `borderEndWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
28
+ | `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
29
+ | `borderStartWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
30
+ | `borderTopLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
31
+ | `borderTopRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
32
+ | `borderTopWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
33
+ | `borderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
34
+ | `bordered` | `boolean` | No | `-` | Add a border around all sides of the box. |
35
+ | `borderedBottom` | `boolean` | No | `-` | Add a border to the bottom side of the box. |
36
+ | `borderedEnd` | `boolean` | No | `-` | Add a border to the trailing side of the box. |
37
+ | `borderedHorizontal` | `boolean` | No | `-` | Add a border to the leading and trailing sides of the box. |
38
+ | `borderedStart` | `boolean` | No | `-` | Add a border to the leading side of the box. |
39
+ | `borderedTop` | `boolean` | No | `-` | Add a border to the top side of the box. |
40
+ | `borderedVertical` | `boolean` | No | `-` | Add a border to the top and bottom sides of the box. |
41
+ | `bottom` | `string \| number` | No | `-` | - |
42
+ | `children` | `((string \| number \| boolean \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal \| null) & (CarouselItemElement \| CarouselItemElement[]))` | No | `-` | Children are required to be CarouselItems because we calculate their offset relative to the parent container. |
43
+ | `color` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
44
+ | `columnGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
45
+ | `dangerouslySetBackground` | `string` | No | `-` | - |
46
+ | `display` | `flex \| none` | No | `-` | - |
47
+ | `drag` | `none \| free \| snap` | No | `'snap'` | Defines the drag interaction behavior for the carousel. none disables dragging completely. free enables free-form dragging with natural deceleration when released. snap enables dragging with automatic snapping to targets when released, defined by snapMode. |
48
+ | `elevation` | `0 \| 1 \| 2` | No | `-` | Determines box shadow styles. Parent should have overflow set to visible to ensure styles are not clipped. |
49
+ | `flexBasis` | `string \| number` | No | `-` | - |
50
+ | `flexDirection` | `row \| column \| row-reverse \| column-reverse` | No | `-` | - |
51
+ | `flexGrow` | `number` | No | `-` | - |
52
+ | `flexShrink` | `number` | No | `-` | - |
53
+ | `flexWrap` | `wrap \| nowrap \| wrap-reverse` | No | `-` | - |
54
+ | `font` | `inherit \| FontFamily` | No | `-` | - |
55
+ | `fontFamily` | `inherit \| FontFamily` | No | `-` | - |
56
+ | `fontSize` | `inherit \| FontSize` | No | `-` | - |
57
+ | `fontWeight` | `inherit \| FontWeight` | No | `-` | - |
58
+ | `gap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
59
+ | `goToPageAccessibilityLabel` | `string` | No | `-` | Accessibility label for the go to page button. |
60
+ | `height` | `string \| number` | No | `-` | - |
61
+ | `hideNavigation` | `boolean` | No | `-` | Hides the navigation arrows (previous/next buttons). |
62
+ | `hidePagination` | `boolean` | No | `-` | Hides the pagination indicators (dots/bars showing current page). |
63
+ | `justifyContent` | `flex-start \| flex-end \| center \| space-between \| space-around \| space-evenly` | No | `-` | - |
64
+ | `key` | `Key \| null` | No | `-` | - |
65
+ | `left` | `string \| number` | No | `-` | - |
66
+ | `lineHeight` | `inherit \| LineHeight` | No | `-` | - |
67
+ | `margin` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
68
+ | `marginBottom` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
69
+ | `marginEnd` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
70
+ | `marginStart` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
71
+ | `marginTop` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
72
+ | `marginX` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
73
+ | `marginY` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
74
+ | `maxHeight` | `string \| number` | No | `-` | - |
75
+ | `maxWidth` | `string \| number` | No | `-` | - |
76
+ | `minHeight` | `string \| number` | No | `-` | - |
77
+ | `minWidth` | `string \| number` | No | `-` | - |
78
+ | `nextPageAccessibilityLabel` | `string` | No | `-` | Accessibility label for the next page button. |
79
+ | `onChangePage` | `((activePageIndex: number) => void)` | No | `-` | Callback fired when the page changes. |
80
+ | `onDragEnd` | `(() => void)` | No | `-` | Callback fired when the user ends dragging the carousel. |
81
+ | `onDragStart` | `(() => void)` | No | `-` | Callback fired when the user starts dragging the carousel. |
82
+ | `opacity` | `number \| AnimatedNode` | No | `-` | - |
83
+ | `overflow` | `visible \| hidden \| scroll` | No | `-` | - |
84
+ | `padding` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
85
+ | `paddingBottom` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
86
+ | `paddingEnd` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
87
+ | `paddingStart` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
88
+ | `paddingTop` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
89
+ | `paddingX` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
90
+ | `paddingY` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
91
+ | `paginationAccessibilityLabel` | `string \| ((pageIndex: number) => string)` | No | `-` | Accessibility label for the go to page button. |
92
+ | `pin` | `top \| bottom \| left \| right \| all` | No | `-` | Direction in which to absolutely pin the box. |
93
+ | `position` | `absolute \| relative \| static \| fixed \| sticky` | No | `-` | - |
94
+ | `previousPageAccessibilityLabel` | `string` | No | `-` | Accessibility label for the previous page button. |
95
+ | `ref` | `((instance: CarouselImperativeHandle \| null) => void) \| RefObject<CarouselImperativeHandle> \| null` | No | `-` | - |
96
+ | `right` | `string \| number` | No | `-` | - |
97
+ | `rowGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
98
+ | `snapMode` | `item \| page` | No | `'page'` | Specifies the pagination and navigation strategy for the carousel. item treats each item as a separate page for navigation, pagination, and snapping. page groups items into pages based on visible area for navigation, pagination, and snapping. This affects page calculation, navigation button behavior, and snap targets when dragging. |
99
+ | `style` | `((false \| RegisteredStyle<ViewStyle> \| Value \| AnimatedInterpolation<string \| number> \| WithAnimatedObject<ViewStyle> \| WithAnimatedArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>> \| readonly (Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>)[]>) & (false \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>>)) \| null` | No | `-` | Custom styles for the root element. |
100
+ | `styles` | `{ root?: StyleProp<ViewStyle>; title?: StyleProp<TextStyle>; navigation?: StyleProp<ViewStyle>; pagination?: StyleProp<ViewStyle>; carousel?: StyleProp<ViewStyle>; carouselContainer?: StyleProp<ViewStyle>; }` | No | `-` | Custom styles for the component. |
101
+ | `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID Used to locate this element in unit and end-to-end tests. |
102
+ | `textAlign` | `left \| right \| auto \| center \| justify` | No | `-` | - |
103
+ | `textDecorationLine` | `none \| underline \| line-through \| underline line-through` | No | `-` | - |
104
+ | `textDecorationStyle` | `solid \| dotted \| dashed \| double` | No | `-` | - |
105
+ | `textTransform` | `none \| capitalize \| uppercase \| lowercase` | No | `-` | - |
106
+ | `title` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Title to display above the carousel. When a string is provided, it will be rendered with default title styling. When a React element is provided, it completely replaces the default title component and styling. |
107
+ | `top` | `string \| number` | No | `-` | - |
108
+ | `transform` | `string \| (({ scaleX: AnimatableNumericValue; } & { scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ scaleY: AnimatableNumericValue; } & { scaleX?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ translateX: AnimatableNumericValue \| ${number}%; } & { scaleX?: undefined; scaleY?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ translateY: AnimatableNumericValue \| ${number}%; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ perspective: AnimatableNumericValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotate: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateX: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateY: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateZ: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ scale: AnimatableNumericValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ skewX: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ skewY: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; matrix?: undefined; }) \| ({ matrix: AnimatableNumericValue[]; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; }))[]` | No | `-` | - |
109
+ | `userSelect` | `none \| auto \| contain \| text \| all` | No | `-` | - |
110
+ | `width` | `string \| number` | No | `-` | - |
111
+ | `zIndex` | `number` | No | `-` | - |
112
+
113
+
114
+ ## Examples
115
+
116
+ ### Basic Example
117
+
118
+ Carousels are a great way to showcase a list of items in a compact and engaging way.
119
+ By default, Carousels have navigation and pagination enabled.
120
+ You can also add a title to the Carousel by setting `title` prop.
121
+
122
+ You simply wrap each child in a `CarouselItem` component, and can optionally set the `width` prop to control the width of the item.
123
+
124
+ You can also set the `styles` prop to control the styles of the carousel, such as the gap between items.
125
+
126
+ ```jsx
127
+ function MyCarousel() {
128
+ const theme = useTheme();
129
+ return (
130
+ <Carousel
131
+ hidePagination
132
+ title="Explore Assets"
133
+ styles={{
134
+ root: { paddingInline: theme.space[2] },
135
+ carousel: { gap: theme.space[1] },
136
+ }}
137
+ >
138
+ {Object.values(assets).map((asset, index) => (
139
+ <CarouselItem key={asset.symbol} id={asset.symbol}>
140
+ <SquareAssetCard imageUrl={asset.imageUrl} name={asset.symbol} />
141
+ </CarouselItem>
142
+ ))}
143
+ </Carousel>
144
+ );
145
+ }
146
+ ```
147
+
148
+ ### Item Sizing
149
+
150
+ Items by default take their natural width while in the carousel, such as from our example above.
151
+ However, you can set the `width` prop of `CarouselItem` to control the width of the item.
152
+
153
+ #### Dynamic Sizing
154
+
155
+ Items can be given a width proportional to the carousel width.
156
+
157
+ :::tip Tip
158
+
159
+ If you have a gap between items or padding between the carousel and the edge of the screen,
160
+ you should account for that in the width. For example, if you have a gap of 8px,
161
+ and want to offset 16px from edge of screen, you could do
162
+
163
+ `<CarouselItem width={((screenWidth - (16 * 2)) - 8) / 2} ... />`
164
+
165
+ :::
166
+
167
+ ```jsx
168
+ function DynamicSizingCarousel() {
169
+ const theme = useTheme();
170
+ const windowWidth = Dimensions.get('window').width;
171
+
172
+ const horizontalPadding = theme.space[2];
173
+
174
+ const carouselWidth = windowWidth - horizontalPadding * 2;
175
+ const horizontalGap = theme.space[1];
176
+
177
+ // 1 item per page - will rely on Carousel container's width
178
+ const oneItemWidth = '100%'; // Could alternatively use carouselWidth
179
+ // 2 items per page - will be calculated based on screen width
180
+ const twoItemsWidth = (carouselWidth - horizontalGap) / 2;
181
+ // 3 items per page - will be calculated based on screen width
182
+ const threeItemsWidth = (carouselWidth - horizontalGap * 2) / 3;
183
+
184
+ return (
185
+ <Carousel
186
+ hidePagination
187
+ title="Learn more"
188
+ styles={{
189
+ root: { paddingInline: horizontalPadding },
190
+ carousel: { gap: horizontalGap },
191
+ }}
192
+ >
193
+ <CarouselItem id="recurring-buy" width={twoItemsWidth}>
194
+ <UpsellCard
195
+ action="Get started"
196
+ description="Want to add funds to your card every week or month?"
197
+ media={
198
+ <Box bottom={6} position="relative" right={24}>
199
+ <Pictogram dimension="64x64" name="recurringPurchases" />
200
+ </Box>
201
+ }
202
+ minWidth="0"
203
+ onActionPress={NoopFn}
204
+ title="Recurring Buy"
205
+ width="100%"
206
+ />
207
+ </CarouselItem>
208
+ <CarouselItem id="eths-apr" width={twoItemsWidth}>
209
+ <UpsellCard
210
+ action="Start earning"
211
+ dangerouslySetBackground="rgb(var(--purple70))"
212
+ description={
213
+ <TextLabel2 as="p" numberOfLines={3} color="fgInverse">
214
+ Earn staking rewards on ETH by holding it on Coinbase
215
+ </TextLabel2>
216
+ }
217
+ media={
218
+ <Box left={16} position="relative" top={12}>
219
+ <RemoteImage height={174} source="/img/feature.png" />
220
+ </Box>
221
+ }
222
+ minWidth="0"
223
+ onActionPress={NoopFn}
224
+ title={
225
+ <TextHeadline color="fgInverse" as="h3">
226
+ Up to 3.29% APR on ETHs
227
+ </TextHeadline>
228
+ }
229
+ width="100%"
230
+ />
231
+ </CarouselItem>
232
+ </Carousel>
233
+ );
234
+ }
235
+ ```
236
+
237
+ #### Responsive Sizing
238
+
239
+ You can also use responsive props to change the number of items visible based on the carousel width.
240
+ The carousel below will show per page 1 item on mobile, 2 items on tablet, and 3 items on desktop (based on screen width).
241
+
242
+ ```jsx
243
+ function ResponsiveSizingCarousel() {
244
+ const theme = useTheme();
245
+ const windowWidth = Dimensions.get('window').width;
246
+
247
+ const horizontalPadding = theme.space[2];
248
+
249
+ const carouselWidth = windowWidth - horizontalPadding * 2;
250
+ const horizontalGap = theme.space[1];
251
+
252
+ // 1 item per page - will rely on Carousel container's width
253
+ const oneItemWidth = '100%'; // Could alternatively use carouselWidth
254
+ // 2 items per page - will be calculated based on screen width
255
+ const twoItemsWidth = (carouselWidth - horizontalGap) / 2;
256
+ // 3 items per page - will be calculated based on screen width
257
+ const threeItemsWidth = (carouselWidth - horizontalGap * 2) / 3;
258
+
259
+ const itemWidth = {
260
+ phone: oneItemWidth,
261
+ tablet: twoItemsWidth,
262
+ desktop: threeItemsWidth,
263
+ };
264
+
265
+ return (
266
+ <Carousel
267
+ hidePagination
268
+ title="Learn more"
269
+ styles={{
270
+ root: { paddingInline: horizontalPadding },
271
+ carousel: { gap: horizontalGap },
272
+ }}
273
+ drag="free"
274
+ >
275
+ <CarouselItem id="earn-more-crypto" width={itemWidth}>
276
+ <NudgeCard
277
+ title="Earn more crypto"
278
+ description="You've got unstaked crypto."
279
+ pictogram="key"
280
+ action="Start earning"
281
+ onActionPress={() => console.log('Action pressed')}
282
+ width="100%"
283
+ minWidth={0}
284
+ />
285
+ </CarouselItem>
286
+ <CarouselItem id="secure-your-account" width={itemWidth}>
287
+ <NudgeCard
288
+ title="Secure your account"
289
+ description="Add two-factor authentication."
290
+ pictogram="shield"
291
+ action="Enable 2FA"
292
+ onActionPress={() => console.log('Enable 2FA pressed')}
293
+ width="100%"
294
+ minWidth={0}
295
+ />
296
+ </CarouselItem>
297
+ <CarouselItem id="complete-your-profile" width={itemWidth}>
298
+ <NudgeCard
299
+ title="Complete your profile"
300
+ description="Add more details."
301
+ pictogram="accountsNavigation"
302
+ action="Update"
303
+ onActionPress={() => console.log('Update profile pressed')}
304
+ width="100%"
305
+ minWidth={0}
306
+ />
307
+ </CarouselItem>
308
+ </Carousel>
309
+ );
310
+ }
311
+ ```
312
+
313
+ #### Varied Sizing
314
+
315
+ Not all carousel items need to be the same size. You can provide CarouselItems of varying widths as well.
316
+
317
+ ```jsx
318
+ function VariedSizingCarousel() {
319
+ const theme = useTheme();
320
+ const windowWidth = Dimensions.get('window').width;
321
+
322
+ const horizontalPadding = theme.space[2];
323
+
324
+ const carouselWidth = windowWidth - horizontalPadding * 2;
325
+ const horizontalGap = theme.space[1];
326
+
327
+ // 1 item per page - will rely on Carousel container's width
328
+ const oneItemWidth = '100%'; // Could alternatively use carouselWidth
329
+ // 2 items per page - will be calculated based on screen width
330
+ const twoItemsWidth = (carouselWidth - horizontalGap) / 2;
331
+ // 3 items per page - will be calculated based on screen width
332
+ const threeItemsWidth = (carouselWidth - horizontalGap * 2) / 3;
333
+
334
+ const itemWidth = {
335
+ phone: oneItemWidth,
336
+ tablet: twoItemsWidth,
337
+ desktop: threeItemsWidth,
338
+ };
339
+
340
+ return (
341
+ <Carousel
342
+ hidePagination
343
+ title="Varied Sizing"
344
+ styles={{
345
+ root: { paddingInline: horizontalPadding },
346
+ carousel: { gap: horizontalGap },
347
+ }}
348
+ >
349
+ <CarouselItem id="earn-more-crypto" width={itemWidth}>
350
+ <NudgeCard
351
+ title="Earn more crypto"
352
+ description="You've got unstaked crypto. Stake it now to earn more."
353
+ pictogram="key"
354
+ action="Start earning"
355
+ onActionPress={() => console.log('Action pressed')}
356
+ width="100%"
357
+ minWidth={0}
358
+ />
359
+ </CarouselItem>
360
+ <CarouselItem id="btc">
361
+ <SquareAssetCard imageUrl={assets.btc.imageUrl} name="BTC" />
362
+ </CarouselItem>
363
+ <CarouselItem id="secure-your-account" width={itemWidth}>
364
+ <NudgeCard
365
+ title="Secure your account"
366
+ description="Add two-factor authentication for enhanced security."
367
+ pictogram="shield"
368
+ action="Enable 2FA"
369
+ onActionPress={() => console.log('Enable 2FA pressed')}
370
+ width="100%"
371
+ minWidth={0}
372
+ />
373
+ </CarouselItem>
374
+ <CarouselItem id="eth">
375
+ <SquareAssetCard imageUrl={assets.eth.imageUrl} name="ETH" />
376
+ </CarouselItem>
377
+ <CarouselItem id="complete-your-profile" width={itemWidth}>
378
+ <NudgeCard
379
+ title="Complete your profile"
380
+ description="Add more details to personalize your experience."
381
+ pictogram="accountsNavigation"
382
+ action="Update profile"
383
+ onActionPress={() => console.log('Update profile pressed')}
384
+ width="100%"
385
+ minWidth={0}
386
+ />
387
+ </CarouselItem>
388
+ <CarouselItem id="ltc">
389
+ <SquareAssetCard imageUrl={assets.ltc.imageUrl} name="LTC" />
390
+ </CarouselItem>
391
+ </Carousel>
392
+ );
393
+ }
394
+ ```
395
+
396
+ ### Drag
397
+
398
+ You can set the `drag` prop to `snap` (default), `free`, or `none`.
399
+ When set to `snap`, upon release the carousel will snap to either the nearest item or page (depending on `snapMode`).
400
+
401
+ ```jsx
402
+ function DragCarousel() {
403
+ return (
404
+ <Carousel
405
+ title="Explore Assets"
406
+ hidePagination
407
+ drag="free"
408
+ styles={{
409
+ root: { paddingInline: horizontalPadding },
410
+ carousel: { gap: horizontalGap },
411
+ }}
412
+ snapMode="item"
413
+ >
414
+ {Object.values(assets).map((asset, index) => (
415
+ <CarouselItem key={asset.symbol} id={asset.symbol}>
416
+ <SquareAssetCard imageUrl={asset.imageUrl} name={asset.symbol} />
417
+ </CarouselItem>
418
+ ))}
419
+ </Carousel>
420
+ );
421
+ }
422
+ ```
423
+
424
+ ### Snap Mode
425
+
426
+ You can set the `snapMode` to `page` (default) or `item`.
427
+ When set to `page`, the carousel will automatically group items into pages.
428
+ When set to `item`, the carousel will snap to the nearest item.
429
+
430
+ ```jsx
431
+ function SquareItemsCarousel() {
432
+ return (
433
+ <Carousel
434
+ title="Explore Assets"
435
+ styles={{
436
+ root: { paddingInline: horizontalPadding },
437
+ carousel: { gap: horizontalGap },
438
+ }}
439
+ snapMode="item"
440
+ >
441
+ {Object.values(assets).map((asset, index) => (
442
+ <CarouselItem key={asset.symbol} id={asset.symbol}>
443
+ <SquareAssetCard imageUrl={asset.imageUrl} name={asset.symbol} />
444
+ </CarouselItem>
445
+ ))}
446
+ </Carousel>
447
+ );
448
+ }
449
+ ```
450
+
451
+ ### Overflow
452
+
453
+ By default, the carousel's inner overflow is visible.
454
+ This means that you can apply padding to the inner carousel element
455
+ (such as `styles={{ carousel: { paddingInline: theme.space[2] } }}`) and it will not be clipped.
456
+ You can pair this with modifying the spacing of the inner carousel to match
457
+ the padding of your page (along with a wrapping div to negate any default spacing).
458
+ This creates a seamless experience.
459
+
460
+ :::tip Tip
461
+
462
+ If you want to have the next item be shown at the edge of the screen, make sure your carousel padding is larger than your gap.
463
+
464
+ :::
465
+
466
+ ```jsx
467
+ function OverflowCarousel() {
468
+ return (
469
+ <Carousel
470
+ title="Explore Assets"
471
+ snapMode="item"
472
+ styles={{
473
+ root: { paddingInline: horizontalPadding },
474
+ carousel: { gap: horizontalGap },
475
+ }}
476
+ >
477
+ {Object.values(assets).map((asset, index) => (
478
+ <CarouselItem key={asset.symbol} id={asset.symbol}>
479
+ <SquareAssetCard imageUrl={asset.imageUrl} name={asset.symbol} />
480
+ </CarouselItem>
481
+ ))}
482
+ </Carousel>
483
+ );
484
+ }
485
+ ```
486
+
487
+ ### Accessibility
488
+
489
+ The carousel is accessible by default.
490
+
491
+ You need to use `accessibilityLabel` or `accessibilityLabelledBy` props to provide a label for the carousel items.
492
+
493
+ Similar to web, you are provided the `isVisible` render prop, however it is not necessary to use since mobile users do not have a keyboard.
494
+
495
+ ```jsx
496
+ <Carousel>
497
+ <CarouselItem id="btc" accessibilityLabel="Bitcoin">
498
+ <SquareAssetCard imageUrl={assets.btc.imageUrl} name={assets.btc.symbol} />
499
+ </CarouselItem>
500
+ <CarouselItem id="recurring-buy" width="100%" accessibilityLabelledBy="recurring-buy-label">
501
+ {({ isVisible }) => (
502
+ <UpsellCard
503
+ action={
504
+ <Button
505
+ compact
506
+ flush="start"
507
+ numberOfLines={1}
508
+ onPress={NoopFn}
509
+ tabIndex={isVisible ? undefined : -1}
510
+ variant="secondary"
511
+ >
512
+ Get started
513
+ </Button>
514
+ }
515
+ description="Want to add funds to your card every week or month?"
516
+ media={
517
+ <Box bottom={6} position="relative" right={24}>
518
+ <Pictogram dimension="64x64" name="recurringPurchases" />
519
+ </Box>
520
+ }
521
+ minWidth="0"
522
+ title={
523
+ <TextHeadline as="h3" id="recurring-buy-label">
524
+ Recurring Buy
525
+ </TextHeadline>
526
+ }
527
+ width="100%"
528
+ />
529
+ )}
530
+ </CarouselItem>
531
+ </Carousel>
532
+ ```
533
+
534
+ ### Customization
535
+
536
+ #### Custom Components
537
+
538
+ You can customize the navigation and pagination components of the carousel using the `NavigationComponent` and `PaginationComponent` props. You can also modify the title by providing a ReactNode for the `title` prop.
539
+
540
+ ```jsx
541
+ function CustomComponentsCarousel() {
542
+ function PaginationComponent({ totalPages, activePageIndex, onClickPage, style }) {
543
+ const canGoPrevious = activePageIndex > 0;
544
+ const canGoNext = activePageIndex < totalPages - 1;
545
+ const dotStyles = {
546
+ width: theme.space[2],
547
+ height: theme.space[2],
548
+ borderRadius: theme.borderRadius[1000],
549
+ } as const;
550
+ function onPrevious() {
551
+ onClickPage(activePageIndex - 1);
552
+ }
553
+ function onNext() {
554
+ onClickPage(activePageIndex + 1);
555
+ }
556
+ return (
557
+ <HStack justifyContent="space-between" style={style}>
558
+ <HStack gap={1}>
559
+ <IconButton
560
+ accessibilityLabel="Previous"
561
+ disabled={!canGoPrevious}
562
+ name="caretLeft"
563
+ onPress={onPrevious}
564
+ variant="foregroundMuted"
565
+ />
566
+ <IconButton
567
+ accessibilityLabel="Next"
568
+ disabled={!canGoNext}
569
+ name="caretRight"
570
+ onPress={onNext}
571
+ variant="foregroundMuted"
572
+ />
573
+ </HStack>
574
+ <HStack alignItems="center" gap={1}>
575
+ {Array.from({ length: totalPages }, (_, index) => (
576
+ <Pressable
577
+ key={index}
578
+ accessibilityLabel={`Go to page ${index + 1}`}
579
+ background={index === activePageIndex ? 'bgPrimary' : 'bgSecondary'}
580
+ borderColor={index === activePageIndex ? 'fgPrimary' : 'bgLine'}
581
+ data-testid={`carousel-page-${index}`}
582
+ onPress={() => onClickPage(index)}
583
+ style={dotStyles}
584
+ />
585
+ ))}
586
+ </HStack>
587
+ </HStack>
588
+ );
589
+ }
590
+ function NoopFn() {
591
+ console.log('pressed');
592
+ }
593
+ // ...itemWidth as shown in other examples
594
+ return (
595
+ <Carousel
596
+ NavigationComponent={SeeAllComponent}
597
+ PaginationComponent={PaginationComponent}
598
+ styles={{
599
+ root: { paddingInline: horizontalPadding },
600
+ carousel: { gap: horizontalGap },
601
+ }}
602
+ title={
603
+ <TextHeadline as="h3">
604
+ Learn more
605
+ </TextHeadline>
606
+ }
607
+ >
608
+ <CarouselItem id="recurring-buy" width={itemWidth}>
609
+ <UpsellCard
610
+ action="Get started"
611
+ description="Want to add funds to your card every week or month?"
612
+ media={
613
+ <Box bottom={6} position="relative" right={24}>
614
+ <Pictogram dimension="64x64" name="recurringPurchases" />
615
+ </Box>
616
+ }
617
+ minWidth={0}
618
+ onActionPress={NoopFn}
619
+ title="Recurring Buy"
620
+ width="100%"
621
+ />
622
+ </CarouselItem>
623
+ <CarouselItem id="eths-apr" width={itemWidth}>
624
+ <UpsellCard
625
+ action="Start earning"
626
+ dangerouslySetBackground="rgb(var(--purple70))"
627
+ description={
628
+ <TextLabel2 as="p" numberOfLines={3} color="fgInverse">
629
+ Earn staking rewards on ETH by holding it on Coinbase
630
+ </TextLabel2>
631
+ }
632
+ media={
633
+ <Box left={16} position="relative" top={12}>
634
+ <RemoteImage height={174} source="/img/feature.png" />
635
+ </Box>
636
+ }
637
+ minWidth={0}
638
+ onActionPress={NoopFn}
639
+ title={
640
+ <TextHeadline color="fgInverse" as="h3">
641
+ Up to 3.29% APR on ETHs
642
+ </TextHeadline>
643
+ }
644
+ width="100%"
645
+ />
646
+ </CarouselItem>
647
+ <CarouselItem id="join-the-community" width={itemWidth}>
648
+ <UpsellCard
649
+ action="Start chatting"
650
+ dangerouslySetBackground="rgb(var(--teal70))"
651
+ description={
652
+ <TextLabel2 as="p" numberOfLines={3} color="fgInverse">
653
+ Chat with other devs in our Discord community
654
+ </TextLabel2>
655
+ }
656
+ media={
657
+ <Box left={16} position="relative" top={4}>
658
+ <RemoteImage height={174} source="/img/community.png" />
659
+ </Box>
660
+ }
661
+ minWidth={0}
662
+ onActionPress={NoopFn}
663
+ title={
664
+ <TextHeadline color="fgInverse" as="h3">
665
+ Join the community
666
+ </TextHeadline>
667
+ }
668
+ width="100%"
669
+ />
670
+ </CarouselItem>
671
+ <CarouselItem id="coinbase-one-offer" width={itemWidth}>
672
+ <UpsellCard
673
+ action="Get 60 days free"
674
+ dangerouslySetBackground="rgb(var(--blue80))"
675
+ description={
676
+ <TextLabel2 as="p" numberOfLines={3} color="fgInverse">
677
+ Use code NOV60 when you sign up for Coinbase One
678
+ </TextLabel2>
679
+ }
680
+ media={
681
+ <Box left={16} position="relative" top={0}>
682
+ <RemoteImage height={174} source="/img/marketing.png" />
683
+ </Box>
684
+ }
685
+ minWidth={0}
686
+ onActionPress={NoopFn}
687
+ title={
688
+ <TextHeadline color="fgInverse" as="h3">
689
+ Coinbase One offer
690
+ </TextHeadline>
691
+ }
692
+ width="100%"
693
+ />
694
+ </CarouselItem>
695
+ <CarouselItem id="coinbase-card" width={itemWidth}>
696
+ <UpsellCard
697
+ action="Get started"
698
+ dangerouslySetBackground="rgb(var(--gray100))"
699
+ description={
700
+ <TextLabel2 as="p" numberOfLines={3} color="fgInverse">
701
+ Spend USDC to get rewards with our Visa® debit card
702
+ </TextLabel2>
703
+ }
704
+ media={
705
+ <Box left={16} position="relative" top={0}>
706
+ <RemoteImage height={174} source="/img/object.png" />
707
+ </Box>
708
+ }
709
+ minWidth={0}
710
+ onActionPress={NoopFn}
711
+ title={
712
+ <TextHeadline color="fgInverse" as="h3">
713
+ Coinbase Card
714
+ </TextHeadline>
715
+ }
716
+ width="100%"
717
+ />
718
+ </CarouselItem>
719
+ </Carousel>
720
+ );
721
+ }
722
+ ```
723
+
724
+ #### Custom Styles
725
+
726
+ You can use the `styles` props to customize different parts of the carousel.
727
+
728
+ ```jsx
729
+ function CustomStylesCarousel() {
730
+ return (
731
+ <Carousel
732
+ styles={{
733
+ root: { paddingInline: horizontalPadding },
734
+ carousel: { gap: horizontalGap },
735
+ }}
736
+ NavigationComponent={({
737
+ className,
738
+ style,
739
+ disableGoNext,
740
+ disableGoPrevious,
741
+ nextPageAccessibilityLabel,
742
+ onGoNext,
743
+ onGoPrevious,
744
+ previousPageAccessibilityLabel,
745
+ }) => {
746
+ return (
747
+ <DefaultCarouselNavigation
748
+ className={className}
749
+ disableGoNext={disableGoNext}
750
+ disableGoPrevious={disableGoPrevious}
751
+ nextPageAccessibilityLabel={nextPageAccessibilityLabel}
752
+ onGoNext={onGoNext}
753
+ onGoPrevious={onGoPrevious}
754
+ previousPageAccessibilityLabel={previousPageAccessibilityLabel}
755
+ style={style}
756
+ styles={{
757
+ previousButton: {
758
+ position: 'absolute',
759
+ top: theme.space[8],
760
+ zIndex: 1,
761
+ left: theme.space[0_5],
762
+ },
763
+ nextButton: {
764
+ position: 'absolute',
765
+ top: theme.space[8],
766
+ zIndex: 1,
767
+ right: theme.space[0_5],
768
+ },
769
+ }}
770
+ />
771
+ );
772
+ }}
773
+ >
774
+ <CarouselItem id="earn-more-crypto" width="100%">
775
+ <NudgeCard
776
+ title="Earn more crypto"
777
+ description="You've got unstaked crypto. Stake it now to earn more."
778
+ pictogram="key"
779
+ action="Start earning"
780
+ onActionPress={() => console.log('Action pressed')}
781
+ width="100%"
782
+ minWidth={0}
783
+ />
784
+ </CarouselItem>
785
+ <CarouselItem id="secure-your-account" width="100%">
786
+ <NudgeCard
787
+ title="Secure your account"
788
+ description="Add two-factor authentication for enhanced security."
789
+ pictogram="shield"
790
+ action="Enable 2FA"
791
+ onActionPress={() => console.log('Enable 2FA pressed')}
792
+ width="100%"
793
+ minWidth={0}
794
+ />
795
+ </CarouselItem>
796
+ <CarouselItem id="complete-your-profile" width="100%">
797
+ <NudgeCard
798
+ title="Complete your profile"
799
+ description="Add more details to personalize your experience."
800
+ pictogram="accountsNavigation"
801
+ action="Update profile"
802
+ onActionPress={() => console.log('Update profile pressed')}
803
+ width="100%"
804
+ minWidth={0}
805
+ />
806
+ </CarouselItem>
807
+ </Carousel>
808
+ );
809
+ }
810
+ ```
811
+
812
+ #### Dynamic Content
813
+
814
+ You can dynamically add and remove items from the carousel.
815
+
816
+ ```jsx
817
+ function DynamicContentCarousel() {
818
+ const [items, setItems] = useState(Object.values(assets).slice(0, 3));
819
+
820
+ function addAsset() {
821
+ const randomAsset =
822
+ Object.values(assets)[Math.floor(Math.random() * Object.values(assets).length)];
823
+ setItems([...items, { ...randomAsset, symbol: `${randomAsset.symbol}-${items.length}` }]);
824
+ }
825
+
826
+ return (
827
+ <VStack gap={2}>
828
+ <HStack justifyContent="flex-end" gap={2} alignItems="center">
829
+ <Button compact onPress={addAsset}>
830
+ Add Asset
831
+ </Button>
832
+ <Button compact onPress={() => setItems(items.slice(0, -1))} disabled={items.length === 0}>
833
+ Remove Last
834
+ </Button>
835
+ </HStack>
836
+ <Carousel
837
+ title="Explore Assets"
838
+ styles={{
839
+ root: { paddingInline: horizontalPadding },
840
+ carousel: { gap: horizontalGap, height: 156 },
841
+ }}
842
+ >
843
+ {items.map((asset, index) => (
844
+ <CarouselItem key={asset.symbol} id={asset.symbol}>
845
+ <SquareAssetCard imageUrl={asset.imageUrl} name={asset.symbol} />
846
+ </CarouselItem>
847
+ ))}
848
+ </Carousel>
849
+ </VStack>
850
+ );
851
+ }
852
+ ```
853
+
854
+ #### Hide Navigation and Pagination
855
+
856
+ You can hide the navigation and pagination components of the carousel if desired.
857
+
858
+ ```jsx
859
+ function HideNavigationAndPaginationCarousel() {
860
+ return (
861
+ <Carousel
862
+ title="Explore Assets"
863
+ hidePagination
864
+ hideNavigation
865
+ drag="free"
866
+ snapMode="item"
867
+ styles={{
868
+ root: { paddingInline: horizontalPadding },
869
+ carousel: { gap: horizontalGap },
870
+ }}
871
+ >
872
+ {Object.values(assets).map((asset, index) => (
873
+ <CarouselItem key={asset.symbol} id={asset.symbol}>
874
+ <SquareAssetCard imageUrl={asset.imageUrl} name={asset.symbol} />
875
+ </CarouselItem>
876
+ ))}
877
+ </Carousel>
878
+ );
879
+ }
880
+ ```
881
+
882
+ ### Imperative API
883
+
884
+ You can control the carousel programmatically using a ref. The carousel exposes methods to navigate to specific pages and access the current page index.
885
+
886
+ ```jsx
887
+ function ImperativeApiCarousel() {
888
+ const theme = useTheme();
889
+ const carouselRef = useRef(null);
890
+ const [currentPageInfo, setCurrentPageInfo] = useState('Page 1');
891
+
892
+ const handleGoToPage = (pageIndex) => {
893
+ if (carouselRef.current) {
894
+ const clampedPageIndex = Math.max(0, Math.min(carouselRef.current.totalPages - 1, pageIndex));
895
+ carouselRef.current.goToPage(clampedPageIndex);
896
+ setCurrentPageInfo(`Page ${clampedPageIndex + 1}`);
897
+ }
898
+ };
899
+
900
+ const handleGoToFirstPage = () => {
901
+ handleGoToPage(0);
902
+ };
903
+
904
+ const handleGoToLastPage = () => {
905
+ if (carouselRef.current) {
906
+ handleGoToPage(carouselRef.current.totalPages - 1);
907
+ }
908
+ };
909
+
910
+ const handleGoToPrevPage = () => {
911
+ if (carouselRef.current) {
912
+ handleGoToPage(carouselRef.current.activePageIndex - 1);
913
+ }
914
+ };
915
+
916
+ const handleGoToNextPage = () => {
917
+ if (carouselRef.current) {
918
+ handleGoToPage(carouselRef.current.activePageIndex + 1);
919
+ }
920
+ };
921
+
922
+ return (
923
+ <VStack gap={2}>
924
+ <HStack alignItems="center" gap={2} justifyContent="space-between" paddingX={3}>
925
+ <HStack gap={1}>
926
+ <IconButton
927
+ accessibilityLabel="Go to first page"
928
+ name="doubleChevronRight"
929
+ onPress={handleGoToFirstPage}
930
+ style={{ transform: [{ rotate: '180deg' }] }}
931
+ variant="secondary"
932
+ />
933
+ <IconButton
934
+ active
935
+ accessibilityLabel="Go to previous page"
936
+ name="arrowLeft"
937
+ onPress={handleGoToPrevPage}
938
+ variant="secondary"
939
+ />
940
+ </HStack>
941
+ <Box
942
+ alignItems="center"
943
+ background="bgSecondary"
944
+ borderRadius={500}
945
+ flexGrow={1}
946
+ justifyContent="center"
947
+ paddingX={2}
948
+ paddingY={1}
949
+ >
950
+ <Text color="fgMuted" font="label1">
951
+ {currentPageInfo}
952
+ </Text>
953
+ </Box>
954
+ <HStack gap={1}>
955
+ <IconButton
956
+ active
957
+ accessibilityLabel="Go to next page"
958
+ name="arrowRight"
959
+ onPress={handleGoToNextPage}
960
+ variant="secondary"
961
+ />
962
+ <IconButton
963
+ accessibilityLabel="Go to last page"
964
+ name="doubleChevronRight"
965
+ onPress={handleGoToLastPage}
966
+ variant="secondary"
967
+ />
968
+ </HStack>
969
+ </HStack>
970
+ <Carousel
971
+ ref={carouselRef}
972
+ hideNavigation
973
+ hidePagination
974
+ drag="none"
975
+ snapMode="item"
976
+ styles={{
977
+ root: { paddingHorizontal: theme.space[3] },
978
+ carousel: { gap: theme.space[1] },
979
+ }}
980
+ title="Explore Assets"
981
+ >
982
+ {Object.values(assets).map((asset) => (
983
+ <CarouselItem key={asset.symbol} accessibilityLabel={asset.name} id={asset.symbol}>
984
+ <SquareAssetCard imageUrl={asset.imageUrl} name={asset.symbol} />
985
+ </CarouselItem>
986
+ ))}
987
+ </Carousel>
988
+ </VStack>
989
+ );
990
+ }
991
+ ```
992
+
993
+ #### Animated Pagination
994
+
995
+ You can create smooth pagination animations by customizing the pagination dots. This example shows how to create expanding dots that smoothly transition between active and inactive states.
996
+
997
+ ```jsx
998
+ function AnimatedPaginationCarousel() {
999
+ const theme = useTheme();
1000
+
1001
+ const AnimatedPagination = memo((props) => {
1002
+ const { totalPages, activePageIndex, onClickPage, style } = props;
1003
+
1004
+ const AnimatedDot = memo(({ index, isActive, onPress }) => {
1005
+ const dotSize = theme.space[1];
1006
+ const activeDotWidth = theme.space[3];
1007
+
1008
+ const springProps = useSpring({
1009
+ width: isActive ? activeDotWidth : dotSize,
1010
+ backgroundColor: isActive ? theme.color.bgPrimary : theme.color.bgLine,
1011
+ config: { tension: 300, friction: 25 },
1012
+ });
1013
+
1014
+ return (
1015
+ <Pressable
1016
+ accessibilityLabel={`Go to page ${index + 1}`}
1017
+ borderRadius={1000}
1018
+ borderWidth={0}
1019
+ height={dotSize}
1020
+ onPress={onPress}
1021
+ >
1022
+ <animated.View
1023
+ style={[
1024
+ {
1025
+ height: dotSize,
1026
+ borderRadius: dotSize / 2,
1027
+ },
1028
+ springProps,
1029
+ ]}
1030
+ />
1031
+ </Pressable>
1032
+ );
1033
+ });
1034
+
1035
+ return (
1036
+ <HStack alignItems="center" gap={0.5} justifyContent="center" style={style}>
1037
+ {Array.from({ length: totalPages }, (_, index) => (
1038
+ <AnimatedDot
1039
+ key={index}
1040
+ index={index}
1041
+ isActive={index === activePageIndex}
1042
+ onPress={() => onClickPage?.(index)}
1043
+ />
1044
+ ))}
1045
+ </HStack>
1046
+ );
1047
+ });
1048
+
1049
+ return (
1050
+ <Carousel
1051
+ PaginationComponent={AnimatedPagination}
1052
+ drag="snap"
1053
+ snapMode="page"
1054
+ styles={{
1055
+ root: { paddingInline: horizontalPadding },
1056
+ carousel: { gap: horizontalGap },
1057
+ }}
1058
+ title="Explore Assets"
1059
+ >
1060
+ {Object.values(assets).map((asset, index) => (
1061
+ <CarouselItem key={asset.symbol} id={asset.symbol} accessibilityLabel={asset.name}>
1062
+ <SquareAssetCard imageUrl={asset.imageUrl} name={asset.symbol} />
1063
+ </CarouselItem>
1064
+ ))}
1065
+ </Carousel>
1066
+ );
1067
+ }
1068
+ ```
1069
+
1070
+ ### Callbacks
1071
+
1072
+ You can use the `onChangePage`, `onDragStart`, and `onDragEnd` callbacks to listen for user interaction in the carousel.
1073
+
1074
+ ```tsx
1075
+ <Carousel
1076
+ onChangePage={(pageIndex: number) => console.log('Page changed', pageIndex)}
1077
+ onDragStart={() => console.log('Drag started')}
1078
+ onDragEnd={() => console.log('Drag ended')}
1079
+ >
1080
+ ...
1081
+ </Carousel>
1082
+ ```
1083
+
1084
+