@coinbase/cds-mcp-server 8.17.2 → 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.
- package/CHANGELOG.md +4 -0
- package/mcp-docs/mobile/components/Accordion.txt +189 -0
- package/mcp-docs/mobile/components/AccordionItem.txt +30 -0
- package/mcp-docs/mobile/components/Alert.txt +156 -0
- package/mcp-docs/mobile/components/AreaChart.txt +266 -0
- package/mcp-docs/mobile/components/Avatar.txt +196 -0
- package/mcp-docs/mobile/components/AvatarButton.txt +226 -0
- package/mcp-docs/mobile/components/Banner.txt +222 -0
- package/mcp-docs/mobile/components/BarChart.txt +816 -0
- package/mcp-docs/mobile/components/Box.txt +174 -0
- package/mcp-docs/mobile/components/BrowserBar.txt +147 -0
- package/mcp-docs/mobile/components/Button.txt +199 -0
- package/mcp-docs/mobile/components/ButtonGroup.txt +80 -0
- package/mcp-docs/mobile/components/Carousel.txt +1084 -0
- package/mcp-docs/mobile/components/CartesianChart.txt +826 -0
- package/mcp-docs/mobile/components/CellMedia.txt +71 -0
- package/mcp-docs/mobile/components/Checkbox.txt +246 -0
- package/mcp-docs/mobile/components/CheckboxCell.txt +202 -0
- package/mcp-docs/mobile/components/CheckboxGroup.txt +285 -0
- package/mcp-docs/mobile/components/Chip.txt +195 -0
- package/mcp-docs/mobile/components/Coachmark.txt +158 -0
- package/mcp-docs/mobile/components/Collapsible.txt +105 -0
- package/mcp-docs/mobile/components/ContainedAssetCard.txt +135 -0
- package/mcp-docs/mobile/components/ContentCard.txt +366 -0
- package/mcp-docs/mobile/components/ContentCardBody.txt +136 -0
- package/mcp-docs/mobile/components/ContentCardFooter.txt +128 -0
- package/mcp-docs/mobile/components/ContentCardHeader.txt +146 -0
- package/mcp-docs/mobile/components/ContentCell.txt +227 -0
- package/mcp-docs/mobile/components/ControlGroup.txt +444 -0
- package/mcp-docs/mobile/components/DatePicker.txt +497 -0
- package/mcp-docs/mobile/components/Divider.txt +139 -0
- package/mcp-docs/mobile/components/DotCount.txt +146 -0
- package/mcp-docs/mobile/components/DotStatusColor.txt +59 -0
- package/mcp-docs/mobile/components/DotSymbol.txt +135 -0
- package/mcp-docs/mobile/components/Fallback.txt +158 -0
- package/mcp-docs/mobile/components/FloatingAssetCard.txt +156 -0
- package/mcp-docs/mobile/components/HStack.txt +235 -0
- package/mcp-docs/mobile/components/HeroSquare.txt +48 -0
- package/mcp-docs/mobile/components/Icon.txt +52 -0
- package/mcp-docs/mobile/components/IconButton.txt +269 -0
- package/mcp-docs/mobile/components/InputChip.txt +188 -0
- package/mcp-docs/mobile/components/Interactable.txt +187 -0
- package/mcp-docs/mobile/components/LineChart.txt +1325 -0
- package/mcp-docs/mobile/components/Link.txt +292 -0
- package/mcp-docs/mobile/components/ListCell.txt +391 -0
- package/mcp-docs/mobile/components/LogoMark.txt +85 -0
- package/mcp-docs/mobile/components/LogoWordMark.txt +94 -0
- package/mcp-docs/mobile/components/Lottie.txt +139 -0
- package/mcp-docs/mobile/components/LottieStatusAnimation.txt +47 -0
- package/mcp-docs/mobile/components/Modal.txt +84 -0
- package/mcp-docs/mobile/components/ModalBody.txt +34 -0
- package/mcp-docs/mobile/components/ModalFooter.txt +25 -0
- package/mcp-docs/mobile/components/ModalHeader.txt +28 -0
- package/mcp-docs/mobile/components/MultiContentModule.txt +380 -0
- package/mcp-docs/mobile/components/NavigationTitle.txt +132 -0
- package/mcp-docs/mobile/components/NavigationTitleSelect.txt +142 -0
- package/mcp-docs/mobile/components/NudgeCard.txt +90 -0
- package/mcp-docs/mobile/components/Numpad.txt +341 -0
- package/mcp-docs/mobile/components/Overlay.txt +152 -0
- package/mcp-docs/mobile/components/PageFooter.txt +161 -0
- package/mcp-docs/mobile/components/PageHeader.txt +186 -0
- package/mcp-docs/mobile/components/PeriodSelector.txt +408 -0
- package/mcp-docs/mobile/components/Pictogram.txt +48 -0
- package/mcp-docs/mobile/components/Point.txt +205 -0
- package/mcp-docs/mobile/components/PortalProvider.txt +79 -0
- package/mcp-docs/mobile/components/Pressable.txt +211 -0
- package/mcp-docs/mobile/components/ProgressBar.txt +130 -0
- package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +161 -0
- package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +138 -0
- package/mcp-docs/mobile/components/ProgressCircle.txt +237 -0
- package/mcp-docs/mobile/components/Radio.txt +242 -0
- package/mcp-docs/mobile/components/RadioCell.txt +202 -0
- package/mcp-docs/mobile/components/RadioGroup.txt +282 -0
- package/mcp-docs/mobile/components/ReferenceLine.txt +153 -0
- package/mcp-docs/mobile/components/RemoteImage.txt +106 -0
- package/mcp-docs/mobile/components/RemoteImageGroup.txt +61 -0
- package/mcp-docs/mobile/components/RollingNumber.txt +789 -0
- package/mcp-docs/mobile/components/Scrubber.txt +204 -0
- package/mcp-docs/mobile/components/SearchInput.txt +192 -0
- package/mcp-docs/mobile/components/SectionHeader.txt +205 -0
- package/mcp-docs/mobile/components/SegmentedTabs.txt +316 -0
- package/mcp-docs/mobile/components/Select.txt +212 -0
- package/mcp-docs/mobile/components/SelectChip.txt +324 -0
- package/mcp-docs/mobile/components/SelectOption.txt +85 -0
- package/mcp-docs/mobile/components/SlideButton.txt +331 -0
- package/mcp-docs/mobile/components/Spacer.txt +84 -0
- package/mcp-docs/mobile/components/Sparkline.txt +123 -0
- package/mcp-docs/mobile/components/SparklineGradient.txt +107 -0
- package/mcp-docs/mobile/components/SparklineInteractive.txt +157 -0
- package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +73 -0
- package/mcp-docs/mobile/components/Spinner.txt +49 -0
- package/mcp-docs/mobile/components/SpotIcon.txt +48 -0
- package/mcp-docs/mobile/components/SpotRectangle.txt +48 -0
- package/mcp-docs/mobile/components/SpotSquare.txt +48 -0
- package/mcp-docs/mobile/components/Stepper.txt +528 -0
- package/mcp-docs/mobile/components/SubBrandLogoMark.txt +126 -0
- package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +126 -0
- package/mcp-docs/mobile/components/Switch.txt +98 -0
- package/mcp-docs/mobile/components/TabIndicator.txt +49 -0
- package/mcp-docs/mobile/components/TabLabel.txt +154 -0
- package/mcp-docs/mobile/components/TabNavigation.txt +147 -0
- package/mcp-docs/mobile/components/TabbedChips.txt +143 -0
- package/mcp-docs/mobile/components/Tabs.txt +191 -0
- package/mcp-docs/mobile/components/Tag.txt +301 -0
- package/mcp-docs/mobile/components/Text.txt +212 -0
- package/mcp-docs/mobile/components/TextInput.txt +718 -0
- package/mcp-docs/mobile/components/ThemeProvider.txt +133 -0
- package/mcp-docs/mobile/components/Toast.txt +197 -0
- package/mcp-docs/mobile/components/Tooltip.txt +60 -0
- package/mcp-docs/mobile/components/TopNavBar.txt +162 -0
- package/mcp-docs/mobile/components/Tour.txt +159 -0
- package/mcp-docs/mobile/components/Tray.txt +253 -0
- package/mcp-docs/mobile/components/UpsellCard.txt +322 -0
- package/mcp-docs/mobile/components/VStack.txt +223 -0
- package/mcp-docs/mobile/components/XAxis.txt +622 -0
- package/mcp-docs/mobile/components/YAxis.txt +568 -0
- package/mcp-docs/mobile/getting-started/introduction.txt +99 -0
- package/mcp-docs/mobile/getting-started/mcp-server.txt +94 -0
- package/mcp-docs/mobile/getting-started/playground.txt +25 -0
- package/mcp-docs/mobile/hooks/useDimensions.txt +47 -0
- package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +215 -0
- package/mcp-docs/mobile/hooks/useTheme.txt +110 -0
- package/mcp-docs/mobile/routes.txt +132 -0
- package/mcp-docs/web/components/Accordion.txt +190 -0
- package/mcp-docs/web/components/AccordionItem.txt +32 -0
- package/mcp-docs/web/components/Alert.txt +165 -0
- package/mcp-docs/web/components/AreaChart.txt +511 -0
- package/mcp-docs/web/components/Avatar.txt +212 -0
- package/mcp-docs/web/components/AvatarButton.txt +241 -0
- package/mcp-docs/web/components/Banner.txt +227 -0
- package/mcp-docs/web/components/BarChart.txt +1268 -0
- package/mcp-docs/web/components/Box.txt +176 -0
- package/mcp-docs/web/components/Button.txt +213 -0
- package/mcp-docs/web/components/ButtonGroup.txt +80 -0
- package/mcp-docs/web/components/Calendar.txt +182 -0
- package/mcp-docs/web/components/Carousel.txt +1576 -0
- package/mcp-docs/web/components/CartesianChart.txt +1045 -0
- package/mcp-docs/web/components/CellMedia.txt +57 -0
- package/mcp-docs/web/components/Checkbox.txt +189 -0
- package/mcp-docs/web/components/CheckboxCell.txt +203 -0
- package/mcp-docs/web/components/CheckboxGroup.txt +220 -0
- package/mcp-docs/web/components/Chip.txt +197 -0
- package/mcp-docs/web/components/Coachmark.txt +189 -0
- package/mcp-docs/web/components/Collapsible.txt +120 -0
- package/mcp-docs/web/components/ContainedAssetCard.txt +233 -0
- package/mcp-docs/web/components/ContentCard.txt +368 -0
- package/mcp-docs/web/components/ContentCardBody.txt +138 -0
- package/mcp-docs/web/components/ContentCardFooter.txt +130 -0
- package/mcp-docs/web/components/ContentCardHeader.txt +148 -0
- package/mcp-docs/web/components/ContentCell.txt +220 -0
- package/mcp-docs/web/components/ControlGroup.txt +437 -0
- package/mcp-docs/web/components/DatePicker.txt +506 -0
- package/mcp-docs/web/components/Divider.txt +144 -0
- package/mcp-docs/web/components/DotCount.txt +150 -0
- package/mcp-docs/web/components/DotStatusColor.txt +59 -0
- package/mcp-docs/web/components/DotSymbol.txt +138 -0
- package/mcp-docs/web/components/Dropdown.txt +120 -0
- package/mcp-docs/web/components/Fallback.txt +164 -0
- package/mcp-docs/web/components/FloatingAssetCard.txt +251 -0
- package/mcp-docs/web/components/FullscreenAlert.txt +70 -0
- package/mcp-docs/web/components/FullscreenModal.txt +146 -0
- package/mcp-docs/web/components/FullscreenModalLayout.txt +188 -0
- package/mcp-docs/web/components/Grid.txt +237 -0
- package/mcp-docs/web/components/GridColumn.txt +210 -0
- package/mcp-docs/web/components/HStack.txt +237 -0
- package/mcp-docs/web/components/HeroSquare.txt +49 -0
- package/mcp-docs/web/components/Icon.txt +146 -0
- package/mcp-docs/web/components/IconButton.txt +391 -0
- package/mcp-docs/web/components/InputChip.txt +188 -0
- package/mcp-docs/web/components/Interactable.txt +194 -0
- package/mcp-docs/web/components/LineChart.txt +1577 -0
- package/mcp-docs/web/components/Link.txt +244 -0
- package/mcp-docs/web/components/ListCell.txt +397 -0
- package/mcp-docs/web/components/LogoMark.txt +85 -0
- package/mcp-docs/web/components/LogoWordMark.txt +94 -0
- package/mcp-docs/web/components/Lottie.txt +158 -0
- package/mcp-docs/web/components/LottieStatusAnimation.txt +58 -0
- package/mcp-docs/web/components/MediaQueryProvider.txt +109 -0
- package/mcp-docs/web/components/Modal.txt +193 -0
- package/mcp-docs/web/components/ModalBody.txt +118 -0
- package/mcp-docs/web/components/ModalFooter.txt +120 -0
- package/mcp-docs/web/components/ModalHeader.txt +124 -0
- package/mcp-docs/web/components/MultiContentModule.txt +382 -0
- package/mcp-docs/web/components/NavigationBar.txt +103 -0
- package/mcp-docs/web/components/NavigationTitle.txt +26 -0
- package/mcp-docs/web/components/NavigationTitleSelect.txt +46 -0
- package/mcp-docs/web/components/NudgeCard.txt +182 -0
- package/mcp-docs/web/components/Overlay.txt +172 -0
- package/mcp-docs/web/components/PageFooter.txt +185 -0
- package/mcp-docs/web/components/PageHeader.txt +244 -0
- package/mcp-docs/web/components/Pagination.txt +500 -0
- package/mcp-docs/web/components/PeriodSelector.txt +704 -0
- package/mcp-docs/web/components/Pictogram.txt +49 -0
- package/mcp-docs/web/components/Point.txt +461 -0
- package/mcp-docs/web/components/PortalProvider.txt +77 -0
- package/mcp-docs/web/components/Pressable.txt +194 -0
- package/mcp-docs/web/components/ProgressBar.txt +164 -0
- package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +213 -0
- package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +182 -0
- package/mcp-docs/web/components/ProgressCircle.txt +444 -0
- package/mcp-docs/web/components/Radio.txt +220 -0
- package/mcp-docs/web/components/RadioCell.txt +216 -0
- package/mcp-docs/web/components/RadioGroup.txt +289 -0
- package/mcp-docs/web/components/ReferenceLine.txt +452 -0
- package/mcp-docs/web/components/RemoteImage.txt +166 -0
- package/mcp-docs/web/components/RemoteImageGroup.txt +87 -0
- package/mcp-docs/web/components/RollingNumber.txt +1022 -0
- package/mcp-docs/web/components/Scrubber.txt +232 -0
- package/mcp-docs/web/components/SearchInput.txt +118 -0
- package/mcp-docs/web/components/SectionHeader.txt +218 -0
- package/mcp-docs/web/components/SegmentedTabs.txt +325 -0
- package/mcp-docs/web/components/Select.txt +225 -0
- package/mcp-docs/web/components/SelectChip.txt +315 -0
- package/mcp-docs/web/components/SelectOption.txt +166 -0
- package/mcp-docs/web/components/Sidebar.txt +350 -0
- package/mcp-docs/web/components/SidebarItem.txt +132 -0
- package/mcp-docs/web/components/SidebarMoreMenu.txt +31 -0
- package/mcp-docs/web/components/Spacer.txt +174 -0
- package/mcp-docs/web/components/Sparkline.txt +123 -0
- package/mcp-docs/web/components/SparklineGradient.txt +107 -0
- package/mcp-docs/web/components/SparklineInteractive.txt +154 -0
- package/mcp-docs/web/components/SparklineInteractiveHeader.txt +77 -0
- package/mcp-docs/web/components/Spinner.txt +129 -0
- package/mcp-docs/web/components/SpotIcon.txt +49 -0
- package/mcp-docs/web/components/SpotRectangle.txt +49 -0
- package/mcp-docs/web/components/SpotSquare.txt +49 -0
- package/mcp-docs/web/components/Stepper.txt +683 -0
- package/mcp-docs/web/components/SubBrandLogoMark.txt +126 -0
- package/mcp-docs/web/components/SubBrandLogoWordMark.txt +126 -0
- package/mcp-docs/web/components/Switch.txt +86 -0
- package/mcp-docs/web/components/TabIndicator.txt +49 -0
- package/mcp-docs/web/components/TabLabel.txt +159 -0
- package/mcp-docs/web/components/TabNavigation.txt +160 -0
- package/mcp-docs/web/components/TabbedChips.txt +156 -0
- package/mcp-docs/web/components/Table.txt +368 -0
- package/mcp-docs/web/components/TableBody.txt +84 -0
- package/mcp-docs/web/components/TableCaption.txt +103 -0
- package/mcp-docs/web/components/TableCell.txt +166 -0
- package/mcp-docs/web/components/TableCellFallback.txt +98 -0
- package/mcp-docs/web/components/TableFooter.txt +84 -0
- package/mcp-docs/web/components/TableHeader.txt +101 -0
- package/mcp-docs/web/components/TableRow.txt +141 -0
- package/mcp-docs/web/components/Tabs.txt +213 -0
- package/mcp-docs/web/components/Tag.txt +305 -0
- package/mcp-docs/web/components/Text.txt +233 -0
- package/mcp-docs/web/components/TextInput.txt +653 -0
- package/mcp-docs/web/components/ThemeProvider.txt +200 -0
- package/mcp-docs/web/components/TileButton.txt +159 -0
- package/mcp-docs/web/components/Toast.txt +204 -0
- package/mcp-docs/web/components/Tooltip.txt +90 -0
- package/mcp-docs/web/components/Tour.txt +180 -0
- package/mcp-docs/web/components/Tray.txt +289 -0
- package/mcp-docs/web/components/UpsellCard.txt +320 -0
- package/mcp-docs/web/components/VStack.txt +225 -0
- package/mcp-docs/web/components/XAxis.txt +620 -0
- package/mcp-docs/web/components/YAxis.txt +549 -0
- package/mcp-docs/web/getting-started/introduction.txt +99 -0
- package/mcp-docs/web/getting-started/mcp-server.txt +94 -0
- package/mcp-docs/web/getting-started/playground.txt +25 -0
- package/mcp-docs/web/hooks/useBreakpoints.txt +33 -0
- package/mcp-docs/web/hooks/useDimensions.txt +55 -0
- package/mcp-docs/web/hooks/useHasMounted.txt +55 -0
- package/mcp-docs/web/hooks/useIsoEffect.txt +42 -0
- package/mcp-docs/web/hooks/useMediaQuery.txt +94 -0
- package/mcp-docs/web/hooks/useOverlayContentContext.txt +217 -0
- package/mcp-docs/web/hooks/useScrollBlocker.txt +63 -0
- package/mcp-docs/web/hooks/useTheme.txt +105 -0
- package/mcp-docs/web/routes.txt +155 -0
- package/package.json +1 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# RadioCell
|
|
2
|
+
|
|
3
|
+
A selectable cell that pairs a radio button with a title and description for single-choice selections.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import { RadioCell } from '@coinbase/cds-mobile/controls/RadioCell'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `title` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | Yes | `-` | - |
|
|
16
|
+
| `alignContent` | `flex-start \| flex-end \| center \| stretch \| space-between \| space-around \| space-evenly` | No | `-` | - |
|
|
17
|
+
| `alignItems` | `flex-start \| flex-end \| center \| stretch \| baseline` | No | `-` | - |
|
|
18
|
+
| `alignSelf` | `auto \| FlexAlignType` | No | `-` | - |
|
|
19
|
+
| `aspectRatio` | `string \| number` | No | `-` | - |
|
|
20
|
+
| `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 | `-` | Background color of the overlay (element being interacted with). |
|
|
21
|
+
| `blendStyles` | `{ background?: string; pressedBackground?: string \| undefined; disabledBackground?: string \| undefined; borderColor?: string \| undefined; pressedBorderColor?: string \| undefined; disabledBorderColor?: string \| undefined; } \| undefined` | No | `-` | Custom color overrides for different interaction states. Base colors (background, borderColor) are used directly, while interaction state colors (pressed, disabled) are used as alternative base colors for blending calculations with blend strength and color scheme considerations. |
|
|
22
|
+
| `block` | `boolean` | No | `-` | Set element to block and expand to 100% width. |
|
|
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
|
+
| `checked` | `boolean` | No | `-` | Set the control to selected/on. |
|
|
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
|
+
| `contentStyle` | `null \| false \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>>` | No | `-` | Apply animated styles to the inner container. |
|
|
46
|
+
| `controlColor` | `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 | `bgPrimary` | Sets the checked/active color of the control. |
|
|
47
|
+
| `dangerouslySetBackground` | `string` | No | `-` | - |
|
|
48
|
+
| `debounceTime` | `number` | No | `500` | The amount of time to wait (in milliseconds) before invoking the debounced function. This prop is used in conjunction with the disableDebounce prop. The debounce function is configured to be invoked as soon as its called, but subsequent calls within the debounceTime period will be ignored. |
|
|
49
|
+
| `description` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | - |
|
|
50
|
+
| `disableDebounce` | `boolean` | No | `-` | React Native is historically trash at debouncing touch events. This can cause a lot of unwanted behavior such as double navigations where we push a screen onto the stack 2 times. Debouncing the event 500 miliseconds, but taking the leading event prevents this effect and the accidental double-tap. |
|
|
51
|
+
| `disabled` | `boolean` | No | `-` | Disable user interaction. Is the element currently disabled. Whether the press behavior is disabled. |
|
|
52
|
+
| `display` | `flex \| none` | No | `-` | - |
|
|
53
|
+
| `elevation` | `0 \| 1 \| 2` | No | `-` | Determines box shadow styles. Parent should have overflow set to visible to ensure styles are not clipped. Is the element elevated. |
|
|
54
|
+
| `feedback` | `none \| light \| normal \| heavy` | No | `none` | Haptic feedback to trigger when being pressed. |
|
|
55
|
+
| `flexBasis` | `string \| number` | No | `-` | - |
|
|
56
|
+
| `flexDirection` | `row \| column \| row-reverse \| column-reverse` | No | `-` | - |
|
|
57
|
+
| `flexGrow` | `number` | No | `-` | - |
|
|
58
|
+
| `flexShrink` | `number` | No | `-` | - |
|
|
59
|
+
| `flexWrap` | `wrap \| nowrap \| wrap-reverse` | No | `-` | - |
|
|
60
|
+
| `font` | `inherit \| FontFamily` | No | `-` | - |
|
|
61
|
+
| `fontFamily` | `inherit \| FontFamily` | No | `-` | - |
|
|
62
|
+
| `fontSize` | `inherit \| FontSize` | No | `-` | - |
|
|
63
|
+
| `fontWeight` | `inherit \| FontWeight` | No | `-` | - |
|
|
64
|
+
| `gap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
65
|
+
| `height` | `string \| number` | No | `-` | - |
|
|
66
|
+
| `indeterminate` | `boolean` | No | `-` | Enable indeterminate state. Useful when you want to indicate that sub-items of a control are partially filled. |
|
|
67
|
+
| `justifyContent` | `flex-start \| flex-end \| center \| space-between \| space-around \| space-evenly` | No | `-` | - |
|
|
68
|
+
| `left` | `string \| number` | No | `-` | - |
|
|
69
|
+
| `lineHeight` | `inherit \| LineHeight` | No | `-` | - |
|
|
70
|
+
| `loading` | `boolean` | No | `-` | Is the element currenty loading. When set to true, will disable element from press and keyboard events Is the element currenty loading. |
|
|
71
|
+
| `margin` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
72
|
+
| `marginBottom` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
73
|
+
| `marginEnd` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
74
|
+
| `marginStart` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
75
|
+
| `marginTop` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
76
|
+
| `marginX` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
77
|
+
| `marginY` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
78
|
+
| `maxHeight` | `string \| number` | No | `-` | - |
|
|
79
|
+
| `maxWidth` | `string \| number` | No | `-` | - |
|
|
80
|
+
| `minHeight` | `string \| number` | No | `-` | - |
|
|
81
|
+
| `minWidth` | `string \| number` | No | `-` | - |
|
|
82
|
+
| `onChange` | `((value: T, checked?: boolean \| undefined) => void) \| undefined` | No | `-` | Toggle control selected state. |
|
|
83
|
+
| `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
84
|
+
| `onPointerCancelCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
85
|
+
| `onPointerDown` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
86
|
+
| `onPointerDownCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
87
|
+
| `onPointerEnter` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
88
|
+
| `onPointerEnterCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
89
|
+
| `onPointerLeave` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
90
|
+
| `onPointerLeaveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
91
|
+
| `onPointerMove` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
92
|
+
| `onPointerMoveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
93
|
+
| `onPointerUp` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
94
|
+
| `onPointerUpCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
95
|
+
| `onPress` | `((event: GestureResponderEvent) => void) \| null` | No | `-` | Called when a single tap gesture is detected. |
|
|
96
|
+
| `opacity` | `number \| AnimatedNode` | No | `-` | - |
|
|
97
|
+
| `overflow` | `visible \| hidden \| scroll` | No | `-` | - |
|
|
98
|
+
| `padding` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
99
|
+
| `paddingBottom` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
100
|
+
| `paddingEnd` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
101
|
+
| `paddingStart` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
102
|
+
| `paddingTop` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
103
|
+
| `paddingX` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
104
|
+
| `paddingY` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
105
|
+
| `pin` | `top \| bottom \| left \| right \| all` | No | `-` | Direction in which to absolutely pin the box. |
|
|
106
|
+
| `position` | `absolute \| relative \| static \| fixed \| sticky` | No | `-` | - |
|
|
107
|
+
| `pressedBorderColor` | `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 | `-` | - |
|
|
108
|
+
| `pressedBorderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
109
|
+
| `readOnly` | `boolean` | No | `-` | Set the control to ready-only. Similar effect as disabled. |
|
|
110
|
+
| `ref` | `null \| (instance: View \| null) => void \| MutableRefObject<View \| null>` | No | `-` | - |
|
|
111
|
+
| `right` | `string \| number` | No | `-` | - |
|
|
112
|
+
| `rowGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
113
|
+
| `styles` | `{ root?: StyleProp<ViewStyle>; radioContainer?: StyleProp<ViewStyle>; contentContainer?: StyleProp<ViewStyle>; title?: StyleProp<TextStyle>; description?: StyleProp<TextStyle>; }` | No | `-` | - |
|
|
114
|
+
| `testID` | `string` | No | `-` | Used to locate this view in end-to-end tests. Used to locate this element in unit and end-to-end tests. |
|
|
115
|
+
| `textAlign` | `left \| right \| auto \| center \| justify` | No | `-` | - |
|
|
116
|
+
| `textDecorationLine` | `none \| underline \| line-through \| underline line-through` | No | `-` | - |
|
|
117
|
+
| `textDecorationStyle` | `solid \| dotted \| dashed \| double` | No | `-` | - |
|
|
118
|
+
| `textTransform` | `none \| capitalize \| uppercase \| lowercase` | No | `-` | - |
|
|
119
|
+
| `top` | `string \| number` | No | `-` | - |
|
|
120
|
+
| `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 | `-` | - |
|
|
121
|
+
| `transparentWhileInactive` | `boolean` | No | `-` | Mark the background and border as transparent until the element is interacted with (hovered, pressed, etc). Must be used in conjunction with the pressed prop |
|
|
122
|
+
| `transparentWhilePressed` | `boolean` | No | `-` | Mark the background and border as transparent even while element is interacted with (elevation underlay issue). Must be used in conjunction with the pressed prop |
|
|
123
|
+
| `userSelect` | `none \| auto \| contain \| text \| all` | No | `-` | - |
|
|
124
|
+
| `value` | `string` | No | `-` | Value of the option. Useful for multiple choice. |
|
|
125
|
+
| `width` | `string \| number` | No | `-` | - |
|
|
126
|
+
| `wrapperStyles` | `{ base?: StyleProp<ViewStyle>; pressed?: StyleProp<ViewStyle>; disabled?: StyleProp<ViewStyle>; }` | No | `-` | Apply styles to the outer container. |
|
|
127
|
+
| `zIndex` | `number` | No | `-` | - |
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## Examples
|
|
131
|
+
|
|
132
|
+
### Basic usage
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
function RadioCellExample() {
|
|
136
|
+
const [value, setValue] = React.useState('one');
|
|
137
|
+
return (
|
|
138
|
+
<VStack gap={2}>
|
|
139
|
+
<RadioCell
|
|
140
|
+
title="Option one"
|
|
141
|
+
description="With a description"
|
|
142
|
+
checked={value === 'one'}
|
|
143
|
+
onChange={setValue}
|
|
144
|
+
value="one"
|
|
145
|
+
/>
|
|
146
|
+
<RadioCell title="Option two" checked={value === 'two'} onChange={setValue} value="two" />
|
|
147
|
+
<RadioCell
|
|
148
|
+
title="Disabled option"
|
|
149
|
+
checked={false}
|
|
150
|
+
onChange={() => {}}
|
|
151
|
+
value="three"
|
|
152
|
+
disabled
|
|
153
|
+
/>
|
|
154
|
+
</VStack>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### With Custom Content and Styling
|
|
160
|
+
|
|
161
|
+
```tsx
|
|
162
|
+
function CustomRadioCellExample() {
|
|
163
|
+
const [selectedPlan, setSelectedPlan] = React.useState('pro');
|
|
164
|
+
return (
|
|
165
|
+
<VStack gap={2}>
|
|
166
|
+
<RadioCell
|
|
167
|
+
checked={selectedPlan === 'basic'}
|
|
168
|
+
description={
|
|
169
|
+
<VStack gap={1}>
|
|
170
|
+
<Text color="fgMuted" font="body">
|
|
171
|
+
Perfect for individuals getting started
|
|
172
|
+
</Text>
|
|
173
|
+
<Text font="label1">$9/month • Up to 5 projects • 1GB storage</Text>
|
|
174
|
+
</VStack>
|
|
175
|
+
}
|
|
176
|
+
onChange={setSelectedPlan}
|
|
177
|
+
title="Basic Plan"
|
|
178
|
+
value="basic"
|
|
179
|
+
/>
|
|
180
|
+
<RadioCell
|
|
181
|
+
checked={selectedPlan === 'pro'}
|
|
182
|
+
description={
|
|
183
|
+
<VStack gap={1}>
|
|
184
|
+
<Text color="fgMuted" font="body">
|
|
185
|
+
Great for growing teams and businesses
|
|
186
|
+
</Text>
|
|
187
|
+
<Text font="label1">$29/month • Unlimited projects • 10GB storage</Text>
|
|
188
|
+
<Text color="fgPositive" font="caption">
|
|
189
|
+
• Most Popular
|
|
190
|
+
</Text>
|
|
191
|
+
</VStack>
|
|
192
|
+
}
|
|
193
|
+
onChange={setSelectedPlan}
|
|
194
|
+
title="Pro Plan"
|
|
195
|
+
value="pro"
|
|
196
|
+
/>
|
|
197
|
+
</VStack>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# RadioGroup
|
|
2
|
+
|
|
3
|
+
Radio is a control component that allows users to select one option from a set.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import { RadioGroup } from '@coinbase/cds-mobile/controls/RadioGroup'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `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 | `bg` | Background color of the overlay (element being interacted with). |
|
|
16
|
+
| `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 | `checked ? controlColor : 'bgLineHeavy'` | - |
|
|
17
|
+
| `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `1000` | - |
|
|
18
|
+
| `borderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
19
|
+
| `checked` | `boolean` | No | `-` | Set the control to selected/on. |
|
|
20
|
+
| `children` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Label for the control option. |
|
|
21
|
+
| `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 | `black` | - |
|
|
22
|
+
| `controlColor` | `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 | `bgPrimary` | Sets the checked/active color of the control. |
|
|
23
|
+
| `disabled` | `boolean` | No | `-` | Disable user interaction. |
|
|
24
|
+
| `indeterminate` | `boolean` | No | `-` | Enable indeterminate state. Useful when you want to indicate that sub-items of a control are partially filled. |
|
|
25
|
+
| `onChange` | `((value: T, checked?: boolean \| undefined) => void) \| undefined` | No | `-` | Toggle control selected state. |
|
|
26
|
+
| `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
27
|
+
| `onPointerCancelCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
28
|
+
| `onPointerDown` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
29
|
+
| `onPointerDownCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
30
|
+
| `onPointerEnter` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
31
|
+
| `onPointerEnterCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
32
|
+
| `onPointerLeave` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
33
|
+
| `onPointerLeaveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
34
|
+
| `onPointerMove` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
35
|
+
| `onPointerMoveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
36
|
+
| `onPointerUp` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
37
|
+
| `onPointerUpCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
38
|
+
| `onPress` | `((event: GestureResponderEvent) => void) \| null` | No | `-` | Called when a single tap gesture is detected. |
|
|
39
|
+
| `readOnly` | `boolean` | No | `-` | Set the control to ready-only. Similar effect as disabled. |
|
|
40
|
+
| `ref` | `null \| (instance: View \| null) => void \| RefObject<View>` | No | `-` | - |
|
|
41
|
+
| `style` | `ViewStyle` | No | `-` | - |
|
|
42
|
+
| `testID` | `string` | No | `-` | Used to locate this view in end-to-end tests. |
|
|
43
|
+
| `value` | `string` | No | `-` | Value of the option. Useful for multiple choice. |
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Examples
|
|
47
|
+
|
|
48
|
+
### Deprecation Notice
|
|
49
|
+
|
|
50
|
+
:::danger Deprecated Component
|
|
51
|
+
|
|
52
|
+
**RadioGroup is deprecated and will be removed in a future version.**
|
|
53
|
+
|
|
54
|
+
Use **[ControlGroup](/components/inputs/ControlGroup)** with `accessibilityRole="radiogroup"` instead for better accessibility, consistency, and maintainability.
|
|
55
|
+
|
|
56
|
+
:::
|
|
57
|
+
|
|
58
|
+
:::caution Types
|
|
59
|
+
|
|
60
|
+
RadioGroup onChange fails without a string type declaration for setGroup fns.
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
const [group, setGroup] = useState<string>();
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
:::
|
|
67
|
+
|
|
68
|
+
### Migration Guide
|
|
69
|
+
|
|
70
|
+
#### ✅ Recommended: Using ControlGroup
|
|
71
|
+
|
|
72
|
+
The new recommended approach provides better accessibility, cleaner API, and consistent behavior across the design system.
|
|
73
|
+
|
|
74
|
+
```jsx
|
|
75
|
+
function RecommendedRadioGroup() {
|
|
76
|
+
const options = [
|
|
77
|
+
{ value: 'btc', children: 'Bitcoin' },
|
|
78
|
+
{ value: 'eth', children: 'Ethereum' },
|
|
79
|
+
{ value: 'ltc', children: 'Litecoin' },
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
const [selectedCurrency, setSelectedCurrency] = useState('btc');
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<VStack gap={2}>
|
|
86
|
+
<ControlGroup
|
|
87
|
+
accessibilityRole="radiogroup"
|
|
88
|
+
ControlComponent={Radio}
|
|
89
|
+
label="Choose a currency"
|
|
90
|
+
options={options}
|
|
91
|
+
value={selectedCurrency}
|
|
92
|
+
onChange={setSelectedCurrency}
|
|
93
|
+
name="recommended-radio-group"
|
|
94
|
+
/>
|
|
95
|
+
<Text font="caption" color="fgMuted">
|
|
96
|
+
Selected: {selectedCurrency}
|
|
97
|
+
</Text>
|
|
98
|
+
</VStack>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### Migration Steps
|
|
104
|
+
|
|
105
|
+
1. **Replace RadioGroup with [ControlGroup](/components/inputs/ControlGroup)**:
|
|
106
|
+
|
|
107
|
+
```jsx
|
|
108
|
+
// Old (deprecated)
|
|
109
|
+
<RadioGroup
|
|
110
|
+
value={selectedValue}
|
|
111
|
+
onChange={onChange}
|
|
112
|
+
options={{ btc: 'Bitcoin', eth: 'Ethereum' }}
|
|
113
|
+
/>
|
|
114
|
+
|
|
115
|
+
// New (recommended)
|
|
116
|
+
<ControlGroup
|
|
117
|
+
accessibilityRole="radiogroup"
|
|
118
|
+
ControlComponent={Radio}
|
|
119
|
+
options={[
|
|
120
|
+
{ value: 'btc', children: 'Bitcoin' },
|
|
121
|
+
{ value: 'eth', children: 'Ethereum' }
|
|
122
|
+
]}
|
|
123
|
+
value={selectedValue}
|
|
124
|
+
onChange={onChange}
|
|
125
|
+
/>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
2. **Update options format**:
|
|
129
|
+
|
|
130
|
+
```jsx
|
|
131
|
+
// Old: Object format
|
|
132
|
+
const options = { btc: 'Bitcoin', eth: 'Ethereum' };
|
|
133
|
+
|
|
134
|
+
// New: Array format
|
|
135
|
+
const options = [
|
|
136
|
+
{ value: 'btc', children: 'Bitcoin' },
|
|
137
|
+
{ value: 'eth', children: 'Ethereum' },
|
|
138
|
+
];
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
3. **Update onChange handler**:
|
|
142
|
+
|
|
143
|
+
```jsx
|
|
144
|
+
// Old: Direct value callback
|
|
145
|
+
const oldOnChange = (value) => setSelected(value);
|
|
146
|
+
|
|
147
|
+
// New: Value-only callback (mobile pattern)
|
|
148
|
+
const newOnChange = (value) => setSelected(value);
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
4. **Update accessibility**:
|
|
152
|
+
|
|
153
|
+
```jsx
|
|
154
|
+
// Old: No specific role requirement
|
|
155
|
+
<RadioGroup label="Choose option" />
|
|
156
|
+
|
|
157
|
+
// New: Explicit accessibility role
|
|
158
|
+
<ControlGroup
|
|
159
|
+
accessibilityRole="radiogroup"
|
|
160
|
+
label="Choose option"
|
|
161
|
+
/>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Legacy Usage (Deprecated)
|
|
165
|
+
|
|
166
|
+
:::warning Legacy Example
|
|
167
|
+
|
|
168
|
+
The following examples show the **deprecated** RadioGroup usage. **Do not use this in new code.** Use [ControlGroup](/components/inputs/ControlGroup) instead.
|
|
169
|
+
|
|
170
|
+
:::
|
|
171
|
+
|
|
172
|
+
#### Basic RadioGroup (Legacy)
|
|
173
|
+
|
|
174
|
+
```jsx
|
|
175
|
+
function LegacyRadioGroupDemo() {
|
|
176
|
+
const options = {
|
|
177
|
+
btc: 'Bitcoin',
|
|
178
|
+
eth: 'Ethereum',
|
|
179
|
+
dai: 'Dai',
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const [group, setGroup] = useState('btc');
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<VStack gap={2}>
|
|
186
|
+
<Text font="headline">Currency Selection (Legacy RadioGroup)</Text>
|
|
187
|
+
<RadioGroup
|
|
188
|
+
id="currency-radio-group"
|
|
189
|
+
label="Choose a currency"
|
|
190
|
+
name="radio-group1"
|
|
191
|
+
value={group}
|
|
192
|
+
onChange={setGroup}
|
|
193
|
+
options={options}
|
|
194
|
+
/>
|
|
195
|
+
<Text font="caption" color="fgMuted">
|
|
196
|
+
Selected: {group}
|
|
197
|
+
</Text>
|
|
198
|
+
</VStack>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
#### With Accessibility Features (Legacy)
|
|
204
|
+
|
|
205
|
+
```jsx
|
|
206
|
+
function LegacyAccessibleRadioGroup() {
|
|
207
|
+
const options = {
|
|
208
|
+
'plan-basic': 'Basic Plan',
|
|
209
|
+
'plan-pro': 'Professional Plan',
|
|
210
|
+
'plan-enterprise': 'Enterprise Plan',
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
const [selectedPlan, setSelectedPlan] = useState('plan-pro');
|
|
214
|
+
|
|
215
|
+
return (
|
|
216
|
+
<RadioGroup
|
|
217
|
+
accessibilityLabel="Choose your subscription plan"
|
|
218
|
+
label="Subscription Plans"
|
|
219
|
+
value={selectedPlan}
|
|
220
|
+
onChange={setSelectedPlan}
|
|
221
|
+
options={options}
|
|
222
|
+
/>
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
#### Color Customization (Legacy)
|
|
228
|
+
|
|
229
|
+
Like other control components (i.e. Checkbox, Switch), you can customize the color of the Radio by setting the `controlColor` prop.
|
|
230
|
+
|
|
231
|
+
```jsx
|
|
232
|
+
function CustomColors() {
|
|
233
|
+
// static values should live outside the component in product code.
|
|
234
|
+
const options = {
|
|
235
|
+
btc: 'Bitcoin',
|
|
236
|
+
eth: 'Ethereum',
|
|
237
|
+
dai: 'Dai',
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const [group, setGroup] = useState();
|
|
241
|
+
|
|
242
|
+
return (
|
|
243
|
+
<RadioGroup
|
|
244
|
+
id="mascot-radio-group"
|
|
245
|
+
aria-labelledby="choose-a-mascot"
|
|
246
|
+
name="radio-group2"
|
|
247
|
+
controlColor="accentBoldGreen"
|
|
248
|
+
value={group}
|
|
249
|
+
onChange={setGroup}
|
|
250
|
+
options={options}
|
|
251
|
+
/>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
For more advanced color customization, you can use additional style props on individual Radio components like `background`, `borderColor`, and `color`:
|
|
257
|
+
|
|
258
|
+
```jsx
|
|
259
|
+
function AdvancedCustomColors() {
|
|
260
|
+
const [checked, setChecked] = useState(false);
|
|
261
|
+
|
|
262
|
+
return (
|
|
263
|
+
<VStack gap={2}>
|
|
264
|
+
<Radio checked={checked} controlColor="bgPositive" onChange={() => setChecked((s) => !s)}>
|
|
265
|
+
Control color prop
|
|
266
|
+
</Radio>
|
|
267
|
+
<Radio
|
|
268
|
+
background={checked ? 'accentBoldPurple' : 'bg'}
|
|
269
|
+
borderColor={checked ? 'bgNegative' : 'bgWarning'}
|
|
270
|
+
checked={checked}
|
|
271
|
+
color="bgPrimary"
|
|
272
|
+
controlColor="bgPositive"
|
|
273
|
+
onChange={() => setChecked((s) => !s)}
|
|
274
|
+
>
|
|
275
|
+
Advanced styling
|
|
276
|
+
</Radio>
|
|
277
|
+
</VStack>
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# ReferenceLine
|
|
2
|
+
|
|
3
|
+
A horizontal or vertical reference line to mark important values on a chart, such as targets, thresholds, or baseline values.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import { ReferenceLine } from '@coinbase/cds-mobile-visualization'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `LineComponent` | `LineComponent` | No | `DottedLine` | Component to render the line. |
|
|
16
|
+
| `dataX` | `number` | No | `-` | X-value for vertical reference line (data index). |
|
|
17
|
+
| `dataY` | `number` | No | `-` | Y-value for horizontal reference line (data value). |
|
|
18
|
+
| `label` | `null \| string \| number \| ReactElement<TSpanProps, TSpan> \| ReactElement<TextPathProps, TextPath> \| ValidChartTextChildElements[]` | No | `-` | Label content to display near the reference line. Can be a string or ReactNode for rich formatting. |
|
|
19
|
+
| `labelPosition` | `TextHorizontalAlignment \| TextVerticalAlignment` | No | `'right' 'top'` | Position of the label along the horizontal line. Position of the label along the vertical line. |
|
|
20
|
+
| `labelProps` | `ReferenceLineLabelProps` | No | `-` | Props for the label rendering. Consolidates styling and positioning options for the ChartText component. Alignment defaults are set based on line orientation and can be overridden here. |
|
|
21
|
+
| `stroke` | `string` | No | `theme.color.bgLine` | The color of the line. |
|
|
22
|
+
| `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 |
|
|
23
|
+
| `yAxisId` | `string` | No | `-` | The ID of the y-axis to use for positioning. Defaults to defaultAxisId if not specified. |
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
### Basic Example
|
|
29
|
+
|
|
30
|
+
ReferenceLine can be used to add important details to a chart, such as a reference price or date.
|
|
31
|
+
|
|
32
|
+
```jsx
|
|
33
|
+
<LineChart
|
|
34
|
+
height={150}
|
|
35
|
+
series={[
|
|
36
|
+
{
|
|
37
|
+
id: 'prices',
|
|
38
|
+
data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
|
|
39
|
+
},
|
|
40
|
+
]}
|
|
41
|
+
inset={0}
|
|
42
|
+
curve="monotone"
|
|
43
|
+
showArea
|
|
44
|
+
>
|
|
45
|
+
<ReferenceLine
|
|
46
|
+
dataX={5}
|
|
47
|
+
label="Vertical Reference Line"
|
|
48
|
+
labelProps={{ horizontalAlignment: 'left', dx: 8 }}
|
|
49
|
+
/>
|
|
50
|
+
<ReferenceLine
|
|
51
|
+
dataY={50}
|
|
52
|
+
label="Horizontal Reference Line"
|
|
53
|
+
labelProps={{ verticalAlignment: 'bottom', dy: -8, horizontalAlignment: 'right' }}
|
|
54
|
+
/>
|
|
55
|
+
</LineChart>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Data Values
|
|
59
|
+
|
|
60
|
+
ReferenceLine relies on `dataX` or `dataY` to position the line. Passing in `dataY` will create a horizontal line across the y axis at that value, and passing in `dataX` will do the same along the x axis.
|
|
61
|
+
|
|
62
|
+
```jsx
|
|
63
|
+
function DataValuesExample() {
|
|
64
|
+
const theme = useTheme();
|
|
65
|
+
return (
|
|
66
|
+
<LineChart
|
|
67
|
+
showArea
|
|
68
|
+
curve="natural"
|
|
69
|
+
height={150}
|
|
70
|
+
series={[
|
|
71
|
+
{
|
|
72
|
+
id: 'growth',
|
|
73
|
+
data: [
|
|
74
|
+
2, 4, 8, 15, 30, 65, 140, 280, 580, 1200, 2400, 4800, 9500, 19000, 38000, 75000, 150000,
|
|
75
|
+
],
|
|
76
|
+
color: theme.color.fgPositive,
|
|
77
|
+
},
|
|
78
|
+
]}
|
|
79
|
+
>
|
|
80
|
+
<ReferenceLine
|
|
81
|
+
dataY={10000}
|
|
82
|
+
label="10,000"
|
|
83
|
+
labelPosition="left"
|
|
84
|
+
labelProps={{ verticalAlignment: 'bottom', dy: -4 }}
|
|
85
|
+
/>
|
|
86
|
+
<ReferenceLine
|
|
87
|
+
dataY={100000}
|
|
88
|
+
label="100,000"
|
|
89
|
+
labelPosition="left"
|
|
90
|
+
labelProps={{ verticalAlignment: 'bottom', dy: -4 }}
|
|
91
|
+
/>
|
|
92
|
+
</LineChart>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Customization
|
|
98
|
+
|
|
99
|
+
#### Label Style
|
|
100
|
+
|
|
101
|
+
You can adjust the style of the label using the `labelProps` prop.
|
|
102
|
+
|
|
103
|
+
```jsx
|
|
104
|
+
function LabelStyleExample() {
|
|
105
|
+
const theme = useTheme();
|
|
106
|
+
return (
|
|
107
|
+
<LineChart
|
|
108
|
+
curve="monotone"
|
|
109
|
+
height={150}
|
|
110
|
+
inset={{ right: 4 }}
|
|
111
|
+
series={[
|
|
112
|
+
{
|
|
113
|
+
id: 'prices',
|
|
114
|
+
data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
|
|
115
|
+
},
|
|
116
|
+
]}
|
|
117
|
+
>
|
|
118
|
+
<ReferenceLine
|
|
119
|
+
dataY={25}
|
|
120
|
+
label="Liquidation"
|
|
121
|
+
labelPosition="left"
|
|
122
|
+
labelProps={{
|
|
123
|
+
horizontalAlignment: 'left',
|
|
124
|
+
dx: 12,
|
|
125
|
+
borderRadius: 4,
|
|
126
|
+
inset: { top: 4, bottom: 4, left: 8, right: 8 },
|
|
127
|
+
color: `rgb(${theme.color.accentSubtleYellow})`,
|
|
128
|
+
background: theme.color.accentSubtleYellow,
|
|
129
|
+
font: 'label1',
|
|
130
|
+
}}
|
|
131
|
+
stroke={theme.color.bgWarning}
|
|
132
|
+
/>
|
|
133
|
+
<ReferenceLine
|
|
134
|
+
dataY={25}
|
|
135
|
+
label="$25"
|
|
136
|
+
labelPosition="right"
|
|
137
|
+
labelProps={{
|
|
138
|
+
horizontalAlignment: 'right',
|
|
139
|
+
dx: -12,
|
|
140
|
+
borderRadius: 4,
|
|
141
|
+
inset: { top: 2, bottom: 2, left: 4, right: 4 },
|
|
142
|
+
color: `rgb(${theme.color.yellow70})`,
|
|
143
|
+
background: theme.color.bg,
|
|
144
|
+
font: 'label1',
|
|
145
|
+
}}
|
|
146
|
+
stroke="transparent"
|
|
147
|
+
/>
|
|
148
|
+
</LineChart>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
|