Week strip
A wrapping week of local-day choices with button and swipe navigation.
npx @swipeui/cli add week-stripWhen to use it
- Habit, fitness or diary apps that focus on this week.
- Picking a day for a schedule or class timetable.
- Compact date navigation above a list of events.
When not to use it
- Picking dates far in the future. Use Calendar or Date picker.
- Showing completion. Use Streak card.
Installation
Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.
npx @swipeui/cli add week-strip- Adds
components/swipeui/ui/use-week-strip.ts,components/swipeui/ui/use-week-gesture.ts,components/swipeui/ui/week-strip.tsxand 15 shared helpers. - Installs react-native-reanimated, react-native-gesture-handler, react-native-worklets, uniwind, clsx, tailwind-merge, expo-haptics, class-variance-authority, react-native-svg. In Expo apps it uses
npx expo installso versions match your SDK.
Usage
import { WeekStrip } from '@/components/swipeui/ui/week-strip';
<WeekStrip value={day} onValueChange={setDay} />;Examples
Use the variant and appearance controls in the live specimen to compare the documented states. The application owns validation, operation results and persistence.
API reference
WeekStripProps
| Prop | Type | Default | Description |
|---|---|---|---|
value? | | — | Controlled selected local day. |
defaultValue? | | | Initial selected day. |
onValueChange? | | — | Reports a selected day; week navigation selects its same weekday. |
minDate? | | — | Earliest allowed day. |
maxDate? | | — | Latest allowed day. |
weekStartsOn? | | — | Calendar-compatible first weekday; Monday by default. |
markers? | | — | Marker dots under each date. |
showTodayPill? | | | Show Today when its week is off-screen. |
isDateDisabled? | | — | Custom blocked-day rule. |
messages? | | — | Localized calendar labels. |
firstDayOfWeek? | | | 1.x first weekday, Sunday=0. |
locale? | | | Label locale. |
disabled? | | | Prevent changes. |
haptics? | | | Press feedback. |
motion? | | | Shared press feel. |
className? | | — | Root classes. |
style? | | — | Native layout escape hatch. |
testID? | | — | Root ID; dates append their local key. |
Native view/input props not listed here pass through where the exported TypeScript type allows them.
Week strip settings
| Prop | Does | Default |
|---|---|---|
| haptics | Enables selection or press feedback | true |
| motion | Overrides the app's motion feel | App feel |
| weekStartsOn | First weekday, or locale with Monday fallback | 1 |
| markers | Up to three colored dots per day | — |
| showTodayPill | Return to today when off-screen | true |
| minDate / maxDate | Local-day limits | — |
| isDateDisabled | Custom blocked days | — |
| messages | Calendar labels and Intl fallbacks | English |
Composition and behavior
- Previous and next buttons around seven day buttons.
- value and onValueChange hold the selected day; firstDayOfWeek sets the start.
Behavior and gestures
- Tap a day to select it.
- Swipe sideways, or tap the arrow buttons, to move a week; the same weekday stays selected.
- Days outside your minimum and maximum dates can't be selected.
- Days wrap onto two lines on small screens instead of shrinking.
Accessibility
- Each day is a button that reads its full date and selected state.
- Previous week and Next week are named buttons.
- Labels follow the locale; the week start can be set.
Motion
- Uses the
pressmotion role, so it follows your app's feel. Passmotionto tune this one instance. - Buttons use the shared press scale; Reduce Motion removes it.
Performance
- Only seven days render at a time.
Notes for AI
- Pass local days; set minDate and maxDate to bound navigation.
Compatibility
| Runs on | Supported |
|---|---|
| Expo SDK 57 | Yes |
| Expo SDK 58 | Yes |
| React Native CLI (with Expo modules) | Yes |
| Expo Go | Yes |
| iOS | Yes |
| Android | Yes |
This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.