@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,79 @@
|
|
|
1
|
+
# PortalProvider
|
|
2
|
+
|
|
3
|
+
A component that manages the rendering of portals for overlay components.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import { PortalProvider } from '@coinbase/cds-mobile/overlays/PortalProvider'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `nodes` | `PortalNode[]` | Yes | `-` | - |
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
### Basic usage
|
|
21
|
+
|
|
22
|
+
The PortalProvider component is typically used at the root of your mobile application to manage overlay components:
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
function App() {
|
|
26
|
+
return (
|
|
27
|
+
<PortalProvider>
|
|
28
|
+
<Box padding={4} bordered borderRadius={200}>
|
|
29
|
+
Your app content
|
|
30
|
+
</Box>
|
|
31
|
+
</PortalProvider>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Custom Portal Nodes
|
|
37
|
+
|
|
38
|
+
You can disable the default portal rendering and use the PortalNodes component separately:
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
function App() {
|
|
42
|
+
return (
|
|
43
|
+
<PortalProvider renderPortals={false}>
|
|
44
|
+
<Box padding={4} bordered borderRadius={200}>
|
|
45
|
+
Your app content
|
|
46
|
+
</Box>
|
|
47
|
+
<PortalNodes />
|
|
48
|
+
</PortalProvider>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Toast Example
|
|
54
|
+
|
|
55
|
+
The PortalProvider's `toastBottomOffset` prop sets the default bottom offset for all toasts:
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
function App() {
|
|
59
|
+
function ToastDemo() {
|
|
60
|
+
const toast = useToast();
|
|
61
|
+
return (
|
|
62
|
+
<Box padding={4} bordered borderRadius={200}>
|
|
63
|
+
<Button
|
|
64
|
+
onPress={() => toast.show('This toast appears with a custom bottom offset (80px)')}
|
|
65
|
+
label="Show Toast"
|
|
66
|
+
/>
|
|
67
|
+
</Box>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<PortalProvider toastBottomOffset={80}>
|
|
73
|
+
<ToastDemo />
|
|
74
|
+
</PortalProvider>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Pressable
|
|
2
|
+
|
|
3
|
+
Extends the Interactable component to add accessibility support for press interactions.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import { Pressable } from '@coinbase/cds-mobile/system/Pressable'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `alignContent` | `flex-start \| flex-end \| center \| stretch \| space-between \| space-around \| space-evenly` | No | `-` | - |
|
|
16
|
+
| `alignItems` | `flex-start \| flex-end \| center \| stretch \| baseline` | No | `-` | - |
|
|
17
|
+
| `alignSelf` | `auto \| FlexAlignType` | No | `-` | - |
|
|
18
|
+
| `android_disableSound` | `boolean \| null` | No | `-` | If true, doesnt play system sound on touch. |
|
|
19
|
+
| `android_ripple` | `PressableAndroidRippleConfig \| null` | No | `-` | Enables the Android ripple effect and configures its color. |
|
|
20
|
+
| `aspectRatio` | `string \| number` | No | `-` | - |
|
|
21
|
+
| `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). |
|
|
22
|
+
| `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. |
|
|
23
|
+
| `block` | `boolean` | No | `-` | Set element to block and expand to 100% width. |
|
|
24
|
+
| `borderBottomLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
25
|
+
| `borderBottomRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
26
|
+
| `borderBottomWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
27
|
+
| `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 | `-` | - |
|
|
28
|
+
| `borderEndWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
29
|
+
| `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
30
|
+
| `borderStartWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
31
|
+
| `borderTopLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
32
|
+
| `borderTopRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
33
|
+
| `borderTopWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
34
|
+
| `borderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
35
|
+
| `bordered` | `boolean` | No | `-` | Add a border around all sides of the box. |
|
|
36
|
+
| `borderedBottom` | `boolean` | No | `-` | Add a border to the bottom side of the box. |
|
|
37
|
+
| `borderedEnd` | `boolean` | No | `-` | Add a border to the trailing side of the box. |
|
|
38
|
+
| `borderedHorizontal` | `boolean` | No | `-` | Add a border to the leading and trailing sides of the box. |
|
|
39
|
+
| `borderedStart` | `boolean` | No | `-` | Add a border to the leading side of the box. |
|
|
40
|
+
| `borderedTop` | `boolean` | No | `-` | Add a border to the top side of the box. |
|
|
41
|
+
| `borderedVertical` | `boolean` | No | `-` | Add a border to the top and bottom sides of the box. |
|
|
42
|
+
| `bottom` | `string \| number` | No | `-` | - |
|
|
43
|
+
| `cancelable` | `boolean \| null` | No | `-` | Whether a press gesture can be interrupted by a parent gesture such as a scroll event. Defaults to true. |
|
|
44
|
+
| `children` | `((string \| number \| boolean \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal) & (string \| number \| boolean \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal \| ((state: PressableStateCallbackType) => ReactNode))) \| null` | No | `-` | Either children or a render prop that receives a boolean reflecting whether the component is currently pressed. |
|
|
45
|
+
| `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 | `-` | - |
|
|
46
|
+
| `columnGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
47
|
+
| `contentStyle` | `null \| false \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>>` | No | `-` | Apply animated styles to the inner container. |
|
|
48
|
+
| `dangerouslySetBackground` | `string` | No | `-` | - |
|
|
49
|
+
| `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. |
|
|
50
|
+
| `delayHoverIn` | `number \| null` | No | `-` | Duration to wait after hover in before calling onHoverIn. |
|
|
51
|
+
| `delayHoverOut` | `number \| null` | No | `-` | Duration to wait after hover out before calling onHoverOut. |
|
|
52
|
+
| `delayLongPress` | `number \| null` | No | `-` | Duration (in milliseconds) from onPressIn before onLongPress is called. |
|
|
53
|
+
| `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. |
|
|
54
|
+
| `disabled` | `boolean` | No | `-` | Is the element currently disabled. Whether the press behavior is disabled. |
|
|
55
|
+
| `display` | `flex \| none` | No | `-` | - |
|
|
56
|
+
| `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. |
|
|
57
|
+
| `feedback` | `none \| light \| normal \| heavy` | No | `none` | Haptic feedback to trigger when being pressed. |
|
|
58
|
+
| `flexBasis` | `string \| number` | No | `-` | - |
|
|
59
|
+
| `flexDirection` | `row \| column \| row-reverse \| column-reverse` | No | `-` | - |
|
|
60
|
+
| `flexGrow` | `number` | No | `-` | - |
|
|
61
|
+
| `flexShrink` | `number` | No | `-` | - |
|
|
62
|
+
| `flexWrap` | `wrap \| nowrap \| wrap-reverse` | No | `-` | - |
|
|
63
|
+
| `font` | `inherit \| FontFamily` | No | `-` | - |
|
|
64
|
+
| `fontFamily` | `inherit \| FontFamily` | No | `-` | - |
|
|
65
|
+
| `fontSize` | `inherit \| FontSize` | No | `-` | - |
|
|
66
|
+
| `fontWeight` | `inherit \| FontWeight` | No | `-` | - |
|
|
67
|
+
| `gap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
68
|
+
| `height` | `string \| number` | No | `-` | - |
|
|
69
|
+
| `hitSlop` | `number \| Insets \| null` | No | `-` | Additional distance outside of this view in which a press is detected. |
|
|
70
|
+
| `justifyContent` | `flex-start \| flex-end \| center \| space-between \| space-around \| space-evenly` | No | `-` | - |
|
|
71
|
+
| `key` | `Key \| null` | No | `-` | - |
|
|
72
|
+
| `left` | `string \| number` | No | `-` | - |
|
|
73
|
+
| `lineHeight` | `inherit \| LineHeight` | No | `-` | - |
|
|
74
|
+
| `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. |
|
|
75
|
+
| `margin` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
76
|
+
| `marginBottom` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
77
|
+
| `marginEnd` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
78
|
+
| `marginStart` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
79
|
+
| `marginTop` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
80
|
+
| `marginX` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
81
|
+
| `marginY` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
82
|
+
| `maxHeight` | `string \| number` | No | `-` | - |
|
|
83
|
+
| `maxWidth` | `string \| number` | No | `-` | - |
|
|
84
|
+
| `minHeight` | `string \| number` | No | `-` | - |
|
|
85
|
+
| `minWidth` | `string \| number` | No | `-` | - |
|
|
86
|
+
| `noScaleOnPress` | `boolean` | No | `-` | Dont scale element on press. |
|
|
87
|
+
| `onBlur` | `((event: NativeSyntheticEvent<TargetedEvent>) => void) \| null` | No | `-` | Called after the element loses focus. |
|
|
88
|
+
| `onFocus` | `((event: NativeSyntheticEvent<TargetedEvent>) => void) \| null` | No | `-` | Called after the element is focused. |
|
|
89
|
+
| `onHoverIn` | `((event: MouseEvent) => void) \| null` | No | `-` | Called when the hover is activated to provide visual feedback. |
|
|
90
|
+
| `onHoverOut` | `((event: MouseEvent) => void) \| null` | No | `-` | Called when the hover is deactivated to undo visual feedback. |
|
|
91
|
+
| `onLongPress` | `((event: GestureResponderEvent) => void) \| null` | No | `-` | Called when a long-tap gesture is detected. |
|
|
92
|
+
| `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
93
|
+
| `onPointerCancelCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
94
|
+
| `onPointerDown` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
95
|
+
| `onPointerDownCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
96
|
+
| `onPointerEnter` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
97
|
+
| `onPointerEnterCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
98
|
+
| `onPointerLeave` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
99
|
+
| `onPointerLeaveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
100
|
+
| `onPointerMove` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
101
|
+
| `onPointerMoveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
102
|
+
| `onPointerUp` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
103
|
+
| `onPointerUpCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
104
|
+
| `onPress` | `((event: GestureResponderEvent) => void) \| null` | No | `-` | Called when a single tap gesture is detected. |
|
|
105
|
+
| `onPressIn` | `(((event: GestureResponderEvent) => void) & ((event: GestureResponderEvent) => void))` | No | `-` | Callback fired before onPress when button is pressed. Called when a touch is engaged before onPress. |
|
|
106
|
+
| `onPressOut` | `(((event: GestureResponderEvent) => void) & ((event: GestureResponderEvent) => void))` | No | `-` | Callback fired before onPress when button is released. Called when a touch is released before onPress. |
|
|
107
|
+
| `onTouchCancel` | `((event: GestureResponderEvent) => void)` | No | `-` | - |
|
|
108
|
+
| `onTouchEnd` | `((event: GestureResponderEvent) => void)` | No | `-` | - |
|
|
109
|
+
| `onTouchEndCapture` | `((event: GestureResponderEvent) => void)` | No | `-` | - |
|
|
110
|
+
| `onTouchMove` | `((event: GestureResponderEvent) => void)` | No | `-` | - |
|
|
111
|
+
| `onTouchStart` | `((event: GestureResponderEvent) => void)` | No | `-` | - |
|
|
112
|
+
| `opacity` | `number \| AnimatedNode` | No | `-` | - |
|
|
113
|
+
| `overflow` | `visible \| hidden \| scroll` | No | `-` | - |
|
|
114
|
+
| `padding` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
115
|
+
| `paddingBottom` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
116
|
+
| `paddingEnd` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
117
|
+
| `paddingStart` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
118
|
+
| `paddingTop` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
119
|
+
| `paddingX` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
120
|
+
| `paddingY` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
121
|
+
| `pin` | `top \| bottom \| left \| right \| all` | No | `-` | Direction in which to absolutely pin the box. |
|
|
122
|
+
| `position` | `absolute \| relative \| static \| fixed \| sticky` | No | `-` | - |
|
|
123
|
+
| `pressRetentionOffset` | `number \| Insets \| null` | No | `-` | Additional distance outside of this view in which a touch is considered a press before onPressOut is triggered. |
|
|
124
|
+
| `ref` | `((instance: View \| null) => void) \| RefObject<View> \| null` | No | `-` | - |
|
|
125
|
+
| `right` | `string \| number` | No | `-` | - |
|
|
126
|
+
| `rowGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
127
|
+
| `style` | `StyleProp<ViewStyle> \| ((state: PressableStateCallbackType) => StyleProp<ViewStyle>)` | No | `-` | Either view styles or a function that receives a boolean reflecting whether the component is currently pressed and returns view styles. |
|
|
128
|
+
| `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Used to locate this view in end-to-end tests. |
|
|
129
|
+
| `testOnly_pressed` | `boolean \| null` | No | `-` | Used only for documentation or testing (e.g. snapshot testing). |
|
|
130
|
+
| `textAlign` | `left \| right \| auto \| center \| justify` | No | `-` | - |
|
|
131
|
+
| `textDecorationLine` | `none \| underline \| line-through \| underline line-through` | No | `-` | - |
|
|
132
|
+
| `textDecorationStyle` | `solid \| dotted \| dashed \| double` | No | `-` | - |
|
|
133
|
+
| `textTransform` | `none \| capitalize \| uppercase \| lowercase` | No | `-` | - |
|
|
134
|
+
| `top` | `string \| number` | No | `-` | - |
|
|
135
|
+
| `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 | `-` | - |
|
|
136
|
+
| `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 |
|
|
137
|
+
| `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 |
|
|
138
|
+
| `unstable_pressDelay` | `number` | No | `-` | Duration (in milliseconds) to wait after press down before calling onPressIn. |
|
|
139
|
+
| `userSelect` | `none \| auto \| contain \| text \| all` | No | `-` | - |
|
|
140
|
+
| `width` | `string \| number` | No | `-` | - |
|
|
141
|
+
| `wrapperStyles` | `{ base?: StyleProp<ViewStyle>; pressed?: StyleProp<ViewStyle>; disabled?: StyleProp<ViewStyle>; }` | No | `-` | Apply styles to the outer container. |
|
|
142
|
+
| `zIndex` | `number` | No | `-` | - |
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
## Examples
|
|
146
|
+
|
|
147
|
+
### Basic Pressable
|
|
148
|
+
|
|
149
|
+
Pressables support an `onPress` prop for handling click/press interactions. When being pressed, the element will scale down to mimic a real-world button press. If this functionality is not desired, pass the `noScaleOnPress` prop.
|
|
150
|
+
|
|
151
|
+
```jsx
|
|
152
|
+
<Pressable
|
|
153
|
+
onPress={console.log}
|
|
154
|
+
background="bgAlternate"
|
|
155
|
+
borderColor="lineHeavy"
|
|
156
|
+
borderWidth={100}
|
|
157
|
+
borderRadius={300}
|
|
158
|
+
>
|
|
159
|
+
<Box as="span" padding={2}>
|
|
160
|
+
<TextHeadline as="span">Click me...</TextHeadline>
|
|
161
|
+
</Box>
|
|
162
|
+
</Pressable>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Pressable with Transparent Background
|
|
166
|
+
|
|
167
|
+
```jsx
|
|
168
|
+
<Pressable
|
|
169
|
+
onPress={console.log}
|
|
170
|
+
as="button"
|
|
171
|
+
background="transparent"
|
|
172
|
+
borderColor="lineHeavy"
|
|
173
|
+
borderWidth={100}
|
|
174
|
+
borderRadius={300}
|
|
175
|
+
>
|
|
176
|
+
<Box as="span" padding={2}>
|
|
177
|
+
<Text font="headline" as="span">
|
|
178
|
+
Click me...
|
|
179
|
+
</Text>
|
|
180
|
+
</Box>
|
|
181
|
+
</Pressable>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Block Pressable
|
|
185
|
+
|
|
186
|
+
Pressables support an `onPress` prop for handling click/press interactions. When being pressed, the element will scale down to mimic a real-world button press. If this functionality is not desired, pass the `noScaleOnPress` prop.
|
|
187
|
+
|
|
188
|
+
```jsx
|
|
189
|
+
<Pressable
|
|
190
|
+
block
|
|
191
|
+
onPress={console.log}
|
|
192
|
+
background="bgAlternate"
|
|
193
|
+
borderColor="lineHeavy"
|
|
194
|
+
borderWidth={100}
|
|
195
|
+
borderRadius={300}
|
|
196
|
+
>
|
|
197
|
+
<Box as="span" padding={2}>
|
|
198
|
+
<TextHeadline as="span">Click me...</TextHeadline>
|
|
199
|
+
</Box>
|
|
200
|
+
</Pressable>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### A11y
|
|
204
|
+
|
|
205
|
+
On mobile, all [AccessibilityProps](https://reactnative.dev/docs/accessibility#accessibility-properties) can be passed, with `accessibilityComponentType` and `accessibilityTraits` defaulting to `button`, and `accessibilityState` being set based on loading/disabled props.
|
|
206
|
+
|
|
207
|
+
On web, all [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) can be passed, with `aria-busy` being set based on loading/disabled props.
|
|
208
|
+
|
|
209
|
+
> The `as` prop allows any component to be used, but be sure you are using semantically correct elements! For example, no clickable divs.
|
|
210
|
+
|
|
211
|
+
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# ProgressBar
|
|
2
|
+
|
|
3
|
+
A visual indicator of completion progress.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import { ProgressBar } from '@coinbase/cds-mobile/visualizations/ProgressBar'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `progress` | `number` | Yes | `-` | Number between 0-1 representing the progress percentage |
|
|
16
|
+
| `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 | `primary` | Custom progress color. |
|
|
17
|
+
| `disableAnimateOnMount` | `boolean` | No | `false` | Disable animation on component mount |
|
|
18
|
+
| `disabled` | `boolean` | No | `false` | Toggle used to show a disabled progress visualization |
|
|
19
|
+
| `key` | `Key \| null` | No | `-` | - |
|
|
20
|
+
| `onAnimationEnd` | `(() => void)` | No | `-` | Callback fired when the progress animation ends. |
|
|
21
|
+
| `onAnimationStart` | `(() => void)` | No | `-` | Callback fired when the progress animation starts. |
|
|
22
|
+
| `ref` | `((instance: View \| null) => void) \| RefObject<View> \| null` | No | `-` | - |
|
|
23
|
+
| `style` | `null \| false \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>>` | No | `-` | Custom styles for the progress bar root. |
|
|
24
|
+
| `styles` | `{ root?: StyleProp<ViewStyle>; progress?: StyleProp<ViewStyle>; }` | No | `-` | Custom styles for the progress bar. |
|
|
25
|
+
| `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 |
|
|
26
|
+
| `weight` | `normal \| heavy \| thin \| semiheavy` | No | `normal` | Toggle used to change thickness of progress visualization |
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Examples
|
|
30
|
+
|
|
31
|
+
### Default
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
<VStack gap={2}>
|
|
35
|
+
<ProgressBar progress={0} />
|
|
36
|
+
<ProgressBar progress={0.5} />
|
|
37
|
+
<ProgressBar progress={1} />
|
|
38
|
+
</VStack>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Weights
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
<VStack gap={2}>
|
|
45
|
+
<ProgressBar weight="thin" progress={0.3} />
|
|
46
|
+
<ProgressBar weight="normal" progress={0.5} />
|
|
47
|
+
<ProgressBar weight="semiheavy" progress={0.7} />
|
|
48
|
+
<ProgressBar weight="heavy" progress={0.9} />
|
|
49
|
+
</VStack>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Disabled
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<VStack gap={2}>
|
|
56
|
+
<ProgressBar disabled progress={0} />
|
|
57
|
+
<ProgressBar disabled progress={0.5} />
|
|
58
|
+
<ProgressBar disabled progress={1} />
|
|
59
|
+
</VStack>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Colors
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
<VStack gap={2}>
|
|
66
|
+
<ProgressBar color="bgPositive" progress={0.5} />
|
|
67
|
+
<ProgressBar color="bgNegative" progress={0.5} />
|
|
68
|
+
<ProgressBar color="bgPrimary" progress={0.5} />
|
|
69
|
+
<ProgressBar color="bgWarning" progress={0.5} />
|
|
70
|
+
<ProgressBar color="fg" progress={0.5} />
|
|
71
|
+
<ProgressBar disabled color="fg" progress={0.5} />
|
|
72
|
+
</VStack>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Custom Styles
|
|
76
|
+
|
|
77
|
+
You can customize the appearance of the progress bar using the `styles` prop. The `root` style controls the container, and `progress` controls the fill bar.
|
|
78
|
+
|
|
79
|
+
```tsx live
|
|
80
|
+
<ProgressContainerWithButtons>
|
|
81
|
+
{({ calculateProgress }) => (
|
|
82
|
+
<VStack gap={2}>
|
|
83
|
+
<ProgressBar
|
|
84
|
+
progress={calculateProgress(0.6)}
|
|
85
|
+
styles={{
|
|
86
|
+
progress: { backgroundColor: 'orange' },
|
|
87
|
+
}}
|
|
88
|
+
/>
|
|
89
|
+
<ProgressBar
|
|
90
|
+
progress={calculateProgress(0.3)}
|
|
91
|
+
styles={{
|
|
92
|
+
root: { height: 32, borderRadius: 16 },
|
|
93
|
+
progress: { borderRadius: 16 },
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
</VStack>
|
|
97
|
+
)}
|
|
98
|
+
</ProgressContainerWithButtons>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Animation Callbacks
|
|
102
|
+
|
|
103
|
+
You can use the `onAnimationStart` and `onAnimationEnd` callbacks to track the progress of the animation.
|
|
104
|
+
|
|
105
|
+
```jsx
|
|
106
|
+
function Example() {
|
|
107
|
+
const [animationStatus, setAnimationStatus] = React.useState('Ready');
|
|
108
|
+
|
|
109
|
+
const handleAnimationStart = useCallback(() => {
|
|
110
|
+
setAnimationStatus('Animating...');
|
|
111
|
+
}, []);
|
|
112
|
+
|
|
113
|
+
const handleAnimationEnd = useCallback(() => {
|
|
114
|
+
setAnimationStatus('Animation Ended');
|
|
115
|
+
}, []);
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<VStack gap={2}>
|
|
119
|
+
<Text>Animation Status: {animationStatus}</Text>
|
|
120
|
+
<ProgressBar
|
|
121
|
+
onAnimationEnd={handleAnimationEnd}
|
|
122
|
+
onAnimationStart={handleAnimationStart}
|
|
123
|
+
progress={calculateProgress(0.2)}
|
|
124
|
+
/>
|
|
125
|
+
</VStack>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# ProgressBarWithFixedLabels
|
|
2
|
+
|
|
3
|
+
A ProgressBar with fixed labels at defined positions.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import { ProgressBarWithFixedLabels } from '@coinbase/cds-mobile/visualizations/ProgressBarWithFixedLabels'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `disabled` | `boolean` | No | `false` | Toggle used to show a disabled progress visualization |
|
|
16
|
+
| `endLabel` | `number \| { value: number; render: (num: number, disabled?: boolean \| undefined) => ReactNode; }` | No | `-` | Label that is pinned to the end of the container. If a number is used then it will format it as a percentage. |
|
|
17
|
+
| `labelPlacement` | `above \| below \| beside` | No | `beside` | Position of label relative to the bar |
|
|
18
|
+
| `startLabel` | `number \| { value: number; render: (num: number, disabled?: boolean \| undefined) => ReactNode; }` | No | `-` | Label that is pinned to the start of the container. If a number is used then it will format it as a percentage. |
|
|
19
|
+
| `style` | `null \| false \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>>` | No | `-` | Custom styles for the progress bar with fixed labels root. |
|
|
20
|
+
| `styles` | `{ root?: StyleProp<ViewStyle>; labelContainer?: StyleProp<ViewStyle>; startLabel?: StyleProp<TextStyle>; endLabel?: StyleProp<TextStyle>; }` | No | `-` | Custom styles for the progress bar with fixed labels. |
|
|
21
|
+
| `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 |
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
### Label Below
|
|
27
|
+
|
|
28
|
+
```jsx live
|
|
29
|
+
<VStack gap={2}>
|
|
30
|
+
<ProgressBarWithFixedLabels startLabel={0} endLabel={20} labelPlacement="below">
|
|
31
|
+
<ProgressBar progress={0.2} />
|
|
32
|
+
</ProgressBarWithFixedLabels>
|
|
33
|
+
<ProgressBarWithFixedLabels endLabel={20} labelPlacement="below">
|
|
34
|
+
<ProgressBar progress={0.2} />
|
|
35
|
+
</ProgressBarWithFixedLabels>
|
|
36
|
+
</VStack>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Label Beside
|
|
40
|
+
|
|
41
|
+
```jsx live
|
|
42
|
+
<VStack gap={2}>
|
|
43
|
+
<ProgressBarWithFixedLabels startLabel={0} endLabel={20} labelPlacement="beside">
|
|
44
|
+
<ProgressBar progress={0.2} />
|
|
45
|
+
</ProgressBarWithFixedLabels>
|
|
46
|
+
<ProgressBarWithFixedLabels endLabel={20} labelPlacement="beside">
|
|
47
|
+
<ProgressBar progress={0.2} />
|
|
48
|
+
</ProgressBarWithFixedLabels>
|
|
49
|
+
</VStack>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Disabled
|
|
53
|
+
|
|
54
|
+
```jsx live
|
|
55
|
+
<VStack gap={2}>
|
|
56
|
+
<ProgressBarWithFixedLabels startLabel={0} endLabel={20} disabled labelPlacement="beside">
|
|
57
|
+
<ProgressBar disabled progress={0.2} />
|
|
58
|
+
</ProgressBarWithFixedLabels>
|
|
59
|
+
<ProgressBarWithFixedLabels startLabel={0} endLabel={20} disabled labelPlacement="above">
|
|
60
|
+
<ProgressBar disabled progress={0.2} />
|
|
61
|
+
</ProgressBarWithFixedLabels>
|
|
62
|
+
</VStack>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Custom Labels
|
|
66
|
+
|
|
67
|
+
```jsx live
|
|
68
|
+
function Example() {
|
|
69
|
+
const renderStartLabelNumStr = useCallback((num) => {
|
|
70
|
+
return `$${num.toLocaleString()}`;
|
|
71
|
+
}, []);
|
|
72
|
+
|
|
73
|
+
const renderEndLabelNumStr = useCallback((num) => {
|
|
74
|
+
return `${num.toLocaleString()} left`;
|
|
75
|
+
}, []);
|
|
76
|
+
|
|
77
|
+
const renderStartLabelNum = useCallback((num, disabled) => {
|
|
78
|
+
return (
|
|
79
|
+
<TextTitle3 disabled={disabled} as="span">
|
|
80
|
+
${num.toLocaleString()}
|
|
81
|
+
</TextTitle3>
|
|
82
|
+
);
|
|
83
|
+
}, []);
|
|
84
|
+
|
|
85
|
+
const renderEndLabelNum = useCallback((num, disabled) => {
|
|
86
|
+
return (
|
|
87
|
+
<TextLabel2 disabled={disabled} as="span" align="end" noWrap>
|
|
88
|
+
${num.toLocaleString()} left
|
|
89
|
+
</TextLabel2>
|
|
90
|
+
);
|
|
91
|
+
}, []);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<VStack gap={2}>
|
|
95
|
+
<ProgressBarWithFixedLabels
|
|
96
|
+
startLabel={{ value: 12500, render: renderStartLabelNumStr }}
|
|
97
|
+
endLabel={{ value: 35500, render: renderEndLabelNumStr }}
|
|
98
|
+
labelPlacement="above"
|
|
99
|
+
>
|
|
100
|
+
<ProgressBar progress={0.6} />
|
|
101
|
+
</ProgressBarWithFixedLabels>
|
|
102
|
+
<ProgressBarWithFixedLabels
|
|
103
|
+
startLabel={{ value: 12500, render: renderStartLabelNum }}
|
|
104
|
+
endLabel={{ value: 35500, render: renderEndLabelNum }}
|
|
105
|
+
labelPlacement="above"
|
|
106
|
+
>
|
|
107
|
+
<ProgressBar progress={0.6} />
|
|
108
|
+
</ProgressBarWithFixedLabels>
|
|
109
|
+
|
|
110
|
+
<ProgressBarWithFixedLabels
|
|
111
|
+
startLabel={{ value: 12500, render: renderStartLabelNumStr }}
|
|
112
|
+
endLabel={{ value: 35500, render: renderEndLabelNumStr }}
|
|
113
|
+
labelPlacement="above"
|
|
114
|
+
disabled
|
|
115
|
+
>
|
|
116
|
+
<ProgressBar disabled progress={0.6} />
|
|
117
|
+
</ProgressBarWithFixedLabels>
|
|
118
|
+
<ProgressBarWithFixedLabels
|
|
119
|
+
startLabel={{ value: 12500, render: renderStartLabelNum }}
|
|
120
|
+
endLabel={{ value: 35500, render: renderEndLabelNum }}
|
|
121
|
+
labelPlacement="above"
|
|
122
|
+
disabled
|
|
123
|
+
>
|
|
124
|
+
<ProgressBar disabled progress={0.6} />
|
|
125
|
+
</ProgressBarWithFixedLabels>
|
|
126
|
+
</VStack>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Custom Styles
|
|
132
|
+
|
|
133
|
+
You can customize the appearance of the progress bar and labels using the `styles` prop.
|
|
134
|
+
|
|
135
|
+
```tsx live
|
|
136
|
+
<ProgressContainerWithButtons>
|
|
137
|
+
{({ calculateProgress }) => (
|
|
138
|
+
<VStack gap={2}>
|
|
139
|
+
<ProgressBarWithFixedLabels
|
|
140
|
+
endLabel={Math.round(calculateProgress(0.7) * 100)}
|
|
141
|
+
labelPlacement="above"
|
|
142
|
+
startLabel={0}
|
|
143
|
+
styles={{
|
|
144
|
+
startLabel: { color: 'red' },
|
|
145
|
+
endLabel: { color: 'green' },
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
<ProgressBar
|
|
149
|
+
progress={calculateProgress(0.7)}
|
|
150
|
+
styles={{
|
|
151
|
+
root: { height: 24 },
|
|
152
|
+
progress: { borderRadius: 12 },
|
|
153
|
+
}}
|
|
154
|
+
/>
|
|
155
|
+
</ProgressBarWithFixedLabels>
|
|
156
|
+
</VStack>
|
|
157
|
+
)}
|
|
158
|
+
</ProgressContainerWithButtons>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
|