Documentation Index
Fetch the complete documentation index at: https://mintlify.com/awasserz/rippler-app/llms.txt
Use this file to discover all available pages before exploring further.
SetRow Component
TheSetRow component is a specialized input row used for logging individual sets during workout tracking. It displays set numbers, target values, provides inputs for weight and reps, and includes an animated completion button with haptic feedback.
Import
Basic Usage
Props
The set number to display (e.g., 1, 2, 3)
Target weight for this set. Can be a number (e.g., 185) or “BW” for bodyweight exercises
Target reps for this set. Can be a number (e.g., 5) or “Max” for AMRAP sets
The logged data for this set:
setNumber: number- Set numberweight: number | string- Logged weight valuereps: number | string- Logged reps valuecompleted: boolean- Whether the set is marked complete
Callback invoked when the completion button is pressed
Callback invoked when the weight input changes
Callback invoked when the reps input changes
LoggedSet Type
Visual Breakdown
The SetRow has four main sections in a horizontal layout:1. Set Number Label
- Fixed width (50px)
- Displays “Set ”
- Secondary text color
2. Weight Input Group
- Target weight label above input
- TextInput with numeric keyboard
- Placeholder shows target value
- Flex: 1 (equal width)
3. Reps Input Group
- Target reps label above input
- TextInput with numeric keyboard
- Placeholder shows target value or “Max”
- Flex: 1 (equal width)
4. Completion Button
- Fixed size (40x40)
- Animated press effect
- Circle icon when incomplete
- Check icon when complete
Real-World Example
FromWorkoutScreen.tsx:407-420:
State Management Pattern
The SetRow is a controlled component. Here’s the recommended pattern:Completion States
The SetRow has two visual states based onloggedSet.completed:
- Incomplete
- Complete
Background:
theme.backgroundSecondaryButton:- Background:
theme.backgroundDefault - Border:
theme.border - Icon: Circle outline (
circleicon) - Icon color:
theme.textSecondary
Animation Behavior
Completion Button Animation
When the completion button is pressed:- Haptic Feedback: Medium impact on iOS/Android
- Scale Down: Animates to 0.95 with spring
- Scale Up: Springs back to 1.0
- Callback: Invokes
onToggleComplete
Input Handling
Weight Input
- Value: Controlled by
loggedSet.weight - Placeholder: Shows target value
- Keyboard: Numeric for easy number entry
- Test ID: For automated testing
Reps Input
- Value: Controlled by
loggedSet.reps - Placeholder: Shows “Max” for AMRAP or target number
- Keyboard: Numeric input
- Test ID: For automated testing
Styling
Default Styles
Theme Colors
- Container Background (incomplete):
theme.backgroundSecondary - Container Background (complete):
${theme.success}15(15% opacity) - Input Background:
theme.backgroundDefault - Input Border:
theme.border - Input Text:
theme.text - Labels:
theme.textSecondary - Placeholder:
theme.textSecondary
Test IDs
The SetRow includes test IDs for automated testing:set-1-weight-inputset-1-reps-inputset-1-complete-button
Best Practices
Persist data on every change
Persist data on every change
Save logged data immediately when inputs change:
Handle special values gracefully
Handle special values gracefully
Support both numbers and special strings:
Provide haptic feedback
Provide haptic feedback
The component includes haptic feedback on completion toggle. Ensure expo-haptics is installed:
Use controlled inputs
Use controlled inputs
Always control inputs through state:
Accessibility
- Touch Targets: Inputs and button meet minimum 40px size
- Keyboard Type: Numeric keyboard for easier number entry
- Visual Feedback: Clear completion state with color and icon
- Haptic Feedback: Tactile confirmation on completion (iOS/Android)
- Test IDs: Support for automated testing and screen readers
Platform Differences
Haptic Feedback
Haptics are disabled on web:Keyboard Behavior
Numeric keyboard appears automatically on mobile when inputs are focused.Dependencies
ThemedText- For labelsuseTheme- For theme integrationreact-native-reanimated- For animationsexpo-haptics- For haptic feedback@expo/vector-icons- For check/circle icons@/types/workout- For TypeScript interfaces
Source Code
Location:client/components/SetRow.tsx:1-181
The SetRow component is designed to be used in lists of sets for exercise logging, providing a consistent and intuitive interface for workout tracking.