{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "stepper", "type": "registry:ui", "title": "Stepper", "description": "Horizontal step progress indicator with check states.", "registryDependencies": [ "https://raw.githubusercontent.com/truongnat/rnui/main/registry/dist/nativewind/utils.json", "https://raw.githubusercontent.com/truongnat/rnui/main/registry/dist/nativewind/text.json", "https://raw.githubusercontent.com/truongnat/rnui/main/registry/dist/nativewind/theme.json" ], "dependencies": [ "lucide-react-native" ], "files": [ { "path": "registry/shared/ui/stepper.tsx", "type": "registry:ui", "target": "components/ui/stepper.tsx", "content": "import { Pressable, StyleSheet, View, type ViewProps } from 'react-native';\nimport { Check } from 'lucide-react-native';\nimport { Text } from '@/components/ui/text';\nimport { cn, useIconColor, useThemeColor } from '@/lib/utils';\n\nexport interface StepperProps extends ViewProps {\n steps: string[];\n /** Index of the current step (0-based). Steps before it are done. */\n current: number;\n /** Optional callback when user taps a step indicator. */\n onStepPress?: (index: number) => void;\n className?: string;\n}\n\nexport function Stepper({\n steps,\n current,\n onStepPress,\n className,\n ...props\n}: StepperProps) {\n const checkColor = useIconColor('onPrimary');\n const theme = useThemeColor();\n\n return (\n \n {steps.map((label, i) => {\n const isCompleted = i < current;\n const isActive = i === current;\n const isLast = i === steps.length - 1;\n const canPress = onStepPress && (isCompleted || isActive);\n\n const circle = (\n \n {isCompleted ? (\n \n ) : (\n \n {i + 1}\n \n )}\n \n );\n\n return (\n \n \n {canPress ? (\n onStepPress(i)}\n hitSlop={6}\n accessibilityRole=\"button\"\n accessibilityLabel={`Step ${i + 1}: ${label}`}\n >\n {circle}\n \n ) : (\n circle\n )}\n\n {!isLast && (\n \n )}\n \n\n \n {label}\n \n \n );\n })}\n \n );\n}\n\nconst styles = StyleSheet.create({\n connectorLine: {\n height: 2,\n flex: 1,\n marginHorizontal: 4,\n borderRadius: 1,\n },\n stepLabel: {\n fontSize: 11,\n marginTop: 6,\n textAlign: 'center',\n paddingHorizontal: 2,\n },\n});\n" } ] }