@coinbase/cds-mcp-server 8.17.2 → 8.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/mcp-docs/mobile/components/Accordion.txt +188 -0
- package/mcp-docs/mobile/components/AccordionItem.txt +29 -0
- package/mcp-docs/mobile/components/Alert.txt +155 -0
- package/mcp-docs/mobile/components/AreaChart.txt +265 -0
- package/mcp-docs/mobile/components/Avatar.txt +195 -0
- package/mcp-docs/mobile/components/AvatarButton.txt +225 -0
- package/mcp-docs/mobile/components/Banner.txt +221 -0
- package/mcp-docs/mobile/components/BarChart.txt +815 -0
- package/mcp-docs/mobile/components/Box.txt +173 -0
- package/mcp-docs/mobile/components/BrowserBar.txt +146 -0
- package/mcp-docs/mobile/components/Button.txt +198 -0
- package/mcp-docs/mobile/components/ButtonGroup.txt +79 -0
- package/mcp-docs/mobile/components/Carousel.txt +1083 -0
- package/mcp-docs/mobile/components/CartesianChart.txt +825 -0
- package/mcp-docs/mobile/components/CellMedia.txt +70 -0
- package/mcp-docs/mobile/components/Checkbox.txt +245 -0
- package/mcp-docs/mobile/components/CheckboxCell.txt +201 -0
- package/mcp-docs/mobile/components/CheckboxGroup.txt +284 -0
- package/mcp-docs/mobile/components/Chip.txt +194 -0
- package/mcp-docs/mobile/components/Coachmark.txt +157 -0
- package/mcp-docs/mobile/components/Collapsible.txt +104 -0
- package/mcp-docs/mobile/components/ContainedAssetCard.txt +134 -0
- package/mcp-docs/mobile/components/ContentCard.txt +365 -0
- package/mcp-docs/mobile/components/ContentCardBody.txt +135 -0
- package/mcp-docs/mobile/components/ContentCardFooter.txt +127 -0
- package/mcp-docs/mobile/components/ContentCardHeader.txt +145 -0
- package/mcp-docs/mobile/components/ContentCell.txt +226 -0
- package/mcp-docs/mobile/components/ControlGroup.txt +443 -0
- package/mcp-docs/mobile/components/DatePicker.txt +496 -0
- package/mcp-docs/mobile/components/Divider.txt +138 -0
- package/mcp-docs/mobile/components/DotCount.txt +145 -0
- package/mcp-docs/mobile/components/DotStatusColor.txt +58 -0
- package/mcp-docs/mobile/components/DotSymbol.txt +134 -0
- package/mcp-docs/mobile/components/Fallback.txt +157 -0
- package/mcp-docs/mobile/components/FloatingAssetCard.txt +155 -0
- package/mcp-docs/mobile/components/HStack.txt +234 -0
- package/mcp-docs/mobile/components/HeroSquare.txt +47 -0
- package/mcp-docs/mobile/components/Icon.txt +51 -0
- package/mcp-docs/mobile/components/IconButton.txt +268 -0
- package/mcp-docs/mobile/components/InputChip.txt +187 -0
- package/mcp-docs/mobile/components/Interactable.txt +186 -0
- package/mcp-docs/mobile/components/LineChart.txt +1324 -0
- package/mcp-docs/mobile/components/Link.txt +291 -0
- package/mcp-docs/mobile/components/ListCell.txt +412 -0
- package/mcp-docs/mobile/components/LogoMark.txt +84 -0
- package/mcp-docs/mobile/components/LogoWordMark.txt +93 -0
- package/mcp-docs/mobile/components/Lottie.txt +138 -0
- package/mcp-docs/mobile/components/LottieStatusAnimation.txt +46 -0
- package/mcp-docs/mobile/components/Modal.txt +83 -0
- package/mcp-docs/mobile/components/ModalBody.txt +33 -0
- package/mcp-docs/mobile/components/ModalFooter.txt +24 -0
- package/mcp-docs/mobile/components/ModalHeader.txt +27 -0
- package/mcp-docs/mobile/components/MultiContentModule.txt +379 -0
- package/mcp-docs/mobile/components/NavigationTitle.txt +131 -0
- package/mcp-docs/mobile/components/NavigationTitleSelect.txt +141 -0
- package/mcp-docs/mobile/components/NudgeCard.txt +89 -0
- package/mcp-docs/mobile/components/Numpad.txt +340 -0
- package/mcp-docs/mobile/components/Overlay.txt +151 -0
- package/mcp-docs/mobile/components/PageFooter.txt +160 -0
- package/mcp-docs/mobile/components/PageHeader.txt +185 -0
- package/mcp-docs/mobile/components/PeriodSelector.txt +407 -0
- package/mcp-docs/mobile/components/Pictogram.txt +47 -0
- package/mcp-docs/mobile/components/Point.txt +204 -0
- package/mcp-docs/mobile/components/PortalProvider.txt +78 -0
- package/mcp-docs/mobile/components/Pressable.txt +210 -0
- package/mcp-docs/mobile/components/ProgressBar.txt +129 -0
- package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +160 -0
- package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +137 -0
- package/mcp-docs/mobile/components/ProgressCircle.txt +236 -0
- package/mcp-docs/mobile/components/Radio.txt +241 -0
- package/mcp-docs/mobile/components/RadioCell.txt +201 -0
- package/mcp-docs/mobile/components/RadioGroup.txt +281 -0
- package/mcp-docs/mobile/components/ReferenceLine.txt +152 -0
- package/mcp-docs/mobile/components/RemoteImage.txt +105 -0
- package/mcp-docs/mobile/components/RemoteImageGroup.txt +60 -0
- package/mcp-docs/mobile/components/RollingNumber.txt +788 -0
- package/mcp-docs/mobile/components/Scrubber.txt +203 -0
- package/mcp-docs/mobile/components/SearchInput.txt +191 -0
- package/mcp-docs/mobile/components/SectionHeader.txt +204 -0
- package/mcp-docs/mobile/components/SegmentedTabs.txt +315 -0
- package/mcp-docs/mobile/components/Select.txt +211 -0
- package/mcp-docs/mobile/components/SelectChip.txt +323 -0
- package/mcp-docs/mobile/components/SelectOption.txt +84 -0
- package/mcp-docs/mobile/components/SlideButton.txt +330 -0
- package/mcp-docs/mobile/components/Spacer.txt +83 -0
- package/mcp-docs/mobile/components/Sparkline.txt +122 -0
- package/mcp-docs/mobile/components/SparklineGradient.txt +106 -0
- package/mcp-docs/mobile/components/SparklineInteractive.txt +156 -0
- package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +72 -0
- package/mcp-docs/mobile/components/Spinner.txt +48 -0
- package/mcp-docs/mobile/components/SpotIcon.txt +47 -0
- package/mcp-docs/mobile/components/SpotRectangle.txt +47 -0
- package/mcp-docs/mobile/components/SpotSquare.txt +47 -0
- package/mcp-docs/mobile/components/Stepper.txt +527 -0
- package/mcp-docs/mobile/components/SubBrandLogoMark.txt +125 -0
- package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +125 -0
- package/mcp-docs/mobile/components/Switch.txt +97 -0
- package/mcp-docs/mobile/components/TabIndicator.txt +48 -0
- package/mcp-docs/mobile/components/TabLabel.txt +153 -0
- package/mcp-docs/mobile/components/TabNavigation.txt +146 -0
- package/mcp-docs/mobile/components/TabbedChips.txt +142 -0
- package/mcp-docs/mobile/components/Tabs.txt +190 -0
- package/mcp-docs/mobile/components/Tag.txt +300 -0
- package/mcp-docs/mobile/components/Text.txt +211 -0
- package/mcp-docs/mobile/components/TextInput.txt +717 -0
- package/mcp-docs/mobile/components/ThemeProvider.txt +132 -0
- package/mcp-docs/mobile/components/Toast.txt +196 -0
- package/mcp-docs/mobile/components/Tooltip.txt +59 -0
- package/mcp-docs/mobile/components/TopNavBar.txt +161 -0
- package/mcp-docs/mobile/components/Tour.txt +158 -0
- package/mcp-docs/mobile/components/Tray.txt +252 -0
- package/mcp-docs/mobile/components/UpsellCard.txt +321 -0
- package/mcp-docs/mobile/components/VStack.txt +222 -0
- package/mcp-docs/mobile/components/XAxis.txt +621 -0
- package/mcp-docs/mobile/components/YAxis.txt +567 -0
- package/mcp-docs/mobile/getting-started/ai-overview.txt +108 -0
- package/mcp-docs/mobile/getting-started/installation.txt +57 -0
- package/mcp-docs/mobile/getting-started/introduction.txt +102 -0
- package/mcp-docs/mobile/getting-started/playground.txt +28 -0
- package/mcp-docs/mobile/getting-started/styling.txt +84 -0
- package/mcp-docs/mobile/getting-started/theming.txt +286 -0
- package/mcp-docs/mobile/hooks/useDimensions.txt +72 -0
- package/mcp-docs/mobile/hooks/useEventHandler.txt +120 -0
- package/mcp-docs/mobile/hooks/useMergeRefs.txt +116 -0
- package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +280 -0
- package/mcp-docs/mobile/hooks/usePreviousValue.txt +74 -0
- package/mcp-docs/mobile/hooks/useRefMap.txt +178 -0
- package/mcp-docs/mobile/hooks/useTheme.txt +321 -0
- package/mcp-docs/mobile/routes.txt +139 -0
- package/mcp-docs/web/components/Accordion.txt +189 -0
- package/mcp-docs/web/components/AccordionItem.txt +31 -0
- package/mcp-docs/web/components/Alert.txt +164 -0
- package/mcp-docs/web/components/AreaChart.txt +510 -0
- package/mcp-docs/web/components/Avatar.txt +211 -0
- package/mcp-docs/web/components/AvatarButton.txt +240 -0
- package/mcp-docs/web/components/Banner.txt +226 -0
- package/mcp-docs/web/components/BarChart.txt +1267 -0
- package/mcp-docs/web/components/Box.txt +175 -0
- package/mcp-docs/web/components/Button.txt +212 -0
- package/mcp-docs/web/components/ButtonGroup.txt +79 -0
- package/mcp-docs/web/components/Calendar.txt +181 -0
- package/mcp-docs/web/components/Carousel.txt +1575 -0
- package/mcp-docs/web/components/CartesianChart.txt +1044 -0
- package/mcp-docs/web/components/CellMedia.txt +56 -0
- package/mcp-docs/web/components/Checkbox.txt +188 -0
- package/mcp-docs/web/components/CheckboxCell.txt +202 -0
- package/mcp-docs/web/components/CheckboxGroup.txt +219 -0
- package/mcp-docs/web/components/Chip.txt +196 -0
- package/mcp-docs/web/components/Coachmark.txt +188 -0
- package/mcp-docs/web/components/Collapsible.txt +119 -0
- package/mcp-docs/web/components/ContainedAssetCard.txt +232 -0
- package/mcp-docs/web/components/ContentCard.txt +367 -0
- package/mcp-docs/web/components/ContentCardBody.txt +137 -0
- package/mcp-docs/web/components/ContentCardFooter.txt +129 -0
- package/mcp-docs/web/components/ContentCardHeader.txt +147 -0
- package/mcp-docs/web/components/ContentCell.txt +219 -0
- package/mcp-docs/web/components/ControlGroup.txt +436 -0
- package/mcp-docs/web/components/DatePicker.txt +505 -0
- package/mcp-docs/web/components/Divider.txt +143 -0
- package/mcp-docs/web/components/DotCount.txt +149 -0
- package/mcp-docs/web/components/DotStatusColor.txt +58 -0
- package/mcp-docs/web/components/DotSymbol.txt +137 -0
- package/mcp-docs/web/components/Dropdown.txt +119 -0
- package/mcp-docs/web/components/Fallback.txt +163 -0
- package/mcp-docs/web/components/FloatingAssetCard.txt +250 -0
- package/mcp-docs/web/components/FullscreenAlert.txt +69 -0
- package/mcp-docs/web/components/FullscreenModal.txt +145 -0
- package/mcp-docs/web/components/FullscreenModalLayout.txt +187 -0
- package/mcp-docs/web/components/Grid.txt +236 -0
- package/mcp-docs/web/components/GridColumn.txt +209 -0
- package/mcp-docs/web/components/HStack.txt +236 -0
- package/mcp-docs/web/components/HeroSquare.txt +48 -0
- package/mcp-docs/web/components/Icon.txt +145 -0
- package/mcp-docs/web/components/IconButton.txt +390 -0
- package/mcp-docs/web/components/InputChip.txt +187 -0
- package/mcp-docs/web/components/Interactable.txt +193 -0
- package/mcp-docs/web/components/LineChart.txt +1576 -0
- package/mcp-docs/web/components/Link.txt +243 -0
- package/mcp-docs/web/components/ListCell.txt +418 -0
- package/mcp-docs/web/components/LogoMark.txt +84 -0
- package/mcp-docs/web/components/LogoWordMark.txt +93 -0
- package/mcp-docs/web/components/Lottie.txt +157 -0
- package/mcp-docs/web/components/LottieStatusAnimation.txt +57 -0
- package/mcp-docs/web/components/MediaQueryProvider.txt +108 -0
- package/mcp-docs/web/components/Modal.txt +196 -0
- package/mcp-docs/web/components/ModalBody.txt +117 -0
- package/mcp-docs/web/components/ModalFooter.txt +119 -0
- package/mcp-docs/web/components/ModalHeader.txt +123 -0
- package/mcp-docs/web/components/MultiContentModule.txt +381 -0
- package/mcp-docs/web/components/NavigationBar.txt +102 -0
- package/mcp-docs/web/components/NavigationTitle.txt +25 -0
- package/mcp-docs/web/components/NavigationTitleSelect.txt +45 -0
- package/mcp-docs/web/components/NudgeCard.txt +181 -0
- package/mcp-docs/web/components/Overlay.txt +171 -0
- package/mcp-docs/web/components/PageFooter.txt +184 -0
- package/mcp-docs/web/components/PageHeader.txt +243 -0
- package/mcp-docs/web/components/Pagination.txt +499 -0
- package/mcp-docs/web/components/PeriodSelector.txt +703 -0
- package/mcp-docs/web/components/Pictogram.txt +48 -0
- package/mcp-docs/web/components/Point.txt +460 -0
- package/mcp-docs/web/components/PortalProvider.txt +76 -0
- package/mcp-docs/web/components/Pressable.txt +193 -0
- package/mcp-docs/web/components/ProgressBar.txt +163 -0
- package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +212 -0
- package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +181 -0
- package/mcp-docs/web/components/ProgressCircle.txt +443 -0
- package/mcp-docs/web/components/Radio.txt +219 -0
- package/mcp-docs/web/components/RadioCell.txt +215 -0
- package/mcp-docs/web/components/RadioGroup.txt +288 -0
- package/mcp-docs/web/components/ReferenceLine.txt +451 -0
- package/mcp-docs/web/components/RemoteImage.txt +165 -0
- package/mcp-docs/web/components/RemoteImageGroup.txt +86 -0
- package/mcp-docs/web/components/RollingNumber.txt +1021 -0
- package/mcp-docs/web/components/Scrubber.txt +231 -0
- package/mcp-docs/web/components/SearchInput.txt +117 -0
- package/mcp-docs/web/components/SectionHeader.txt +217 -0
- package/mcp-docs/web/components/SegmentedTabs.txt +324 -0
- package/mcp-docs/web/components/Select.txt +224 -0
- package/mcp-docs/web/components/SelectChip.txt +314 -0
- package/mcp-docs/web/components/SelectOption.txt +165 -0
- package/mcp-docs/web/components/Sidebar.txt +349 -0
- package/mcp-docs/web/components/SidebarItem.txt +131 -0
- package/mcp-docs/web/components/SidebarMoreMenu.txt +30 -0
- package/mcp-docs/web/components/Spacer.txt +173 -0
- package/mcp-docs/web/components/Sparkline.txt +122 -0
- package/mcp-docs/web/components/SparklineGradient.txt +106 -0
- package/mcp-docs/web/components/SparklineInteractive.txt +153 -0
- package/mcp-docs/web/components/SparklineInteractiveHeader.txt +76 -0
- package/mcp-docs/web/components/Spinner.txt +128 -0
- package/mcp-docs/web/components/SpotIcon.txt +48 -0
- package/mcp-docs/web/components/SpotRectangle.txt +48 -0
- package/mcp-docs/web/components/SpotSquare.txt +48 -0
- package/mcp-docs/web/components/Stepper.txt +682 -0
- package/mcp-docs/web/components/SubBrandLogoMark.txt +125 -0
- package/mcp-docs/web/components/SubBrandLogoWordMark.txt +125 -0
- package/mcp-docs/web/components/Switch.txt +85 -0
- package/mcp-docs/web/components/TabIndicator.txt +48 -0
- package/mcp-docs/web/components/TabLabel.txt +158 -0
- package/mcp-docs/web/components/TabNavigation.txt +159 -0
- package/mcp-docs/web/components/TabbedChips.txt +155 -0
- package/mcp-docs/web/components/Table.txt +367 -0
- package/mcp-docs/web/components/TableBody.txt +83 -0
- package/mcp-docs/web/components/TableCaption.txt +102 -0
- package/mcp-docs/web/components/TableCell.txt +165 -0
- package/mcp-docs/web/components/TableCellFallback.txt +97 -0
- package/mcp-docs/web/components/TableFooter.txt +83 -0
- package/mcp-docs/web/components/TableHeader.txt +100 -0
- package/mcp-docs/web/components/TableRow.txt +140 -0
- package/mcp-docs/web/components/Tabs.txt +212 -0
- package/mcp-docs/web/components/Tag.txt +304 -0
- package/mcp-docs/web/components/Text.txt +232 -0
- package/mcp-docs/web/components/TextInput.txt +652 -0
- package/mcp-docs/web/components/ThemeProvider.txt +199 -0
- package/mcp-docs/web/components/TileButton.txt +158 -0
- package/mcp-docs/web/components/Toast.txt +203 -0
- package/mcp-docs/web/components/Tooltip.txt +89 -0
- package/mcp-docs/web/components/Tour.txt +179 -0
- package/mcp-docs/web/components/Tray.txt +288 -0
- package/mcp-docs/web/components/UpsellCard.txt +319 -0
- package/mcp-docs/web/components/VStack.txt +224 -0
- package/mcp-docs/web/components/XAxis.txt +619 -0
- package/mcp-docs/web/components/YAxis.txt +548 -0
- package/mcp-docs/web/getting-started/ai-overview.txt +108 -0
- package/mcp-docs/web/getting-started/installation.txt +103 -0
- package/mcp-docs/web/getting-started/introduction.txt +102 -0
- package/mcp-docs/web/getting-started/playground.txt +28 -0
- package/mcp-docs/web/getting-started/styling.txt +161 -0
- package/mcp-docs/web/getting-started/templates.txt +121 -0
- package/mcp-docs/web/getting-started/theming.txt +426 -0
- package/mcp-docs/web/hooks/useBreakpoints.txt +61 -0
- package/mcp-docs/web/hooks/useDimensions.txt +114 -0
- package/mcp-docs/web/hooks/useEventHandler.txt +120 -0
- package/mcp-docs/web/hooks/useHasMounted.txt +75 -0
- package/mcp-docs/web/hooks/useIsoEffect.txt +58 -0
- package/mcp-docs/web/hooks/useMediaQuery.txt +114 -0
- package/mcp-docs/web/hooks/useMergeRefs.txt +116 -0
- package/mcp-docs/web/hooks/useOverlayContentContext.txt +279 -0
- package/mcp-docs/web/hooks/usePreviousValue.txt +74 -0
- package/mcp-docs/web/hooks/useRefMap.txt +178 -0
- package/mcp-docs/web/hooks/useScrollBlocker.txt +82 -0
- package/mcp-docs/web/hooks/useTheme.txt +364 -0
- package/mcp-docs/web/routes.txt +163 -0
- package/package.json +1 -1
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
# Stepper
|
|
2
|
+
|
|
3
|
+
A component that visualizes states within a multi-step process.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Stepper } from '@coinbase/cds-mobile/stepper/Stepper'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic Usage
|
|
14
|
+
|
|
15
|
+
The stepper can be used in two directions: horizontal and vertical.
|
|
16
|
+
Each direction has its own unique default design in order to support different use cases.
|
|
17
|
+
|
|
18
|
+
#### Direction: Horizontal
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
const steps = [
|
|
22
|
+
{ id: '1', label: 'Account Details' },
|
|
23
|
+
{ id: '2', label: 'Personal Information' },
|
|
24
|
+
{ id: '3', label: 'Payment Method' },
|
|
25
|
+
{ id: '4', label: 'Review & Submit' },
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const [stepperState, stepperApi] = useStepper({ steps });
|
|
29
|
+
const [complete, setComplete] = useState(false);
|
|
30
|
+
|
|
31
|
+
// Handle completion logic in your component
|
|
32
|
+
const handleNext = () => {
|
|
33
|
+
if (stepperState.activeStepId === '4') {
|
|
34
|
+
setComplete(true);
|
|
35
|
+
} else {
|
|
36
|
+
stepperApi.goNextStep();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Stepper
|
|
42
|
+
direction="horizontal"
|
|
43
|
+
activeStepId={stepperState.activeStepId}
|
|
44
|
+
steps={steps}
|
|
45
|
+
complete={complete}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
#### Direction: Vertical
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
const steps = [
|
|
54
|
+
{ id: '1', label: 'Account Details' },
|
|
55
|
+
{ id: '2', label: 'Personal Information' },
|
|
56
|
+
{ id: '3', label: 'Payment Method' },
|
|
57
|
+
{ id: '4', label: 'Review & Submit' },
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
const [stepperState, stepperApi] = useStepper({ steps });
|
|
61
|
+
const [complete, setComplete] = useState(false);
|
|
62
|
+
|
|
63
|
+
// Handle completion logic in your component
|
|
64
|
+
const handleNext = () => {
|
|
65
|
+
if (stepperState.activeStepId === '4') {
|
|
66
|
+
setComplete(true);
|
|
67
|
+
} else {
|
|
68
|
+
stepperApi.goNextStep();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<Stepper
|
|
74
|
+
direction="vertical"
|
|
75
|
+
activeStepId={stepperState.activeStepId}
|
|
76
|
+
steps={steps}
|
|
77
|
+
complete={complete}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Step Config
|
|
83
|
+
|
|
84
|
+
The Stepper is ultimately a visual representation of an array of step objects (i.e. `StepperValue[]`).
|
|
85
|
+
These should be defined outside of the component or memoized prior to rendering a Stepper.
|
|
86
|
+
|
|
87
|
+
Commonly used or required **StepperValue** properties:
|
|
88
|
+
|
|
89
|
+
- `id` - A required, unique identifier for the step.
|
|
90
|
+
- `label` - The label of the step. Optionally exclude this property to hide the label text.
|
|
91
|
+
- `subSteps` - An optional array of sub-steps to nest under the step.
|
|
92
|
+
- `metadata` - An optional object that can be used to store additional data about the step. This is useful when providing your own custom Step components.
|
|
93
|
+
|
|
94
|
+
### useStepper hook
|
|
95
|
+
|
|
96
|
+
Call the `useStepper` hook to initialize stepper state, access the current state and perform state mutations with its API.
|
|
97
|
+
|
|
98
|
+
The hook returns a tuple where the first member is the current stepper state containing the `activeStepId`.
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
const [stepperState, stepperApi] = useStepper({ steps });
|
|
102
|
+
|
|
103
|
+
<Stepper direction="horizontal" activeStepId={stepperState.activeStepId} steps={steps} />;
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The second member is an API for manipulating the stepper state and includes the following methods:
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
type StepperApi = {
|
|
110
|
+
/** Update the currently active step to the step with `id`. */
|
|
111
|
+
goToStep: (id: string) => void;
|
|
112
|
+
/** Update the currently active step to the next enabled step in the steps array. Does nothing if the last step is already active. */
|
|
113
|
+
goNextStep: () => void;
|
|
114
|
+
/** Update the currently active step to the previous enabled step in the steps array. Does nothing if the first step is already active. */
|
|
115
|
+
goPreviousStep: () => void;
|
|
116
|
+
/** Reset the active step to the original default active step. */
|
|
117
|
+
reset: () => void;
|
|
118
|
+
};
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Common Patterns & Use Cases
|
|
122
|
+
|
|
123
|
+
#### Sub-steps
|
|
124
|
+
|
|
125
|
+
A common use-case for the vertical stepper is to visualize long and complex workflows with nested/grouped steps.
|
|
126
|
+
A StepperValue object optionally accepts a `subSteps` property, which is also an array of StepperValue objects.
|
|
127
|
+
|
|
128
|
+
:::danger Avoid Deep Nesting
|
|
129
|
+
Steps can be nested arbritrarily deep, however CDS does not advise nesting deeper than one level.
|
|
130
|
+
:::
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
const steps: StepperValue[] = [
|
|
134
|
+
{
|
|
135
|
+
id: 'first-step',
|
|
136
|
+
label: 'First step',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 'second-step',
|
|
140
|
+
label: 'Second step',
|
|
141
|
+
subSteps: [
|
|
142
|
+
{
|
|
143
|
+
id: 'second-step-substep-one',
|
|
144
|
+
label: 'Substep one',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: 'second-step-substep-two',
|
|
148
|
+
label: 'Substep two',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: 'second-step-substep-three',
|
|
152
|
+
label: 'Substep three',
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: 'final-step',
|
|
158
|
+
label: 'Final step',
|
|
159
|
+
},
|
|
160
|
+
];
|
|
161
|
+
|
|
162
|
+
const [stepperState, stepperApi] = useStepper({ steps });
|
|
163
|
+
const [complete, setComplete] = useState(false);
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
<Stepper
|
|
167
|
+
direction="vertical"
|
|
168
|
+
activeStepId={stepperState.activeStepId}
|
|
169
|
+
steps={steps}
|
|
170
|
+
complete={complete}
|
|
171
|
+
accessibilityLabel="Example Stepper"
|
|
172
|
+
/>
|
|
173
|
+
);
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Customization Options
|
|
177
|
+
|
|
178
|
+
#### 1. Custom Components
|
|
179
|
+
|
|
180
|
+
Stepper is highly customizable. Use the _Component_ props to customize Stepper with your own React components.
|
|
181
|
+
Components can be set on the Stepper or individually on each step. Custom components set on a specific step will override the same component set on the Stepper.
|
|
182
|
+
|
|
183
|
+
##### Customizable subcomponents
|
|
184
|
+
|
|
185
|
+
- **StepperHeaderComponent**: Rendered above the entire stepper, helpful to display an overall title or label.
|
|
186
|
+
- **StepperIconComponent**: Useful for showing a small visual with the step to convey state or the intent of the step.
|
|
187
|
+
- **StepperProgressComponent**: Can be used to show an animated marker of progress with each step.
|
|
188
|
+
- **StepperLabelComponent**: A component responsible for rendering the label text or main content associated with the step.
|
|
189
|
+
- **StepperSubstepContainerComponent**: Responsible for rendering the recursive sub-steps of a step.
|
|
190
|
+
|
|
191
|
+
Below are some basic diagrams to help visualize the Stepper anatomy in its two orientations.
|
|
192
|
+
|
|
193
|
+
```text
|
|
194
|
+
direction: horizontal
|
|
195
|
+
┌─────────────────────────────────┐
|
|
196
|
+
│ Step (VStack) │
|
|
197
|
+
│ ┌───────────────────────────┐ │
|
|
198
|
+
│ │ HStack │ │
|
|
199
|
+
│ │ ┌──────┐ ┌──────────────┐ │ │
|
|
200
|
+
│ │ │ Icon │ │ Progress │ │ │
|
|
201
|
+
│ │ │ │ │ │ │ │
|
|
202
|
+
│ │ └──────┘ └──────────────┘ │ │
|
|
203
|
+
│ └───────────────────────────┘ │
|
|
204
|
+
│ ┌───────────────────────────┐ │
|
|
205
|
+
│ │ Label │ │
|
|
206
|
+
│ └───────────────────────────┘ │
|
|
207
|
+
│ ┌───────────────────────────┐ │
|
|
208
|
+
│ │ SubstepContainer │ │
|
|
209
|
+
│ │ (recursive) │ │
|
|
210
|
+
│ └───────────────────────────┘ │
|
|
211
|
+
└─────────────────────────────────┘
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
```text
|
|
215
|
+
direction: vertical
|
|
216
|
+
┌─────────────────────────────────────────────────┐
|
|
217
|
+
│ Step (VStack) │
|
|
218
|
+
│ ┌───────────────────────────────────────────┐ │
|
|
219
|
+
│ │ HStack │ │
|
|
220
|
+
│ │ ┌─────────────┐ ┌───────────────────┐ │ │
|
|
221
|
+
│ │ │ VStack │ │ VStack │ │ │
|
|
222
|
+
│ │ │ ┌─────────┐ │ │ ┌───────────────┐ │ │ │
|
|
223
|
+
│ │ │ │ Icon │ │ │ │ Label │ │ │ │
|
|
224
|
+
│ │ │ └─────────┘ │ │ └───────────────┘ │ │ │
|
|
225
|
+
│ │ │ ┌─────────┐ │ │ ┌───────────────┐ │ │ │
|
|
226
|
+
│ │ │ │Progress │ │ │ │ Substeps │ │ │ │
|
|
227
|
+
│ │ │ └─────────┘ │ │ │ (recursive) │ │ │ │
|
|
228
|
+
│ │ └─────────────┘ │ └───────────────┘ │ │ │
|
|
229
|
+
│ └───────────────────────────────────────────┘ │
|
|
230
|
+
└─────────────────────────────────────────────────┘
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Each custom component receives a specific set of props that provide access to step data and state.
|
|
234
|
+
When writing your own components, make sure you're getting the most out of Stepper by importing our custom component types like so:
|
|
235
|
+
|
|
236
|
+
```tsx
|
|
237
|
+
import type { StepperLabelProps } from '@coinbase/cds-web/stepper/Stepper';
|
|
238
|
+
|
|
239
|
+
const TravelBookingLabel = ({
|
|
240
|
+
step,
|
|
241
|
+
active,
|
|
242
|
+
depth,
|
|
243
|
+
}: StepperLabelProps) => {
|
|
244
|
+
const { label, metadata, id } = step;
|
|
245
|
+
const subtitle = metadata?.subtitle as string;
|
|
246
|
+
|
|
247
|
+
if (depth === 0 && metadata) {
|
|
248
|
+
return (
|
|
249
|
+
<ListCell
|
|
250
|
+
description={metadata.name as string}
|
|
251
|
+
detail={metadata.date as string}
|
|
252
|
+
innerSpacing={{ paddingTop: 0, paddingBottom: 0 }}
|
|
253
|
+
maxWidth={350}
|
|
254
|
+
minHeight={undefined}
|
|
255
|
+
outerSpacing={{ paddingTop: 0, paddingBottom: 3, paddingStart: 0, paddingEnd: 0 }}
|
|
256
|
+
subdetail={metadata.time as string}
|
|
257
|
+
title={label}
|
|
258
|
+
/>
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
:::tip Using Default Components
|
|
264
|
+
In many cases, it may be helpful to compose the default Stepper Components within your own. For example, you may want to make the default label pressable.
|
|
265
|
+
All of the default components used by Stepper are exported and available for you to use.
|
|
266
|
+
|
|
267
|
+
```tsx
|
|
268
|
+
import { DefaultStepperLabelHorizontal } from '@coinbase/cds-web/stepper';
|
|
269
|
+
|
|
270
|
+
<Stepper
|
|
271
|
+
direction="horizontal"
|
|
272
|
+
StepperLabelComponent={(props) => (
|
|
273
|
+
<Pressable onClick={handleStepClick}>
|
|
274
|
+
<DefaultStepperLabelHorizontal {...props} />
|
|
275
|
+
</Pressable>
|
|
276
|
+
)}
|
|
277
|
+
/>;
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
:::
|
|
281
|
+
|
|
282
|
+
##### Null Components
|
|
283
|
+
|
|
284
|
+
Pass null to any of the component props to completely disable its functionality and hide it from the user.
|
|
285
|
+
|
|
286
|
+
```tsx
|
|
287
|
+
const steps = [
|
|
288
|
+
{ id: '1', label: 'Account Details' },
|
|
289
|
+
{ id: '2', label: 'Personal Information' },
|
|
290
|
+
{ id: '3', label: 'Payment Method' },
|
|
291
|
+
{ id: '4', label: 'Review & Submit' },
|
|
292
|
+
];
|
|
293
|
+
|
|
294
|
+
const [stepperState, stepperApi] = useStepper({ steps });
|
|
295
|
+
const [complete, setComplete] = useState(false);
|
|
296
|
+
|
|
297
|
+
return (
|
|
298
|
+
<Stepper
|
|
299
|
+
direction="horizontal"
|
|
300
|
+
StepperLabelComponent={null}
|
|
301
|
+
activeStepId={stepperState.activeStepId}
|
|
302
|
+
steps={steps}
|
|
303
|
+
complete={complete}
|
|
304
|
+
/>
|
|
305
|
+
);
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
##### Custom Metadata for Rich Step Data
|
|
309
|
+
|
|
310
|
+
The `metadata` property on each step allows you to store additional data that can be used
|
|
311
|
+
by custom components to create rich, interactive experiences. This is particularly useful
|
|
312
|
+
for complex workflows where each step needs to display contextual information.
|
|
313
|
+
|
|
314
|
+
```tsx
|
|
315
|
+
function StepperCustomMetadataExample() {
|
|
316
|
+
const CustomBookingLabel = ({ step, active }) => {
|
|
317
|
+
const { label, metadata } = step;
|
|
318
|
+
|
|
319
|
+
return (
|
|
320
|
+
<ListCell
|
|
321
|
+
title={label}
|
|
322
|
+
description={metadata.name}
|
|
323
|
+
detail={metadata.date}
|
|
324
|
+
subdetail={metadata.time}
|
|
325
|
+
maxWidth={350}
|
|
326
|
+
innerSpacing={{ paddingTop: 0, paddingBottom: 0 }}
|
|
327
|
+
outerSpacing={{ paddingTop: 0, paddingBottom: 3, paddingStart: 0, paddingEnd: 0 }}
|
|
328
|
+
minHeight={undefined}
|
|
329
|
+
/>
|
|
330
|
+
);
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
const bookingSteps: StepperValue<{
|
|
334
|
+
name: string;
|
|
335
|
+
date: string;
|
|
336
|
+
time: string;
|
|
337
|
+
}>[] = [
|
|
338
|
+
{
|
|
339
|
+
id: 'book-hotel',
|
|
340
|
+
label: 'Book Hotel',
|
|
341
|
+
metadata: {
|
|
342
|
+
name: 'Marriott Downtown',
|
|
343
|
+
date: '2025-06-13',
|
|
344
|
+
time: '3:00 PM Check-in',
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
id: 'book-flight',
|
|
349
|
+
label: 'Book Flight',
|
|
350
|
+
metadata: {
|
|
351
|
+
name: 'Delta Airlines',
|
|
352
|
+
date: '2025-06-13',
|
|
353
|
+
time: '11:03 AM Departure',
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
id: 'rental-car',
|
|
358
|
+
label: 'Reserve Rental Car',
|
|
359
|
+
metadata: {
|
|
360
|
+
name: 'Enterprise Rent-A-Car',
|
|
361
|
+
date: '2025-06-14',
|
|
362
|
+
time: '2:24 PM Pickup',
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
];
|
|
366
|
+
|
|
367
|
+
const [stepperState, stepperApi] = useStepper({
|
|
368
|
+
steps: bookingSteps,
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
return (
|
|
372
|
+
<Stepper
|
|
373
|
+
direction="vertical"
|
|
374
|
+
activeStepId={stepperState.activeStepId}
|
|
375
|
+
steps={bookingSteps}
|
|
376
|
+
complete={true}
|
|
377
|
+
StepperLabelComponent={CustomBookingLabel}
|
|
378
|
+
accessibilityLabel="Travel Booking Stepper"
|
|
379
|
+
/>
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
#### 2. styles API
|
|
385
|
+
|
|
386
|
+
The Stepper component provides flexible styling options through the `styles` prop.
|
|
387
|
+
Through this prop, you can apply inline styles to specific subcomponents of the Stepper; the same components which you can override with the `Component` props.
|
|
388
|
+
|
|
389
|
+
##### styles
|
|
390
|
+
|
|
391
|
+
The `styles` prop allows you to apply inline styles to specific child elements.
|
|
392
|
+
|
|
393
|
+
It accepts an object with the following optional keys:
|
|
394
|
+
|
|
395
|
+
- `header` - Applied to the header component
|
|
396
|
+
- `step` - Applied to each individual step element
|
|
397
|
+
- `substepContainer` - Applied to each substep container element
|
|
398
|
+
- `progress` - Applied to each step progress bar element
|
|
399
|
+
- `label` - Applied to each step label element
|
|
400
|
+
- `icon` - Applied to each step icon element
|
|
401
|
+
|
|
402
|
+
```tsx
|
|
403
|
+
<Stepper
|
|
404
|
+
direction="horizontal"
|
|
405
|
+
styles={{
|
|
406
|
+
step: { ... },
|
|
407
|
+
substepContainer: { ... },
|
|
408
|
+
label: { ... },
|
|
409
|
+
progress: { ... },
|
|
410
|
+
}}
|
|
411
|
+
// ... other props
|
|
412
|
+
/>
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
## Props
|
|
416
|
+
|
|
417
|
+
| Prop | Type | Required | Default | Description |
|
|
418
|
+
| --- | --- | --- | --- | --- |
|
|
419
|
+
| `activeStepId` | `string \| null` | Yes | `-` | The id of the current/active step. Set this to null to visualize a completely unfilled/incomplete Stepper. |
|
|
420
|
+
| `direction` | `horizontal \| vertical` | Yes | `-` | The orientation of the stepper. |
|
|
421
|
+
| `steps` | `StepperValue<Metadata>[]` | Yes | `-` | An array of steps to render. |
|
|
422
|
+
| `StepperHeaderComponent` | `StepperHeaderComponent<Metadata> \| null` | No | `-` | An optional component to render in place of the default Header subcomponent. Set to null to render nothing in this slot. |
|
|
423
|
+
| `StepperIconComponent` | `StepperIconComponent<Metadata> \| null` | No | `-` | An optional component to render in place of the default Icon subcomponent. Set to null to render nothing in this slot. |
|
|
424
|
+
| `StepperLabelComponent` | `StepperLabelComponent<Metadata> \| null` | No | `-` | An optional component to render in place of the default Label subcomponent. Set to null to render nothing in this slot. |
|
|
425
|
+
| `StepperProgressComponent` | `StepperProgressComponent<Metadata> \| null` | No | `-` | An optional component to render in place of the default Progress subcomponent. Set to null to render nothing in this slot. |
|
|
426
|
+
| `StepperStepComponent` | `StepperStepComponent<Metadata>` | No | `-` | An optional component to render in place of the default Step subcomponent. |
|
|
427
|
+
| `StepperSubstepContainerComponent` | `StepperSubstepContainerComponent<Metadata> \| null` | No | `-` | An optional component to render in place of the default SubstepContainer subcomponent. |
|
|
428
|
+
| `alignContent` | `flex-start \| flex-end \| center \| stretch \| space-between \| space-around \| space-evenly` | No | `-` | - |
|
|
429
|
+
| `alignItems` | `flex-start \| flex-end \| center \| stretch \| baseline` | No | `-` | - |
|
|
430
|
+
| `alignSelf` | `auto \| FlexAlignType` | No | `-` | - |
|
|
431
|
+
| `animate` | `boolean` | No | `true` | Whether to animate the progress spring. |
|
|
432
|
+
| `animated` | `boolean` | No | `-` | - |
|
|
433
|
+
| `aspectRatio` | `string \| number` | No | `-` | - |
|
|
434
|
+
| `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 | `-` | - |
|
|
435
|
+
| `borderBottomLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
436
|
+
| `borderBottomRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
437
|
+
| `borderBottomWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
438
|
+
| `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 | `-` | - |
|
|
439
|
+
| `borderEndWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
440
|
+
| `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
441
|
+
| `borderStartWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
442
|
+
| `borderTopLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
443
|
+
| `borderTopRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
444
|
+
| `borderTopWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
445
|
+
| `borderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
446
|
+
| `bordered` | `boolean` | No | `-` | Add a border around all sides of the box. |
|
|
447
|
+
| `borderedBottom` | `boolean` | No | `-` | Add a border to the bottom side of the box. |
|
|
448
|
+
| `borderedEnd` | `boolean` | No | `-` | Add a border to the trailing side of the box. |
|
|
449
|
+
| `borderedHorizontal` | `boolean` | No | `-` | Add a border to the leading and trailing sides of the box. |
|
|
450
|
+
| `borderedStart` | `boolean` | No | `-` | Add a border to the leading side of the box. |
|
|
451
|
+
| `borderedTop` | `boolean` | No | `-` | Add a border to the top side of the box. |
|
|
452
|
+
| `borderedVertical` | `boolean` | No | `-` | Add a border to the top and bottom sides of the box. |
|
|
453
|
+
| `bottom` | `string \| number` | No | `-` | - |
|
|
454
|
+
| `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 | `-` | - |
|
|
455
|
+
| `columnGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
456
|
+
| `complete` | `boolean` | No | `-` | Set this to true to visualize a completely filled/complete Stepper |
|
|
457
|
+
| `completedStepAccessibilityLabel` | `string` | No | `"Complete"` | An optional accessibility label used to announce a step as complete/visited. Useful for providing an internationalized label for this state. |
|
|
458
|
+
| `dangerouslySetBackground` | `string` | No | `-` | - |
|
|
459
|
+
| `disableAnimateOnMount` | `boolean` | No | `-` | Whether to disable the animation on mount. |
|
|
460
|
+
| `display` | `flex \| none` | No | `-` | - |
|
|
461
|
+
| `elevation` | `0 \| 1 \| 2` | No | `-` | Determines box shadow styles. Parent should have overflow set to visible to ensure styles are not clipped. |
|
|
462
|
+
| `flexBasis` | `string \| number` | No | `-` | - |
|
|
463
|
+
| `flexDirection` | `row \| column \| row-reverse \| column-reverse` | No | `-` | - |
|
|
464
|
+
| `flexGrow` | `number` | No | `-` | - |
|
|
465
|
+
| `flexShrink` | `number` | No | `-` | - |
|
|
466
|
+
| `flexWrap` | `wrap \| nowrap \| wrap-reverse` | No | `-` | - |
|
|
467
|
+
| `font` | `inherit \| FontFamily` | No | `-` | - |
|
|
468
|
+
| `fontFamily` | `inherit \| FontFamily` | No | `-` | - |
|
|
469
|
+
| `fontSize` | `inherit \| FontSize` | No | `-` | - |
|
|
470
|
+
| `fontWeight` | `inherit \| FontWeight` | No | `-` | - |
|
|
471
|
+
| `gap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
472
|
+
| `height` | `string \| number` | No | `-` | - |
|
|
473
|
+
| `justifyContent` | `flex-start \| flex-end \| center \| space-between \| space-around \| space-evenly` | No | `-` | - |
|
|
474
|
+
| `left` | `string \| number` | No | `-` | - |
|
|
475
|
+
| `lineHeight` | `inherit \| LineHeight` | No | `-` | - |
|
|
476
|
+
| `margin` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
477
|
+
| `marginBottom` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
478
|
+
| `marginEnd` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
479
|
+
| `marginStart` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
480
|
+
| `marginTop` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
481
|
+
| `marginX` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
482
|
+
| `marginY` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
|
|
483
|
+
| `maxHeight` | `string \| number` | No | `-` | - |
|
|
484
|
+
| `maxWidth` | `string \| number` | No | `-` | - |
|
|
485
|
+
| `minHeight` | `string \| number` | No | `-` | - |
|
|
486
|
+
| `minWidth` | `string \| number` | No | `-` | - |
|
|
487
|
+
| `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
488
|
+
| `onPointerCancelCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
489
|
+
| `onPointerDown` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
490
|
+
| `onPointerDownCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
491
|
+
| `onPointerEnter` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
492
|
+
| `onPointerEnterCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
493
|
+
| `onPointerLeave` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
494
|
+
| `onPointerLeaveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
495
|
+
| `onPointerMove` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
496
|
+
| `onPointerMoveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
497
|
+
| `onPointerUp` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
498
|
+
| `onPointerUpCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
499
|
+
| `opacity` | `number \| AnimatedNode` | No | `-` | - |
|
|
500
|
+
| `overflow` | `visible \| hidden \| scroll` | No | `-` | - |
|
|
501
|
+
| `padding` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
502
|
+
| `paddingBottom` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
503
|
+
| `paddingEnd` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
504
|
+
| `paddingStart` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
505
|
+
| `paddingTop` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
506
|
+
| `paddingX` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
507
|
+
| `paddingY` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
508
|
+
| `pin` | `top \| bottom \| left \| right \| all` | No | `-` | Direction in which to absolutely pin the box. |
|
|
509
|
+
| `position` | `absolute \| relative \| static \| fixed \| sticky` | No | `-` | - |
|
|
510
|
+
| `progressSpringConfig` | `Partial<AnimationConfig>` | No | `-` | The spring config to use for the progress spring. |
|
|
511
|
+
| `ref` | `null \| (instance: View \| null) => void \| RefObject<View>` | No | `-` | - |
|
|
512
|
+
| `right` | `string \| number` | No | `-` | - |
|
|
513
|
+
| `rowGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
|
|
514
|
+
| `style` | `false \| RegisteredStyle<ViewStyle> \| Value \| AnimatedInterpolation<string \| number> \| WithAnimatedObject<ViewStyle> \| WithAnimatedArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>> \| readonly (Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>)[]> \| null` | No | `-` | - |
|
|
515
|
+
| `styles` | `{ root?: StyleProp<ViewStyle>; step?: StyleProp<ViewStyle>; substepContainer?: StyleProp<ViewStyle>; label?: StyleProp<ViewStyle>; progress?: StyleProp<ViewStyle>; icon?: StyleProp<ViewStyle>; header?: StyleProp<ViewStyle>; }` | No | `-` | Inline styles for specific child elements of Stepper |
|
|
516
|
+
| `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. |
|
|
517
|
+
| `textAlign` | `left \| right \| auto \| center \| justify` | No | `-` | - |
|
|
518
|
+
| `textDecorationLine` | `none \| underline \| line-through \| underline line-through` | No | `-` | - |
|
|
519
|
+
| `textDecorationStyle` | `solid \| dotted \| dashed \| double` | No | `-` | - |
|
|
520
|
+
| `textTransform` | `none \| capitalize \| uppercase \| lowercase` | No | `-` | - |
|
|
521
|
+
| `top` | `string \| number` | No | `-` | - |
|
|
522
|
+
| `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 | `-` | - |
|
|
523
|
+
| `userSelect` | `none \| auto \| contain \| text \| all` | No | `-` | - |
|
|
524
|
+
| `width` | `string \| number` | No | `-` | - |
|
|
525
|
+
| `zIndex` | `number` | No | `-` | - |
|
|
526
|
+
|
|
527
|
+
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# SubBrandLogoMark
|
|
2
|
+
|
|
3
|
+
Coinbase sub-brand logo marks for specialized branding.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { SubBrandLogoMark } from '@coinbase/cds-mobile/icons/SubBrandLogoMark'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<VStack alignItems="center">
|
|
17
|
+
<Box height="40px">
|
|
18
|
+
<SubBrandLogoMark type="wallet" />
|
|
19
|
+
</Box>
|
|
20
|
+
</VStack>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Different Sub-Brand Types
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
<VStack gap={4}>
|
|
27
|
+
<VStack gap={2}>
|
|
28
|
+
<Text font="label2" color="fgMuted">
|
|
29
|
+
Wallet
|
|
30
|
+
</Text>
|
|
31
|
+
<Box height="40px">
|
|
32
|
+
<SubBrandLogoMark type="wallet" />
|
|
33
|
+
</Box>
|
|
34
|
+
</VStack>
|
|
35
|
+
<VStack gap={2}>
|
|
36
|
+
<Text font="label2" color="fgMuted">
|
|
37
|
+
Business
|
|
38
|
+
</Text>
|
|
39
|
+
<Box height="40px">
|
|
40
|
+
<SubBrandLogoMark type="business" />
|
|
41
|
+
</Box>
|
|
42
|
+
</VStack>
|
|
43
|
+
<VStack gap={2}>
|
|
44
|
+
<Text font="label2" color="fgMuted">
|
|
45
|
+
Commerce
|
|
46
|
+
</Text>
|
|
47
|
+
<Box height="40px">
|
|
48
|
+
<SubBrandLogoMark type="commerce" />
|
|
49
|
+
</Box>
|
|
50
|
+
</VStack>
|
|
51
|
+
</VStack>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Foreground Variations
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
<VStack gap={4}>
|
|
58
|
+
<VStack gap={2}>
|
|
59
|
+
<Text font="label2" color="fgMuted">
|
|
60
|
+
Default (brand blue in light mode, white in dark mode)
|
|
61
|
+
</Text>
|
|
62
|
+
<Box height="40px">
|
|
63
|
+
<SubBrandLogoMark type="wallet" />
|
|
64
|
+
</Box>
|
|
65
|
+
</VStack>
|
|
66
|
+
<VStack gap={2}>
|
|
67
|
+
<Text font="label2" color="fgMuted">
|
|
68
|
+
Foreground (high contrast black in light mode, white in dark mode)
|
|
69
|
+
</Text>
|
|
70
|
+
<Box height="40px">
|
|
71
|
+
<SubBrandLogoMark type="wallet" foreground={true} />
|
|
72
|
+
</Box>
|
|
73
|
+
</VStack>
|
|
74
|
+
</VStack>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Sizing
|
|
78
|
+
|
|
79
|
+
SubBrandLogoMark doesn't have a `size` prop. Instead, control its size by setting the width or height of its container. The component will automatically maintain its aspect ratio.
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
<VStack gap={4}>
|
|
83
|
+
<VStack gap={2}>
|
|
84
|
+
<Text font="label2" color="fgMuted">
|
|
85
|
+
Small (24px height)
|
|
86
|
+
</Text>
|
|
87
|
+
<Box height="24px">
|
|
88
|
+
<SubBrandLogoMark type="wallet" />
|
|
89
|
+
</Box>
|
|
90
|
+
</VStack>
|
|
91
|
+
<VStack gap={2}>
|
|
92
|
+
<Text font="label2" color="fgMuted">
|
|
93
|
+
Medium (40px height)
|
|
94
|
+
</Text>
|
|
95
|
+
<Box height="40px">
|
|
96
|
+
<SubBrandLogoMark type="wallet" />
|
|
97
|
+
</Box>
|
|
98
|
+
</VStack>
|
|
99
|
+
<VStack gap={2}>
|
|
100
|
+
<Text font="label2" color="fgMuted">
|
|
101
|
+
Large (60px height)
|
|
102
|
+
</Text>
|
|
103
|
+
<Box height="60px">
|
|
104
|
+
<SubBrandLogoMark type="wallet" />
|
|
105
|
+
</Box>
|
|
106
|
+
</VStack>
|
|
107
|
+
<VStack gap={2}>
|
|
108
|
+
<Text font="label2" color="fgMuted">
|
|
109
|
+
Width-constrained (100px width)
|
|
110
|
+
</Text>
|
|
111
|
+
<Box width="100px">
|
|
112
|
+
<SubBrandLogoMark type="wallet" />
|
|
113
|
+
</Box>
|
|
114
|
+
</VStack>
|
|
115
|
+
</VStack>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Props
|
|
119
|
+
|
|
120
|
+
| Prop | Type | Required | Default | Description |
|
|
121
|
+
| --- | --- | --- | --- | --- |
|
|
122
|
+
| `type` | `base \| keyof SubBrandLogoDataByType` | Yes | `-` | - |
|
|
123
|
+
| `foreground` | `boolean` | No | `-` | - |
|
|
124
|
+
|
|
125
|
+
|