@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,653 @@
1
+ # TextInput
2
+
3
+ A control for entering text.
4
+
5
+ ## Import
6
+
7
+ ```jsx
8
+ import { TextInput } from '@coinbase/cds-web/controls/TextInput'
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Required | Default | Description |
14
+ | --- | --- | --- | --- | --- |
15
+ | `align` | `center \| start \| end \| justify` | No | `start` | Aligns text inside input and helperText |
16
+ | `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `200` | Leverage one of the borderRadius styles we offer to round the corners of the input. |
17
+ | `bordered` | `boolean` | No | `true` | Adds border to input |
18
+ | `compact` | `boolean` | No | `false` | Enables compact variation |
19
+ | `disabled` | `boolean` | No | `false` | Toggles input interactability and opacity |
20
+ | `enableColorSurge` | `boolean` | No | `-` | Enable Color Surge motion |
21
+ | `end` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Adds content to the end of the inner input. Refer to diagram for location of endNode in InputStack component |
22
+ | `height` | `((Height<string \| number> \| { base?: Height<string \| number>; phone?: Height<string \| number> \| undefined; tablet?: Height<string \| number> \| undefined; desktop?: Height<string \| number> \| undefined; }) & (string \| number)) \| undefined` | No | `-` | Height of input |
23
+ | `helperText` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | For cases where label is not enough information to describe what the text input is for. Can also be used for showing positive/negative messages |
24
+ | `helperTextErrorIconAccessibilityLabel` | `string` | No | `'error'` | Accessibility label for helper text error icon when variant=negative |
25
+ | `inputNode` | `ReactElement` | No | `-` | Customize the element which the input area will be rendered as. Adds ability to render the input area as a <textarea />, <input /> etc... By default, the input area will be rendered as an <input />. |
26
+ | `key` | `Key \| null` | No | `-` | - |
27
+ | `label` | `string` | No | `-` | Short messageArea indicating purpose of input |
28
+ | `labelVariant` | `inside \| outside` | No | `'outside'` | The variant of the label. Only used when compact is not true. |
29
+ | `onChange` | `ChangeEventHandler<HTMLInputElement>` | No | `-` | - |
30
+ | `onClick` | `(MouseEventHandler<Element> & MouseEventHandler<HTMLInputElement>)` | No | `-` | Callback fired when pressed/clicked |
31
+ | `placeholder` | `string` | No | `-` | Placeholder text displayed inside of the input. Will be replaced if there is a value. |
32
+ | `ref` | `((instance: HTMLInputElement \| null) => void) \| RefObject<HTMLInputElement> \| null` | No | `-` | - |
33
+ | `start` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Adds content to the start of the inner input. Refer to diagram for location of startNode in InputStack component |
34
+ | `suffix` | `string` | No | `-` | Adds suffix text to the end of input |
35
+ | `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 |
36
+ | `testIDMap` | `{ start?: string; end?: string \| undefined; label?: string \| undefined; helperText?: string \| undefined; } \| undefined` | No | `-` | Add ability to test individual parts of the input |
37
+ | `type` | `number \| color \| button \| search \| time \| image \| text \| hidden \| string & {} \| email \| checkbox \| radio \| tel \| url \| date \| submit \| reset \| datetime-local \| file \| month \| password \| range \| week` | No | `-` | - |
38
+ | `value` | `string \| number \| readonly string[]` | No | `-` | - |
39
+ | `variant` | `primary \| secondary \| positive \| negative \| foregroundMuted \| foreground` | No | `foregroundMuted` | Determines the sentiment of the input. Because we allow startContent and endContent to be custom ReactNode, the content placed inside these slots will not change colors according to the variant. You will have to add that yourself |
40
+ | `width` | `ResponsiveProp<Width<string \| number>>` | No | `100%` | Width of input as a percentage string. |
41
+
42
+
43
+ ## Examples
44
+
45
+ **Note** TextField extends props from [HTMLInputElement](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes) on web. On mobile, it extends [TextInputProps](https://reactnative.dev/docs/textinput#props) from react-native.
46
+
47
+ #### Input Label
48
+
49
+ Default composition of Inputs.
50
+
51
+ ```jsx live
52
+ <VStack gap={3}>
53
+ <TextInput
54
+ label="API Access Token"
55
+ placeholder="HaeJiWplJohn6W42eCq0Qqft0"
56
+ end={
57
+ <Box paddingX={2}>
58
+ <Link variant="caption" color="primary" to="">
59
+ COPY
60
+ </Link>
61
+ </Box>
62
+ }
63
+ />
64
+
65
+ <VStack>
66
+ <Text as="p">Use the compact variant when space is tight.</Text>
67
+ <TextInput
68
+ compact
69
+ type="number"
70
+ step="0.01"
71
+ label="Amount"
72
+ placeholder="8293323.23"
73
+ suffix="USD"
74
+ />
75
+ </VStack>
76
+ </VStack>
77
+ ```
78
+
79
+ #### Accessible Text Inputs
80
+
81
+ TextInput comes with an accessibilityLabel prop. If no accessibilityLabel is passed, it will use the label as the accessibilityLabel. If you want an accessibilityLabel that differs from the Label, you can set this prop.
82
+
83
+ Here, since no accessibilityLabel is passed, the accessibilityLabel will be "Email".
84
+
85
+ ```jsx
86
+ <TextInput label="Email" />
87
+ ```
88
+
89
+ Example of passing an accessibilityLabel. For web, this will set aria-label="Enter a Coinbase Email" under the hood
90
+
91
+ ```jsx
92
+ <TextInput accessibilityLabel="Enter a Coinbase Email" label="Email" />
93
+ ```
94
+
95
+ :::tip Accessibility tip
96
+
97
+ Like any component system, much of the responsibility for building accessible UIs is in your hands as the consumer to properly implement the component composition. We'll do our best to provide sane fallbacks, but here are the biggest gotchas for `TextInput`s you can watch out for.
98
+
99
+ <br />
100
+
101
+ ##### `aria-*` attr overrides
102
+
103
+ Any time you use `variant='negative'`, we assume you're showing an error state. If for some reason this is _not_ the case, you will want to use `aria-invalid={false}` to override the default configuration.
104
+
105
+ <br />
106
+
107
+ ##### Message format
108
+
109
+ It's also advised you always format `helperText` with `Error: ${errorMessage}`. We'd do that for you, but _i18n_ isn't baked into CDS. Take a look at the example below:
110
+
111
+ :::
112
+
113
+ ```jsx live
114
+ <VStack gap={4}>
115
+ <TextInput
116
+ label="Text Input rendered in an errored state"
117
+ placeholder="Enter a color"
118
+ helperText="Error: Your favorite color is not orange"
119
+ variant="negative"
120
+ />
121
+ <TextInput
122
+ label="Text Input that's red but not in an errored state"
123
+ placeholder="Enter a color"
124
+ helperText="You like red?"
125
+ variant="negative"
126
+ // Override the default behavior when variant="negative"
127
+ aria-invalid={false}
128
+ />
129
+ </VStack>
130
+ ```
131
+
132
+ #### Placeholder Text
133
+
134
+ ```jsx live
135
+ <TextInput label="Label" placeholder="Placeholder" />
136
+ ```
137
+
138
+ #### Borderless TextInput (web)
139
+
140
+ A borderless TextInput SHOULD NOT be used alone. It should be used
141
+ with a TypeAhead component.
142
+
143
+ ```jsx live
144
+ <HStack padding={2}>
145
+ <TextInput
146
+ label="Borderless TextInput"
147
+ placeholder="placeholder"
148
+ helperText="helperText"
149
+ bordered={false}
150
+ />
151
+ </HStack>
152
+ ```
153
+
154
+ #### Helper Text
155
+
156
+ ##### Default Sentiment
157
+
158
+ ```jsx live
159
+ <VStack gap={3}>
160
+ <VStack>
161
+ <TextHeadline as="p">Default sentiment</TextHeadline>
162
+ <TextInput
163
+ label="Campaign title"
164
+ placeholder="Title"
165
+ helperText="This won't be displayed to user"
166
+ />
167
+ </VStack>
168
+
169
+ <VStack>
170
+ <TextHeadline as="p">Positive sentiment</TextHeadline>
171
+ <TextInput
172
+ label="Address"
173
+ helperText="Valid BTC address"
174
+ variant="positive"
175
+ placeholder="HaeJiWplJohn6W42eCq0Qqft0"
176
+ end={<InputIcon active color="fgPositive" name="visible" />}
177
+ />
178
+ </VStack>
179
+
180
+ <VStack>
181
+ <TextHeadline as="p">Negative Sentiment</TextHeadline>
182
+ <TextInput
183
+ label="Address"
184
+ helperText="Invalid BTC address"
185
+ variant="negative"
186
+ placeholder="HaeJiWplJohn6W42eCq0Qqft0"
187
+ end={<InputIcon active color="fgNegative" name="visible" />}
188
+ />
189
+ </VStack>
190
+ </VStack>
191
+ ```
192
+
193
+ #### Color Surge Enabled
194
+
195
+ ```jsx live
196
+ <VStack gap={3}>
197
+ <TextInput
198
+ label="Default Color Surge"
199
+ placeholder="Focus me"
200
+ helperText="This won't be displayed to user"
201
+ enableColorSurge
202
+ />
203
+
204
+ <TextInput
205
+ label="Positive Color Surge"
206
+ placeholder="Focus me"
207
+ helperText="Valid BTC address"
208
+ variant="positive"
209
+ enableColorSurge
210
+ />
211
+
212
+ <TextInput
213
+ label="Negative Color Surge"
214
+ placeholder="Focus me"
215
+ helperText="Invalid BTC address"
216
+ variant="negative"
217
+ enableColorSurge
218
+ />
219
+ </VStack>
220
+ ```
221
+
222
+ #### Content Alignment
223
+
224
+ ```jsx live
225
+ <VStack gap={3}>
226
+ <VStack>
227
+ <Text as="p">
228
+ <strong>Left aligned (default): </strong>
229
+ </Text>
230
+ <TextInput label="City/town" placeholder="Oakland" />
231
+ </VStack>
232
+
233
+ <VStack>
234
+ <Text as="p">Right aligned (with compact):</Text>
235
+ <TextInput
236
+ label="Limit price"
237
+ compact
238
+ align="end"
239
+ type="number"
240
+ step="0.01"
241
+ placeholder="29.3"
242
+ suffix="USD"
243
+ />
244
+ </VStack>
245
+ </VStack>
246
+ ```
247
+
248
+ #### Label Variants
249
+
250
+ TextInput supports two label variants: `outside` (default) and `inside`. Note that the `compact` prop, when set to true, will override label variant preference.
251
+
252
+ :::warning
253
+
254
+ When using the `inside` label variant, you should always include a `placeholder` prop.
255
+
256
+ :::
257
+
258
+ ```jsx live
259
+ <VStack gap={3}>
260
+ <VStack>
261
+ <Text as="p">
262
+ <strong>Outside label (default):</strong>
263
+ </Text>
264
+ <TextInput label="Email Address" placeholder="Enter your email" />
265
+ </VStack>
266
+
267
+ <VStack>
268
+ <Text as="p">
269
+ <strong>Inside label:</strong>
270
+ </Text>
271
+ <TextInput label="Email Address" labelVariant="inside" placeholder="Enter your email" />
272
+ </VStack>
273
+
274
+ <VStack>
275
+ <Text as="p">
276
+ <strong>Inside label (with start content):</strong>
277
+ </Text>
278
+ <TextInput
279
+ label="Search"
280
+ labelVariant="inside"
281
+ start={<InputIconButton name="search" />}
282
+ placeholder="Search for anything"
283
+ />
284
+ </VStack>
285
+
286
+ <VStack>
287
+ <Text as="p">
288
+ <strong>Inside label (with end content):</strong>
289
+ </Text>
290
+ <TextInput
291
+ label="Password"
292
+ labelVariant="inside"
293
+ type="password"
294
+ end={<InputIconButton name="visibleInactive" />}
295
+ placeholder="Enter your password"
296
+ />
297
+ </VStack>
298
+ </VStack>
299
+ ```
300
+
301
+ #### StartContent & EndContent
302
+
303
+ ##### Examples of Input Objects placed at the Start
304
+
305
+ ```jsx live
306
+ function StartContentExamples() {
307
+ return (
308
+ <VStack gap={3}>
309
+ <VStack>
310
+ <Text as="p">
311
+ <strong>Asset</strong>: Asset objects are not interactive
312
+ </Text>
313
+ <TextInput
314
+ label="Address"
315
+ start={
316
+ <Box paddingX={2}>
317
+ <Avatar
318
+ size="l"
319
+ src="https://dynamic-assets.coinbase.com/e785e0181f1a23a30d9476038d9be91e9f6c63959b538eabbc51a1abc8898940383291eede695c3b8dfaa1829a9b57f5a2d0a16b0523580346c6b8fab67af14b/asset_icons/b57ac673f06a4b0338a596817eb0a50ce16e2059f327dc117744449a47915cb2.png"
320
+ alt="address"
321
+ />
322
+ </Box>
323
+ }
324
+ placeholder="HaeJiWplJohn6W42eCq0Qqft0"
325
+ />
326
+ </VStack>
327
+
328
+ <VStack>
329
+ <Text as="p">
330
+ <strong>Icon</strong>: Icon objects are not interactive.
331
+ </Text>
332
+ <TextInput label="Amount" start={<InputIcon name="cashUSD" />} placeholder="1234" />
333
+ </VStack>
334
+
335
+ <VStack>
336
+ <Text as="p">
337
+ <strong>IconButton</strong>: The most common use case for Icon Button at the start of a
338
+ Text Field is search.
339
+ </Text>
340
+ <TextInput
341
+ label="Search"
342
+ start={<InputIconButton name="search" />}
343
+ placeholder="Search for anything"
344
+ />
345
+ </VStack>
346
+ </VStack>
347
+ );
348
+ }
349
+ ```
350
+
351
+ #### Read Only
352
+
353
+ TextInput supports a read-only state which is visually distinct from the disabled state. Read-only inputs have a secondary background color and can still be focused.
354
+
355
+ ```jsx live
356
+ <VStack gap={3}>
357
+ <TextInput label="Read Only Input" readOnly value="This value cannot be edited" />
358
+ <TextInput label="Read Only with Suffix" readOnly value="1234.56" suffix="USD" />
359
+ <TextInput
360
+ label="Read Only with Start Content"
361
+ readOnly
362
+ value="BTC Address"
363
+ start={<InputIconButton name="search" />}
364
+ />
365
+ </VStack>
366
+ ```
367
+
368
+ ### Example of Input Objects placed at the End
369
+
370
+ Here are some examples and best practices when using end content in a TextField.
371
+
372
+ ```jsx live
373
+ <VStack gap={3}>
374
+ <VStack>
375
+ <Text as="p">
376
+ <strong>Icon</strong>: Icon objects are not interactive.
377
+ </Text>
378
+ <TextInput
379
+ label="Address"
380
+ placeholder="1234 Abc Way"
381
+ end={<InputIcon name="checkmark" color="fgPositive" />}
382
+ />
383
+ </VStack>
384
+
385
+ <VStack>
386
+ <Text as="p">
387
+ The most common use case for placing a text object at the end of an input is currency. This
388
+ object is not interactive.
389
+ </Text>
390
+ <TextInput
391
+ label="Amount"
392
+ type="number"
393
+ step="0.01"
394
+ compact
395
+ placeholder="98329.23"
396
+ suffix="USD"
397
+ />
398
+ </VStack>
399
+
400
+ <VStack>
401
+ <Text as="p">
402
+ You can add a Text Button object at the end of an Input. "Copy" is a great example of this.
403
+ </Text>
404
+ <TextInput
405
+ label="API Access Token"
406
+ placeholder="HaeJiWplJohn6W42eCq0Qqft0"
407
+ end={
408
+ <Box spacingEnd={2}>
409
+ <Link variant="caption" color="primary" to="">
410
+ COPY
411
+ </Link>
412
+ </Box>
413
+ }
414
+ />
415
+ </VStack>
416
+ </VStack>
417
+ ```
418
+
419
+ #### Password input
420
+
421
+ Password Input - Use Icon Buttons at the end for actions like showing a password or clearing text from an input.
422
+
423
+ > a11y tip: Always provide an `accessibilityLabel` to start/end nodes to clearly communicate state/actions
424
+
425
+ ```jsx live
426
+ function PasswordInput() {
427
+ const [isVisible, setIsVisible] = useState(false);
428
+ const type = useMemo(() => (isVisible ? 'text' : 'password'), [isVisible]);
429
+
430
+ return (
431
+ <TextInput
432
+ label="Password"
433
+ type={type}
434
+ end={
435
+ <InputIconButton
436
+ name={isVisible ? 'visibleActive' : 'visibleInactive'}
437
+ onClick={() => setIsVisible((isVisible) => !setIsVisible)}
438
+ accessibilityLabel={isVisible ? 'Hide password' : 'Show password'}
439
+ />
440
+ }
441
+ />
442
+ );
443
+ }
444
+ ```
445
+
446
+ #### Link + Icon Button
447
+
448
+ If needed, you can add a Link + Icon Button like this example here. Use this sparingly and only at the End of an Input.
449
+
450
+ ```jsx live
451
+ function CopyTextField() {
452
+ const [copied, setCopied] = useState(false);
453
+ const [variant, setVariant] = useState('foregroundMuted');
454
+ const [helperText, setHelperText] = useState('');
455
+
456
+ useEffect(() => {
457
+ if (copied) {
458
+ setVariant('positive');
459
+ setHelperText('Your token has been copied!');
460
+ } else {
461
+ setVariant('foregroundMuted');
462
+ setHelperText('');
463
+ }
464
+ }, [copied]);
465
+
466
+ const handleOnChange = useCallback(() => {
467
+ setVariant('foregroundMuted');
468
+ setCopied(false);
469
+ setHelperText('');
470
+ }, []);
471
+
472
+ return (
473
+ <TextInput
474
+ end={
475
+ <HStack>
476
+ <Link onClick={() => setCopied(true)} variant="caption" color={variant}>
477
+ {copied ? 'copied' : 'copy'}
478
+ </Link>
479
+ <InputIcon active color="primary" name="visible" />
480
+ </HStack>
481
+ }
482
+ onChange={handleOnChange}
483
+ variant={variant}
484
+ helperText={helperText}
485
+ label="API Access Token"
486
+ />
487
+ );
488
+ }
489
+ ```
490
+
491
+ #### Disabled
492
+
493
+ ```jsx live
494
+ <VStack gap={3}>
495
+ <TextInput label="Label" disabled />
496
+ <TextInput label="Label" compact disabled />
497
+ </VStack>
498
+ ```
499
+
500
+ #### TextArea Example (mobile)
501
+
502
+ On mobile, TextInput is versatile enough to support
503
+ a "TextArea" as well. You just need to add multiline prop.
504
+ Here is an example
505
+
506
+ ```jsx
507
+ const [text, onChangeText] = useState('');
508
+
509
+ <MockTextInput
510
+ onChangeText={onChangeText}
511
+ value={text}
512
+ label="Textarea"
513
+ helperText="Write about yourself"
514
+ variant="foregroundMuted"
515
+ multiline
516
+ value="
517
+ A really really really really
518
+ long piece
519
+ of text
520
+ displayed. A really really really really
521
+ long piece
522
+ of text
523
+ displayed.
524
+ A really really really really
525
+ long piece
526
+ of text
527
+ displayed
528
+ "
529
+ />;
530
+ ```
531
+
532
+ #### Example of a Form
533
+
534
+ We recommend that you use spacing 3 when building stacked forms.
535
+
536
+ ```jsx live
537
+ function FormExample() {
538
+ const gap = 3;
539
+
540
+ const onSubmit = useCallback((e) => {
541
+ e.preventDefault();
542
+ console.log(e.currentTarget.nodeValue);
543
+ alert('Submitted');
544
+ }, []);
545
+
546
+ return (
547
+ <form onSubmit={onSubmit} action={undefined}>
548
+ <VStack gap={gap}>
549
+ <TextInput
550
+ label="Street address"
551
+ placeholder="4321 Jade Palace"
552
+ helperText="Please enter your primary address."
553
+ />
554
+ <TextInput label="Unit #" aria-required="true" />
555
+ <HStack gap={gap}>
556
+ <TextInput label="City/town" width="70%" />
557
+ <TextInput label="State" width="30%" />
558
+ </HStack>
559
+ <HStack gap={gap}>
560
+ <TextInput label="Postal code" width="40%" />
561
+ <TextInput label="Country" width="60%" />
562
+ </HStack>
563
+ <ButtonGroup>
564
+ <Button type="submit">Save</Button>
565
+ </ButtonGroup>
566
+ </VStack>
567
+ </form>
568
+ );
569
+ }
570
+ ```
571
+
572
+ #### Example of a Sign Up Form
573
+
574
+ ```jsx live
575
+ <HStack gap={2} alignItems="center">
576
+ <TextInput
577
+ label="Email"
578
+ placeholder="satoshi@nakamoto.com"
579
+ helperText="Please enter a valid email address"
580
+ />
581
+ <Box spacingTop={0.5}>
582
+ <Button variant="primary">Submit</Button>
583
+ </Box>
584
+ </HStack>
585
+ ```
586
+
587
+ ### Testing
588
+
589
+ #### Testing different parts of the input
590
+
591
+ You can also use the testIDMap to test different parts
592
+ of the TextInput. If you use testID, it will add the testID to the root
593
+ of the TextInput.
594
+
595
+ ```jsx live
596
+ function testExample() {
597
+ const testIDMap = useMemo(() => {
598
+ return {
599
+ input: 'input-id',
600
+ helperText: 'helperText-id',
601
+ label: 'label-id',
602
+ start: 'start-id',
603
+ end: 'end-id',
604
+ };
605
+ }, []);
606
+ return (
607
+ <TextInput
608
+ label="Email"
609
+ placeholder="satoshi@nakamoto.com"
610
+ helperText="Please enter a valid email address"
611
+ testIDMap={testIDMap}
612
+ start={
613
+ <Box paddingX={2}>
614
+ <Avatar
615
+ size="l"
616
+ src="https://dynamic-assets.coinbase.com/e785e0181f1a23a30d9476038d9be91e9f6c63959b538eabbc51a1abc8898940383291eede695c3b8dfaa1829a9b57f5a2d0a16b0523580346c6b8fab67af14b/asset_icons/b57ac673f06a4b0338a596817eb0a50ce16e2059f327dc117744449a47915cb2.png"
617
+ alt="address"
618
+ />
619
+ </Box>
620
+ }
621
+ end={<InputIcon active color="primary" name="visible" />}
622
+ />
623
+ );
624
+ }
625
+ ```
626
+
627
+ ### Date Picker Example
628
+
629
+ You can construct a DatePicker using TextInput
630
+
631
+ ```jsx live
632
+ function DatePicker() {
633
+ return <TextInput label="Pick a date" type="date" />;
634
+ }
635
+ ```
636
+
637
+ ### TextInput While Keyboard Is Open (mobile)
638
+
639
+ If you have the keyboard open, then closing the keyboard and interacting with the text input requires 2 taps, which isn't a great user experience.
640
+
641
+ To fix this issue, you can wrap the TextInput in a ScrollView, and set keyboardShouldPersistTaps="always".
642
+
643
+ ```jsx
644
+ function TextInputKeyboardExample() {
645
+ return (
646
+ <ScrollView style={{ height: '100%' }} keyboardShouldPersistTaps="always">
647
+ <TextInput label="Amount" type="number" compact placeholder="98329.23" suffix="USD" />
648
+ </ScrollView>
649
+ );
650
+ }
651
+ ```
652
+
653
+