@coinbase/cds-mcp-server 8.17.3 → 8.17.4
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.
- package/CHANGELOG.md +4 -0
- package/mcp-docs/mobile/components/Accordion.txt +11 -12
- package/mcp-docs/mobile/components/AccordionItem.txt +5 -6
- package/mcp-docs/mobile/components/Alert.txt +21 -22
- package/mcp-docs/mobile/components/AreaChart.txt +118 -119
- package/mcp-docs/mobile/components/Avatar.txt +82 -83
- package/mcp-docs/mobile/components/AvatarButton.txt +103 -104
- package/mcp-docs/mobile/components/Banner.txt +100 -101
- package/mcp-docs/mobile/components/BarChart.txt +120 -121
- package/mcp-docs/mobile/components/Box.txt +65 -66
- package/mcp-docs/mobile/components/BrowserBar.txt +38 -39
- package/mcp-docs/mobile/components/Button.txt +78 -79
- package/mcp-docs/mobile/components/ButtonGroup.txt +10 -11
- package/mcp-docs/mobile/components/Carousel.txt +103 -104
- package/mcp-docs/mobile/components/CartesianChart.txt +107 -108
- package/mcp-docs/mobile/components/CellMedia.txt +15 -16
- package/mcp-docs/mobile/components/Checkbox.txt +35 -36
- package/mcp-docs/mobile/components/CheckboxCell.txt +73 -74
- package/mcp-docs/mobile/components/CheckboxGroup.txt +24 -25
- package/mcp-docs/mobile/components/Chip.txt +67 -68
- package/mcp-docs/mobile/components/Coachmark.txt +42 -43
- package/mcp-docs/mobile/components/Collapsible.txt +15 -16
- package/mcp-docs/mobile/components/ContainedAssetCard.txt +16 -17
- package/mcp-docs/mobile/components/ContentCard.txt +99 -100
- package/mcp-docs/mobile/components/ContentCardBody.txt +23 -24
- package/mcp-docs/mobile/components/ContentCardFooter.txt +19 -20
- package/mcp-docs/mobile/components/ContentCardHeader.txt +33 -34
- package/mcp-docs/mobile/components/ContentCell.txt +102 -103
- package/mcp-docs/mobile/components/ControlGroup.txt +106 -107
- package/mcp-docs/mobile/components/DatePicker.txt +121 -122
- package/mcp-docs/mobile/components/Divider.txt +31 -32
- package/mcp-docs/mobile/components/DotCount.txt +15 -16
- package/mcp-docs/mobile/components/DotStatusColor.txt +12 -13
- package/mcp-docs/mobile/components/DotSymbol.txt +21 -22
- package/mcp-docs/mobile/components/Fallback.txt +49 -50
- package/mcp-docs/mobile/components/FloatingAssetCard.txt +13 -14
- package/mcp-docs/mobile/components/HStack.txt +99 -100
- package/mcp-docs/mobile/components/HeroSquare.txt +11 -12
- package/mcp-docs/mobile/components/Icon.txt +16 -17
- package/mcp-docs/mobile/components/IconButton.txt +104 -105
- package/mcp-docs/mobile/components/InputChip.txt +62 -63
- package/mcp-docs/mobile/components/Interactable.txt +72 -73
- package/mcp-docs/mobile/components/LineChart.txt +117 -118
- package/mcp-docs/mobile/components/Link.txt +113 -114
- package/mcp-docs/mobile/components/ListCell.txt +149 -128
- package/mcp-docs/mobile/components/LogoMark.txt +8 -9
- package/mcp-docs/mobile/components/LogoWordMark.txt +7 -8
- package/mcp-docs/mobile/components/Lottie.txt +39 -40
- package/mcp-docs/mobile/components/LottieStatusAnimation.txt +11 -12
- package/mcp-docs/mobile/components/Modal.txt +36 -37
- package/mcp-docs/mobile/components/ModalBody.txt +5 -6
- package/mcp-docs/mobile/components/ModalFooter.txt +5 -6
- package/mcp-docs/mobile/components/ModalHeader.txt +5 -6
- package/mcp-docs/mobile/components/MultiContentModule.txt +107 -108
- package/mcp-docs/mobile/components/NavigationTitle.txt +13 -14
- package/mcp-docs/mobile/components/NavigationTitleSelect.txt +20 -21
- package/mcp-docs/mobile/components/NudgeCard.txt +20 -21
- package/mcp-docs/mobile/components/Numpad.txt +108 -109
- package/mcp-docs/mobile/components/Overlay.txt +45 -46
- package/mcp-docs/mobile/components/PageFooter.txt +57 -58
- package/mcp-docs/mobile/components/PageHeader.txt +79 -80
- package/mcp-docs/mobile/components/PeriodSelector.txt +98 -99
- package/mcp-docs/mobile/components/Pictogram.txt +11 -12
- package/mcp-docs/mobile/components/Point.txt +21 -22
- package/mcp-docs/mobile/components/PortalProvider.txt +7 -8
- package/mcp-docs/mobile/components/Pressable.txt +67 -68
- package/mcp-docs/mobile/components/ProgressBar.txt +18 -19
- package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +13 -14
- package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +13 -14
- package/mcp-docs/mobile/components/ProgressCircle.txt +22 -23
- package/mcp-docs/mobile/components/Radio.txt +35 -36
- package/mcp-docs/mobile/components/RadioCell.txt +73 -74
- package/mcp-docs/mobile/components/RadioGroup.txt +35 -36
- package/mcp-docs/mobile/components/ReferenceLine.txt +15 -16
- package/mcp-docs/mobile/components/RemoteImage.txt +47 -48
- package/mcp-docs/mobile/components/RemoteImageGroup.txt +11 -12
- package/mcp-docs/mobile/components/RollingNumber.txt +130 -131
- package/mcp-docs/mobile/components/Scrubber.txt +19 -20
- package/mcp-docs/mobile/components/SearchInput.txt +77 -78
- package/mcp-docs/mobile/components/SectionHeader.txt +16 -17
- package/mcp-docs/mobile/components/SegmentedTabs.txt +105 -106
- package/mcp-docs/mobile/components/Select.txt +35 -36
- package/mcp-docs/mobile/components/SelectChip.txt +143 -144
- package/mcp-docs/mobile/components/SelectOption.txt +26 -27
- package/mcp-docs/mobile/components/SlideButton.txt +128 -129
- package/mcp-docs/mobile/components/Spacer.txt +27 -28
- package/mcp-docs/mobile/components/Sparkline.txt +18 -19
- package/mcp-docs/mobile/components/SparklineGradient.txt +18 -19
- package/mcp-docs/mobile/components/SparklineInteractive.txt +37 -38
- package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +12 -13
- package/mcp-docs/mobile/components/Spinner.txt +15 -16
- package/mcp-docs/mobile/components/SpotIcon.txt +11 -12
- package/mcp-docs/mobile/components/SpotRectangle.txt +11 -12
- package/mcp-docs/mobile/components/SpotSquare.txt +11 -12
- package/mcp-docs/mobile/components/Stepper.txt +113 -114
- package/mcp-docs/mobile/components/SubBrandLogoMark.txt +8 -9
- package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +8 -9
- package/mcp-docs/mobile/components/Switch.txt +35 -36
- package/mcp-docs/mobile/components/TabIndicator.txt +12 -13
- package/mcp-docs/mobile/components/TabLabel.txt +28 -29
- package/mcp-docs/mobile/components/TabNavigation.txt +41 -42
- package/mcp-docs/mobile/components/TabbedChips.txt +38 -39
- package/mcp-docs/mobile/components/Tabs.txt +76 -77
- package/mcp-docs/mobile/components/Tag.txt +102 -103
- package/mcp-docs/mobile/components/Text.txt +91 -92
- package/mcp-docs/mobile/components/TextInput.txt +107 -108
- package/mcp-docs/mobile/components/ThemeProvider.txt +8 -9
- package/mcp-docs/mobile/components/Toast.txt +82 -83
- package/mcp-docs/mobile/components/Tooltip.txt +20 -21
- package/mcp-docs/mobile/components/TopNavBar.txt +55 -56
- package/mcp-docs/mobile/components/Tour.txt +18 -19
- package/mcp-docs/mobile/components/Tray.txt +43 -44
- package/mcp-docs/mobile/components/UpsellCard.txt +16 -17
- package/mcp-docs/mobile/components/VStack.txt +99 -100
- package/mcp-docs/mobile/components/XAxis.txt +25 -26
- package/mcp-docs/mobile/components/YAxis.txt +26 -27
- package/mcp-docs/mobile/getting-started/{mcp-server.txt → ai-overview.txt} +51 -37
- package/mcp-docs/mobile/getting-started/installation.txt +57 -0
- package/mcp-docs/mobile/getting-started/introduction.txt +3 -0
- package/mcp-docs/mobile/getting-started/playground.txt +3 -0
- package/mcp-docs/mobile/getting-started/styling.txt +84 -0
- package/mcp-docs/mobile/getting-started/theming.txt +286 -0
- package/mcp-docs/mobile/hooks/useDimensions.txt +27 -2
- package/mcp-docs/mobile/hooks/useEventHandler.txt +120 -0
- package/mcp-docs/mobile/hooks/useMergeRefs.txt +116 -0
- package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +67 -2
- package/mcp-docs/mobile/hooks/usePreviousValue.txt +74 -0
- package/mcp-docs/mobile/hooks/useRefMap.txt +178 -0
- package/mcp-docs/mobile/hooks/useTheme.txt +213 -2
- package/mcp-docs/mobile/routes.txt +8 -1
- package/mcp-docs/web/components/Accordion.txt +12 -13
- package/mcp-docs/web/components/AccordionItem.txt +5 -6
- package/mcp-docs/web/components/Alert.txt +24 -25
- package/mcp-docs/web/components/AreaChart.txt +137 -138
- package/mcp-docs/web/components/Avatar.txt +91 -92
- package/mcp-docs/web/components/AvatarButton.txt +113 -114
- package/mcp-docs/web/components/Banner.txt +101 -102
- package/mcp-docs/web/components/BarChart.txt +367 -368
- package/mcp-docs/web/components/Box.txt +65 -66
- package/mcp-docs/web/components/Button.txt +81 -82
- package/mcp-docs/web/components/ButtonGroup.txt +10 -11
- package/mcp-docs/web/components/Calendar.txt +56 -57
- package/mcp-docs/web/components/Carousel.txt +116 -117
- package/mcp-docs/web/components/CartesianChart.txt +357 -358
- package/mcp-docs/web/components/CellMedia.txt +14 -15
- package/mcp-docs/web/components/Checkbox.txt +22 -23
- package/mcp-docs/web/components/CheckboxCell.txt +70 -71
- package/mcp-docs/web/components/CheckboxGroup.txt +15 -16
- package/mcp-docs/web/components/Chip.txt +67 -68
- package/mcp-docs/web/components/Coachmark.txt +69 -70
- package/mcp-docs/web/components/Collapsible.txt +15 -16
- package/mcp-docs/web/components/ContainedAssetCard.txt +108 -109
- package/mcp-docs/web/components/ContentCard.txt +101 -102
- package/mcp-docs/web/components/ContentCardBody.txt +23 -24
- package/mcp-docs/web/components/ContentCardFooter.txt +19 -20
- package/mcp-docs/web/components/ContentCardHeader.txt +33 -34
- package/mcp-docs/web/components/ContentCell.txt +85 -86
- package/mcp-docs/web/components/ControlGroup.txt +108 -109
- package/mcp-docs/web/components/DatePicker.txt +59 -60
- package/mcp-docs/web/components/Divider.txt +31 -32
- package/mcp-docs/web/components/DotCount.txt +17 -18
- package/mcp-docs/web/components/DotStatusColor.txt +12 -13
- package/mcp-docs/web/components/DotSymbol.txt +24 -25
- package/mcp-docs/web/components/Dropdown.txt +31 -32
- package/mcp-docs/web/components/Fallback.txt +49 -50
- package/mcp-docs/web/components/FloatingAssetCard.txt +108 -109
- package/mcp-docs/web/components/FullscreenAlert.txt +20 -21
- package/mcp-docs/web/components/FullscreenModal.txt +28 -29
- package/mcp-docs/web/components/FullscreenModalLayout.txt +19 -20
- package/mcp-docs/web/components/Grid.txt +106 -107
- package/mcp-docs/web/components/GridColumn.txt +96 -97
- package/mcp-docs/web/components/HStack.txt +101 -102
- package/mcp-docs/web/components/HeroSquare.txt +12 -13
- package/mcp-docs/web/components/Icon.txt +27 -28
- package/mcp-docs/web/components/IconButton.txt +117 -118
- package/mcp-docs/web/components/InputChip.txt +62 -63
- package/mcp-docs/web/components/Interactable.txt +75 -76
- package/mcp-docs/web/components/LineChart.txt +366 -367
- package/mcp-docs/web/components/Link.txt +114 -115
- package/mcp-docs/web/components/ListCell.txt +157 -136
- package/mcp-docs/web/components/LogoMark.txt +8 -9
- package/mcp-docs/web/components/LogoWordMark.txt +7 -8
- package/mcp-docs/web/components/Lottie.txt +44 -45
- package/mcp-docs/web/components/LottieStatusAnimation.txt +11 -12
- package/mcp-docs/web/components/MediaQueryProvider.txt +7 -8
- package/mcp-docs/web/components/Modal.txt +69 -66
- package/mcp-docs/web/components/ModalBody.txt +5 -6
- package/mcp-docs/web/components/ModalFooter.txt +5 -6
- package/mcp-docs/web/components/ModalHeader.txt +5 -6
- package/mcp-docs/web/components/MultiContentModule.txt +109 -110
- package/mcp-docs/web/components/NavigationBar.txt +18 -19
- package/mcp-docs/web/components/NavigationTitle.txt +7 -8
- package/mcp-docs/web/components/NavigationTitleSelect.txt +9 -10
- package/mcp-docs/web/components/NudgeCard.txt +61 -62
- package/mcp-docs/web/components/Overlay.txt +57 -58
- package/mcp-docs/web/components/PageFooter.txt +77 -78
- package/mcp-docs/web/components/PageHeader.txt +107 -108
- package/mcp-docs/web/components/Pagination.txt +115 -116
- package/mcp-docs/web/components/PeriodSelector.txt +158 -159
- package/mcp-docs/web/components/Pictogram.txt +13 -14
- package/mcp-docs/web/components/Point.txt +169 -170
- package/mcp-docs/web/components/PortalProvider.txt +6 -7
- package/mcp-docs/web/components/Pressable.txt +73 -74
- package/mcp-docs/web/components/ProgressBar.txt +20 -21
- package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +15 -16
- package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +15 -16
- package/mcp-docs/web/components/ProgressCircle.txt +24 -25
- package/mcp-docs/web/components/Radio.txt +22 -23
- package/mcp-docs/web/components/RadioCell.txt +83 -84
- package/mcp-docs/web/components/RadioGroup.txt +22 -23
- package/mcp-docs/web/components/ReferenceLine.txt +22 -23
- package/mcp-docs/web/components/RemoteImage.txt +49 -50
- package/mcp-docs/web/components/RemoteImageGroup.txt +11 -12
- package/mcp-docs/web/components/RollingNumber.txt +131 -132
- package/mcp-docs/web/components/Scrubber.txt +22 -23
- package/mcp-docs/web/components/SearchInput.txt +29 -30
- package/mcp-docs/web/components/SectionHeader.txt +98 -99
- package/mcp-docs/web/components/SegmentedTabs.txt +109 -110
- package/mcp-docs/web/components/Select.txt +22 -23
- package/mcp-docs/web/components/SelectChip.txt +134 -135
- package/mcp-docs/web/components/SelectOption.txt +31 -32
- package/mcp-docs/web/components/Sidebar.txt +109 -110
- package/mcp-docs/web/components/SidebarItem.txt +6 -7
- package/mcp-docs/web/components/SidebarMoreMenu.txt +5 -6
- package/mcp-docs/web/components/Spacer.txt +57 -58
- package/mcp-docs/web/components/Sparkline.txt +18 -19
- package/mcp-docs/web/components/SparklineGradient.txt +18 -19
- package/mcp-docs/web/components/SparklineInteractive.txt +34 -35
- package/mcp-docs/web/components/SparklineInteractiveHeader.txt +12 -13
- package/mcp-docs/web/components/Spinner.txt +15 -16
- package/mcp-docs/web/components/SpotIcon.txt +12 -13
- package/mcp-docs/web/components/SpotRectangle.txt +12 -13
- package/mcp-docs/web/components/SpotSquare.txt +12 -13
- package/mcp-docs/web/components/Stepper.txt +119 -120
- package/mcp-docs/web/components/SubBrandLogoMark.txt +8 -9
- package/mcp-docs/web/components/SubBrandLogoWordMark.txt +8 -9
- package/mcp-docs/web/components/Switch.txt +23 -24
- package/mcp-docs/web/components/TabIndicator.txt +12 -13
- package/mcp-docs/web/components/TabLabel.txt +28 -29
- package/mcp-docs/web/components/TabNavigation.txt +41 -42
- package/mcp-docs/web/components/TabbedChips.txt +38 -39
- package/mcp-docs/web/components/Table.txt +17 -18
- package/mcp-docs/web/components/TableBody.txt +9 -10
- package/mcp-docs/web/components/TableCaption.txt +13 -14
- package/mcp-docs/web/components/TableCell.txt +21 -22
- package/mcp-docs/web/components/TableCellFallback.txt +16 -17
- package/mcp-docs/web/components/TableFooter.txt +9 -10
- package/mcp-docs/web/components/TableHeader.txt +10 -11
- package/mcp-docs/web/components/TableRow.txt +13 -14
- package/mcp-docs/web/components/Tabs.txt +94 -95
- package/mcp-docs/web/components/Tag.txt +106 -107
- package/mcp-docs/web/components/Text.txt +110 -111
- package/mcp-docs/web/components/TextInput.txt +32 -33
- package/mcp-docs/web/components/ThemeProvider.txt +27 -28
- package/mcp-docs/web/components/TileButton.txt +37 -38
- package/mcp-docs/web/components/Toast.txt +82 -83
- package/mcp-docs/web/components/Tooltip.txt +22 -23
- package/mcp-docs/web/components/Tour.txt +21 -22
- package/mcp-docs/web/components/Tray.txt +23 -24
- package/mcp-docs/web/components/UpsellCard.txt +16 -17
- package/mcp-docs/web/components/VStack.txt +101 -102
- package/mcp-docs/web/components/XAxis.txt +25 -26
- package/mcp-docs/web/components/YAxis.txt +26 -27
- package/mcp-docs/web/getting-started/{mcp-server.txt → ai-overview.txt} +51 -37
- package/mcp-docs/web/getting-started/installation.txt +103 -0
- package/mcp-docs/web/getting-started/introduction.txt +3 -0
- package/mcp-docs/web/getting-started/playground.txt +3 -0
- package/mcp-docs/web/getting-started/styling.txt +161 -0
- package/mcp-docs/web/getting-started/templates.txt +121 -0
- package/mcp-docs/web/getting-started/theming.txt +426 -0
- package/mcp-docs/web/hooks/useBreakpoints.txt +30 -2
- package/mcp-docs/web/hooks/useDimensions.txt +61 -2
- package/mcp-docs/web/hooks/useEventHandler.txt +120 -0
- package/mcp-docs/web/hooks/useHasMounted.txt +22 -2
- package/mcp-docs/web/hooks/useIsoEffect.txt +18 -2
- package/mcp-docs/web/hooks/useMediaQuery.txt +22 -2
- package/mcp-docs/web/hooks/useMergeRefs.txt +116 -0
- package/mcp-docs/web/hooks/useOverlayContentContext.txt +64 -2
- package/mcp-docs/web/hooks/usePreviousValue.txt +74 -0
- package/mcp-docs/web/hooks/useRefMap.txt +178 -0
- package/mcp-docs/web/hooks/useScrollBlocker.txt +21 -2
- package/mcp-docs/web/hooks/useTheme.txt +261 -2
- package/mcp-docs/web/routes.txt +9 -1
- package/package.json +1 -1
|
@@ -4,35 +4,10 @@ A horizontal axis component for CartesianChart. Displays tick marks, labels, gri
|
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```tsx
|
|
8
8
|
import { XAxis } from '@coinbase/cds-mobile-visualization'
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
## Props
|
|
12
|
-
|
|
13
|
-
| Prop | Type | Required | Default | Description |
|
|
14
|
-
| --- | --- | --- | --- | --- |
|
|
15
|
-
| `GridLineComponent` | `LineComponent` | No | `DottedLine` | Component to render the grid lines. |
|
|
16
|
-
| `className` | `string` | No | `-` | Custom className for the axis. |
|
|
17
|
-
| `classNames` | `{ root?: string; tickLabel?: string \| undefined; gridLine?: string \| undefined; line?: string \| undefined; tickMark?: string \| undefined; } \| undefined` | No | `-` | Custom classNames for the axis. |
|
|
18
|
-
| `height` | `number` | No | `32` | Height of the axis. This value is inclusive of the padding. |
|
|
19
|
-
| `minTickLabelGap` | `number` | No | `4` | Minimum gap between tick labels. Labels will be hidden if they are closer than this gap. |
|
|
20
|
-
| `position` | `top \| bottom` | No | `'bottom'` | The position of the axis relative to the charts drawing area. |
|
|
21
|
-
| `requestedTickCount` | `number` | No | `5 (for y-axis)` | Requested number of ticks to display. This value is passed into d3 and may not be respected. |
|
|
22
|
-
| `showGrid` | `boolean` | No | `-` | Whether to show grid lines at each tick position. |
|
|
23
|
-
| `showLine` | `boolean` | No | `-` | Whether to show the axis line. |
|
|
24
|
-
| `showTickMarks` | `boolean` | No | `-` | Whether to show tick marks on the axis. |
|
|
25
|
-
| `style` | `CSSProperties` | No | `-` | Custom style for the axis. |
|
|
26
|
-
| `styles` | `{ root?: CSSProperties; tickLabel?: CSSProperties \| undefined; gridLine?: CSSProperties \| undefined; line?: CSSProperties \| undefined; tickMark?: CSSProperties \| undefined; } \| undefined` | No | `-` | Custom styles for the axis. |
|
|
27
|
-
| `tickInterval` | `number` | No | `32 (for x-axis)` | Interval at which to show ticks. When provided, calculates tick count based on available space. |
|
|
28
|
-
| `tickLabelFormatter` | `((value: any) => ChartTextChildren)` | No | `-` | Formatter function for axis tick values. Tick values will be wrapped in ChartText component. |
|
|
29
|
-
| `tickMarkLabelGap` | `number` | No | `2 for x-axis, 8 for y-axis` | Space between the axis tick mark and labels. If tick marks are not shown, this is the gap between the axis and the chart. |
|
|
30
|
-
| `tickMarkSize` | `number` | No | `4` | Size of the tick marks. |
|
|
31
|
-
| `tickMaxStep` | `number` | No | `-` | Maximum step size for tick generation. Prevents the step from being larger than this value. |
|
|
32
|
-
| `tickMinStep` | `number` | No | `1` | Minimum step size for tick generation. Prevents the step from being smaller than this value. |
|
|
33
|
-
| `ticks` | `number[] \| ((value: number) => boolean)` | No | `-` | Custom tick configuration for the axis. When provided, this overrides the requestedTickCount property. - **Array**: Uses these exact values for tick positioning and labels. - **Function**: Filters based on the predicate function. - For **x-axis**: Checks every data index (0, 1, 2, ..., dataLength-1) - For **y-axis**: Filters d3-generated tick values |
|
|
34
|
-
|
|
35
|
-
|
|
36
11
|
## Examples
|
|
37
12
|
|
|
38
13
|
### Basic Example
|
|
@@ -619,4 +594,28 @@ If no data is set for the axis, it will receive the regular number value of the
|
|
|
619
594
|
</CartesianChart>
|
|
620
595
|
```
|
|
621
596
|
|
|
597
|
+
## Props
|
|
598
|
+
|
|
599
|
+
| Prop | Type | Required | Default | Description |
|
|
600
|
+
| --- | --- | --- | --- | --- |
|
|
601
|
+
| `GridLineComponent` | `LineComponent` | No | `DottedLine` | Component to render the grid lines. |
|
|
602
|
+
| `className` | `string` | No | `-` | Custom className for the axis. |
|
|
603
|
+
| `classNames` | `{ root?: string; tickLabel?: string \| undefined; gridLine?: string \| undefined; line?: string \| undefined; tickMark?: string \| undefined; } \| undefined` | No | `-` | Custom classNames for the axis. |
|
|
604
|
+
| `height` | `number` | No | `32` | Height of the axis. This value is inclusive of the padding. |
|
|
605
|
+
| `minTickLabelGap` | `number` | No | `4` | Minimum gap between tick labels. Labels will be hidden if they are closer than this gap. |
|
|
606
|
+
| `position` | `top \| bottom` | No | `'bottom'` | The position of the axis relative to the charts drawing area. |
|
|
607
|
+
| `requestedTickCount` | `number` | No | `5 (for y-axis)` | Requested number of ticks to display. This value is passed into d3 and may not be respected. |
|
|
608
|
+
| `showGrid` | `boolean` | No | `-` | Whether to show grid lines at each tick position. |
|
|
609
|
+
| `showLine` | `boolean` | No | `-` | Whether to show the axis line. |
|
|
610
|
+
| `showTickMarks` | `boolean` | No | `-` | Whether to show tick marks on the axis. |
|
|
611
|
+
| `style` | `CSSProperties` | No | `-` | Custom style for the axis. |
|
|
612
|
+
| `styles` | `{ root?: CSSProperties; tickLabel?: CSSProperties \| undefined; gridLine?: CSSProperties \| undefined; line?: CSSProperties \| undefined; tickMark?: CSSProperties \| undefined; } \| undefined` | No | `-` | Custom styles for the axis. |
|
|
613
|
+
| `tickInterval` | `number` | No | `32 (for x-axis)` | Interval at which to show ticks. When provided, calculates tick count based on available space. |
|
|
614
|
+
| `tickLabelFormatter` | `((value: any) => ChartTextChildren)` | No | `-` | Formatter function for axis tick values. Tick values will be wrapped in ChartText component. |
|
|
615
|
+
| `tickMarkLabelGap` | `number` | No | `2 for x-axis, 8 for y-axis` | Space between the axis tick mark and labels. If tick marks are not shown, this is the gap between the axis and the chart. |
|
|
616
|
+
| `tickMarkSize` | `number` | No | `4` | Size of the tick marks. |
|
|
617
|
+
| `tickMaxStep` | `number` | No | `-` | Maximum step size for tick generation. Prevents the step from being larger than this value. |
|
|
618
|
+
| `tickMinStep` | `number` | No | `1` | Minimum step size for tick generation. Prevents the step from being smaller than this value. |
|
|
619
|
+
| `ticks` | `number[] \| ((value: number) => boolean)` | No | `-` | Custom tick configuration for the axis. When provided, this overrides the requestedTickCount property. - **Array**: Uses these exact values for tick positioning and labels. - **Function**: Filters based on the predicate function. - For **x-axis**: Checks every data index (0, 1, 2, ..., dataLength-1) - For **y-axis**: Filters d3-generated tick values |
|
|
620
|
+
|
|
622
621
|
|
|
@@ -4,36 +4,10 @@ A vertical axis component for CartesianChart. Displays tick marks, labels, gridl
|
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```tsx
|
|
8
8
|
import { YAxis } from '@coinbase/cds-mobile-visualization'
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
## Props
|
|
12
|
-
|
|
13
|
-
| Prop | Type | Required | Default | Description |
|
|
14
|
-
| --- | --- | --- | --- | --- |
|
|
15
|
-
| `GridLineComponent` | `LineComponent` | No | `DottedLine` | Component to render the grid lines. |
|
|
16
|
-
| `axisId` | `string` | No | `-` | The ID of the axis to render. Defaults to defaultAxisId if not specified. |
|
|
17
|
-
| `className` | `string` | No | `-` | Custom className for the axis. |
|
|
18
|
-
| `classNames` | `{ root?: string; tickLabel?: string \| undefined; gridLine?: string \| undefined; line?: string \| undefined; tickMark?: string \| undefined; } \| undefined` | No | `-` | Custom classNames for the axis. |
|
|
19
|
-
| `minTickLabelGap` | `number` | No | `4` | Minimum gap between tick labels. Labels will be hidden if they are closer than this gap. |
|
|
20
|
-
| `position` | `left \| right` | No | `'right'` | The position of the axis relative to the charts drawing area. |
|
|
21
|
-
| `requestedTickCount` | `number` | No | `5 (for y-axis)` | Requested number of ticks to display. This value is passed into d3 and may not be respected. |
|
|
22
|
-
| `showGrid` | `boolean` | No | `-` | Whether to show grid lines at each tick position. |
|
|
23
|
-
| `showLine` | `boolean` | No | `-` | Whether to show the axis line. |
|
|
24
|
-
| `showTickMarks` | `boolean` | No | `-` | Whether to show tick marks on the axis. |
|
|
25
|
-
| `style` | `CSSProperties` | No | `-` | Custom style for the axis. |
|
|
26
|
-
| `styles` | `{ root?: CSSProperties; tickLabel?: CSSProperties \| undefined; gridLine?: CSSProperties \| undefined; line?: CSSProperties \| undefined; tickMark?: CSSProperties \| undefined; } \| undefined` | No | `-` | Custom styles for the axis. |
|
|
27
|
-
| `tickInterval` | `number` | No | `32 (for x-axis)` | Interval at which to show ticks. When provided, calculates tick count based on available space. |
|
|
28
|
-
| `tickLabelFormatter` | `((value: any) => ChartTextChildren)` | No | `-` | Formatter function for axis tick values. Tick values will be wrapped in ChartText component. |
|
|
29
|
-
| `tickMarkLabelGap` | `number` | No | `2 for x-axis, 8 for y-axis` | Space between the axis tick mark and labels. If tick marks are not shown, this is the gap between the axis and the chart. |
|
|
30
|
-
| `tickMarkSize` | `number` | No | `4` | Size of the tick marks. |
|
|
31
|
-
| `tickMaxStep` | `number` | No | `-` | Maximum step size for tick generation. Prevents the step from being larger than this value. |
|
|
32
|
-
| `tickMinStep` | `number` | No | `1` | Minimum step size for tick generation. Prevents the step from being smaller than this value. |
|
|
33
|
-
| `ticks` | `number[] \| ((value: number) => boolean)` | No | `-` | Custom tick configuration for the axis. When provided, this overrides the requestedTickCount property. - **Array**: Uses these exact values for tick positioning and labels. - **Function**: Filters based on the predicate function. - For **x-axis**: Checks every data index (0, 1, 2, ..., dataLength-1) - For **y-axis**: Filters d3-generated tick values |
|
|
34
|
-
| `width` | `number` | No | `44` | Width of the axis. This value is inclusive of the padding. |
|
|
35
|
-
|
|
36
|
-
|
|
37
11
|
## Examples
|
|
38
12
|
|
|
39
13
|
### Basic Example
|
|
@@ -565,4 +539,29 @@ function MultipleYAxesExample() {
|
|
|
565
539
|
}
|
|
566
540
|
```
|
|
567
541
|
|
|
542
|
+
## Props
|
|
543
|
+
|
|
544
|
+
| Prop | Type | Required | Default | Description |
|
|
545
|
+
| --- | --- | --- | --- | --- |
|
|
546
|
+
| `GridLineComponent` | `LineComponent` | No | `DottedLine` | Component to render the grid lines. |
|
|
547
|
+
| `axisId` | `string` | No | `-` | The ID of the axis to render. Defaults to defaultAxisId if not specified. |
|
|
548
|
+
| `className` | `string` | No | `-` | Custom className for the axis. |
|
|
549
|
+
| `classNames` | `{ root?: string; tickLabel?: string \| undefined; gridLine?: string \| undefined; line?: string \| undefined; tickMark?: string \| undefined; } \| undefined` | No | `-` | Custom classNames for the axis. |
|
|
550
|
+
| `minTickLabelGap` | `number` | No | `4` | Minimum gap between tick labels. Labels will be hidden if they are closer than this gap. |
|
|
551
|
+
| `position` | `left \| right` | No | `'right'` | The position of the axis relative to the charts drawing area. |
|
|
552
|
+
| `requestedTickCount` | `number` | No | `5 (for y-axis)` | Requested number of ticks to display. This value is passed into d3 and may not be respected. |
|
|
553
|
+
| `showGrid` | `boolean` | No | `-` | Whether to show grid lines at each tick position. |
|
|
554
|
+
| `showLine` | `boolean` | No | `-` | Whether to show the axis line. |
|
|
555
|
+
| `showTickMarks` | `boolean` | No | `-` | Whether to show tick marks on the axis. |
|
|
556
|
+
| `style` | `CSSProperties` | No | `-` | Custom style for the axis. |
|
|
557
|
+
| `styles` | `{ root?: CSSProperties; tickLabel?: CSSProperties \| undefined; gridLine?: CSSProperties \| undefined; line?: CSSProperties \| undefined; tickMark?: CSSProperties \| undefined; } \| undefined` | No | `-` | Custom styles for the axis. |
|
|
558
|
+
| `tickInterval` | `number` | No | `32 (for x-axis)` | Interval at which to show ticks. When provided, calculates tick count based on available space. |
|
|
559
|
+
| `tickLabelFormatter` | `((value: any) => ChartTextChildren)` | No | `-` | Formatter function for axis tick values. Tick values will be wrapped in ChartText component. |
|
|
560
|
+
| `tickMarkLabelGap` | `number` | No | `2 for x-axis, 8 for y-axis` | Space between the axis tick mark and labels. If tick marks are not shown, this is the gap between the axis and the chart. |
|
|
561
|
+
| `tickMarkSize` | `number` | No | `4` | Size of the tick marks. |
|
|
562
|
+
| `tickMaxStep` | `number` | No | `-` | Maximum step size for tick generation. Prevents the step from being larger than this value. |
|
|
563
|
+
| `tickMinStep` | `number` | No | `1` | Minimum step size for tick generation. Prevents the step from being smaller than this value. |
|
|
564
|
+
| `ticks` | `number[] \| ((value: number) => boolean)` | No | `-` | Custom tick configuration for the axis. When provided, this overrides the requestedTickCount property. - **Array**: Uses these exact values for tick positioning and labels. - **Function**: Filters based on the predicate function. - For **x-axis**: Checks every data index (0, 1, 2, ..., dataLength-1) - For **y-axis**: Filters d3-generated tick values |
|
|
565
|
+
| `width` | `number` | No | `44` | Width of the axis. This value is inclusive of the padding. |
|
|
566
|
+
|
|
568
567
|
|
|
@@ -1,41 +1,30 @@
|
|
|
1
1
|
---
|
|
2
|
-
id:
|
|
3
|
-
title:
|
|
2
|
+
id: ai-overview
|
|
3
|
+
title: AI Overview
|
|
4
4
|
hide_title: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
import { VStack } from '@coinbase/cds-web/layout';
|
|
7
8
|
import { MDXSection } from '@site/src/components/page/MDXSection';
|
|
8
9
|
import { MDXArticle } from '@site/src/components/page/MDXArticle';
|
|
9
10
|
import { ContentHeader } from '@site/src/components/page/ContentHeader';
|
|
10
11
|
|
|
12
|
+
<VStack gap={5}>
|
|
11
13
|
<ContentHeader
|
|
12
|
-
title="
|
|
13
|
-
description="
|
|
14
|
+
title="AI Overview"
|
|
15
|
+
description="Use AI as your CDS development partner to build consistent, accessible user interfaces across web and mobile platforms."
|
|
14
16
|
/>
|
|
15
17
|
|
|
16
18
|
<MDXSection>
|
|
17
19
|
<MDXArticle>
|
|
18
|
-
## What is it?
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
## MCP Server
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
> _MCP is an open protocol that standardizes how applications provide context to large language models (LLMs). MCP provides a standardized way to connect AI models to different data sources and tools. MCP enables you build agents and complex workflows on top of LLMs and connects your models with the world._
|
|
25
|
-
|
|
26
|
-
</MDXArticle>
|
|
27
|
-
</MDXSection>
|
|
23
|
+
The CDS MCP Server provides direct CDS context to LLMs, allowing AI models to understand and work with CDS APIs and components.
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
<MDXArticle>
|
|
31
|
-
## Basic installation
|
|
32
|
-
|
|
33
|
-
The CDS MCP server is published in the `@coinbase/cds-mcp-server` package.
|
|
34
|
-
|
|
35
|
-
This package is automatically included as a dependency of the CDS libraries, ensuring the CDS library and CDS MCP Server versions match. You do not need to install it separately if you are using the CDS libraries.
|
|
25
|
+
From [modelcontextprotocol.io](https://modelcontextprotocol.io/docs/getting-started/intro):
|
|
36
26
|
|
|
37
|
-
|
|
38
|
-
<MDXArticle>
|
|
27
|
+
> _MCP is an open protocol that standardizes how applications provide context to large language models (LLMs). MCP provides a standardized way to connect AI models to different data sources and tools._
|
|
39
28
|
|
|
40
29
|
### First time setup
|
|
41
30
|
|
|
@@ -50,45 +39,70 @@ Make sure to enable the MCP server after installation.<br />
|
|
|
50
39
|
See the [Cursor docs here](https://cursor.com/docs/context/mcp#using-mcp-in-chat) and the [Claude Code docs here](https://docs.claude.com/en/docs/claude-code/mcp#managing-your-servers) for more information.
|
|
51
40
|
:::
|
|
52
41
|
|
|
53
|
-
</MDXArticle>
|
|
54
|
-
<MDXArticle>
|
|
55
|
-
|
|
56
42
|
### Using the MCP server
|
|
57
43
|
|
|
58
44
|
Once the CDS MCP Server is enabled in your agent, the agent will automatically be able to use the CDS MCP tools to interact with the CDS APIs and components.
|
|
59
45
|
|
|
60
46
|
Try asking a question like "How can I add an icon to a CDS Button?" or "How can I customize the CDS Stepper component behavior?"
|
|
61
47
|
|
|
62
|
-
|
|
63
|
-
</MDXSection>
|
|
64
|
-
|
|
65
|
-
<MDXSection>
|
|
66
|
-
<MDXArticle>
|
|
67
|
-
## Advanced installation
|
|
48
|
+
### Advanced installation
|
|
68
49
|
|
|
69
|
-
To install the MCP server separately as a standalone package and add it as a dependency to your project
|
|
50
|
+
To install the MCP server separately as a standalone package and add it as a dependency to your project:
|
|
70
51
|
|
|
71
52
|
```bash
|
|
72
53
|
npm install @coinbase/cds-mcp-server
|
|
73
54
|
```
|
|
74
55
|
|
|
75
|
-
|
|
56
|
+
Or with Yarn:
|
|
76
57
|
|
|
77
58
|
```bash
|
|
78
59
|
yarn add @coinbase/cds-mcp-server
|
|
79
60
|
```
|
|
80
61
|
|
|
81
62
|
:::tip
|
|
82
|
-
Avoid installing mismatched versions of the CDS libraries and the CDS MCP Server.
|
|
63
|
+
Avoid installing mismatched versions of the CDS libraries and the CDS MCP Server. The MCP server is automatically included as a dependency of the CDS libraries.
|
|
83
64
|
:::
|
|
84
65
|
|
|
85
|
-
|
|
66
|
+
</MDXArticle>
|
|
67
|
+
</MDXSection>
|
|
86
68
|
|
|
87
|
-
|
|
69
|
+
<MDXSection>
|
|
70
|
+
<MDXArticle>
|
|
71
|
+
|
|
72
|
+
## Documentation
|
|
73
|
+
|
|
74
|
+
Documentation pages include "View as markdown" and "Copy page" buttons in a markdown like format.
|
|
75
|
+
This is useful when pasting documentation into ChatGPT, Claude, or Perplexity for help with implementation.
|
|
76
|
+
|
|
77
|
+
### Documentation indexes
|
|
78
|
+
|
|
79
|
+
CDS also provides a comprehensive index of documentation in markdown format per platform:
|
|
80
|
+
|
|
81
|
+
**Web:**
|
|
88
82
|
|
|
89
|
-
```bash
|
|
90
|
-
npx @coinbase/cds-mcp-server
|
|
91
83
|
```
|
|
84
|
+
https://cds.coinbase.com/llms/web/routes.txt
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Mobile:**
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
https://cds.coinbase.com/llms/mobile/routes.txt
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Each routes file contains links to all component documentation, React hooks, getting started guides, and brief descriptions for each item.
|
|
94
|
+
|
|
95
|
+
#### Adding indexes to Cursor
|
|
96
|
+
|
|
97
|
+
You can add these indexes to Cursor for searchable access to the entire CDS documentation library:
|
|
98
|
+
|
|
99
|
+
1. Open Cursor Settings
|
|
100
|
+
2. Navigate to "Indexing & Docs"
|
|
101
|
+
3. Add the docs URL for your platform (web or mobile) using the routes links above
|
|
102
|
+
4. AI will automatically fetch relevant docs when you reference components
|
|
103
|
+
|
|
104
|
+
Other AI IDEs and assistants can be given these indexes as needed or added to their rule files.
|
|
92
105
|
|
|
93
106
|
</MDXArticle>
|
|
94
107
|
</MDXSection>
|
|
108
|
+
</VStack>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# installation
|
|
2
|
+
|
|
3
|
+
This guide will help you get started with installing CDS in your React Native project. Follow the instructions below to set up CDS and start building with our cross-platform components.
|
|
4
|
+
|
|
5
|
+
### Installation
|
|
6
|
+
|
|
7
|
+
To install the CDS library for React Native applications, run the following command:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @coinbase/cds-mobile
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Alternatively, if you are using Yarn:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add @coinbase/cds-mobile
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
:::tip
|
|
20
|
+
For React Native projects, ensure you have set up your environment for React Native development. Refer to the [React Native Environment Setup Guide](https://reactnative.dev/docs/environment-setup) if needed.
|
|
21
|
+
:::
|
|
22
|
+
|
|
23
|
+
### Getting started
|
|
24
|
+
#### 1. Render a ThemeProvider
|
|
25
|
+
|
|
26
|
+
Render a ThemeProvider at the root of your application, and pass the `theme` and `activeColorScheme`.
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { ThemeProvider } from '@coinbase/cds-mobile';
|
|
30
|
+
import { defaultTheme } from '@coinbase/cds-mobile/themes/defaultTheme';
|
|
31
|
+
import App from './App';
|
|
32
|
+
|
|
33
|
+
const Index = () => (
|
|
34
|
+
<ThemeProvider theme={defaultTheme} activeColorScheme="light">
|
|
35
|
+
<App />
|
|
36
|
+
</ThemeProvider>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export default Index;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
#### 2. Verify the installation
|
|
43
|
+
|
|
44
|
+
Try importing and rendering a simple CDS component.
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import { Button } from '@coinbase/cds-mobile/buttons';
|
|
48
|
+
|
|
49
|
+
const Test = () => <Button>Click Me</Button>;
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Next steps
|
|
53
|
+
|
|
54
|
+
Learn how to customize CDS's appearance.
|
|
55
|
+
|
|
56
|
+
[See the theming docs here →](/getting-started/theming)
|
|
57
|
+
|
|
@@ -4,11 +4,13 @@ title: Introduction
|
|
|
4
4
|
hide_title: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
import { VStack } from '@coinbase/cds-web/layout';
|
|
7
8
|
import { MDXSection } from '@site/src/components/page/MDXSection';
|
|
8
9
|
import { MDXArticle } from '@site/src/components/page/MDXArticle';
|
|
9
10
|
import { ContentHeader } from '@site/src/components/page/ContentHeader';
|
|
10
11
|
import { GettingStartedBanner } from '@site/src/components/page/ComponentBanner/GettingStartedBanner';
|
|
11
12
|
|
|
13
|
+
<VStack gap={5}>
|
|
12
14
|
<ContentHeader
|
|
13
15
|
title="Introduction"
|
|
14
16
|
description="Coinbase Design System is a cross-platform component library for React and React Native. CDS has high adoption in every product at Coinbase, accelerating development and ensuring a consistent user experience across all platforms."
|
|
@@ -97,3 +99,4 @@ Learn how to install and use CDS.
|
|
|
97
99
|
|
|
98
100
|
</MDXArticle>
|
|
99
101
|
</MDXSection>
|
|
102
|
+
</VStack>
|
|
@@ -4,12 +4,14 @@ title: Playground
|
|
|
4
4
|
hide_title: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
import { VStack } from '@coinbase/cds-web/layout';
|
|
7
8
|
import { MDXSection } from '@site/src/components/page/MDXSection';
|
|
8
9
|
import { MDXArticle } from '@site/src/components/page/MDXArticle';
|
|
9
10
|
import { ContentHeader } from '@site/src/components/page/ContentHeader';
|
|
10
11
|
import { PlaygroundBanner } from '@site/src/components/page/ComponentBanner/PlaygroundBanner';
|
|
11
12
|
import { ShareablePlayground } from '@site/src/components/page/ShareablePlayground';
|
|
12
13
|
|
|
14
|
+
<VStack gap={5}>
|
|
13
15
|
<ContentHeader
|
|
14
16
|
title="Playground"
|
|
15
17
|
description="Live code playground for testing and sharing CDS components and code examples. All CDS components and hooks and all React exports are available to use in the playground without importing them. You must call render() to render your code."
|
|
@@ -23,3 +25,4 @@ import { ShareablePlayground } from '@site/src/components/page/ShareablePlaygrou
|
|
|
23
25
|
|
|
24
26
|
</MDXArticle>
|
|
25
27
|
</MDXSection>
|
|
28
|
+
</VStack>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# styling
|
|
2
|
+
|
|
3
|
+
CDS includes powerful and flexible APIs for styling components. Easily access values from the theme, or go rogue with full customization.
|
|
4
|
+
|
|
5
|
+
### `StyleProps` API
|
|
6
|
+
|
|
7
|
+
Most components support the StyleProps API. StyleProps automatically have access to the values in the theme, and some StyleProps are limited to only the theme values.
|
|
8
|
+
|
|
9
|
+
[See the full list of StyleProps here →](/components/layout/Box/?platform=mobile&tab=props)
|
|
10
|
+
|
|
11
|
+
```jsx
|
|
12
|
+
// ✅ The `bgNegative` token will automatically update with the theme!
|
|
13
|
+
<Box background="bgNegative" width={100} />
|
|
14
|
+
|
|
15
|
+
// ❌ Error: Type '"#0000ff"' is not assignable to type 'Color | undefined'.
|
|
16
|
+
<Box background="#0000ff" width={100} />
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
:::tip
|
|
20
|
+
The docs page of every component has a props table listing all the available props!
|
|
21
|
+
:::
|
|
22
|
+
|
|
23
|
+
:::note
|
|
24
|
+
The StyleProps API uses the ThemeProvider Context under the hood to enable dynamic theming.
|
|
25
|
+
:::
|
|
26
|
+
|
|
27
|
+
### `style` and `styles` props
|
|
28
|
+
|
|
29
|
+
Most components support the native `style` prop for inline styles.
|
|
30
|
+
|
|
31
|
+
```jsx
|
|
32
|
+
<Box style={{ backgroundColor: '#0000ff' }} />
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Some complex components support passing inline styles to subcomponents with the `styles` prop.
|
|
36
|
+
|
|
37
|
+
```jsx
|
|
38
|
+
<ProgressCircle
|
|
39
|
+
styles={{
|
|
40
|
+
circle: {
|
|
41
|
+
stroke: 'transparent',
|
|
42
|
+
},
|
|
43
|
+
progress: {
|
|
44
|
+
strokeLinecap: 'square',
|
|
45
|
+
},
|
|
46
|
+
}}
|
|
47
|
+
color="fgPositive"
|
|
48
|
+
progress={0.75}
|
|
49
|
+
size={100}
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Styles are combined using React Native's style arrays, and are added in order of specificity.
|
|
54
|
+
|
|
55
|
+
```jsx
|
|
56
|
+
<PageHeader style={{ backgroundColor: 'red' }} styles={{ root: { backgroundColor: 'blue' } }} />
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
In the example above, `backgroundColor` will be blue.
|
|
60
|
+
|
|
61
|
+
:::tip
|
|
62
|
+
We will continue to add the `styles` prop to more components over time. Please feel free to request specific components that you think would benefit from this API.
|
|
63
|
+
:::
|
|
64
|
+
|
|
65
|
+
### Component specific props
|
|
66
|
+
|
|
67
|
+
Many components have their own specific props that can affect styling.
|
|
68
|
+
|
|
69
|
+
```jsx
|
|
70
|
+
<Button compact variant="primary">
|
|
71
|
+
Click me
|
|
72
|
+
</Button>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Combining techniques
|
|
76
|
+
|
|
77
|
+
Mix and match these styling techniques for complete customization!
|
|
78
|
+
|
|
79
|
+
```jsx
|
|
80
|
+
<Button variant="primary" borderColor="accentBoldPurple" style={{ fontFamily: 'Times' }}>
|
|
81
|
+
Click me
|
|
82
|
+
</Button>
|
|
83
|
+
```
|
|
84
|
+
|