SwipeUI

Week strip

A wrapping week of local-day choices with button and swipe navigation.

npx @swipeui/cli add week-strip
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When 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.tsx and 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 install so versions match your SDK.

Usage

app/schedule.tsx
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

PropTypeDefaultDescription
value?Date—

Controlled selected local day.

defaultValue?Datetoday

Initial selected day.

onValueChange?((value: Date) => void)—

Reports a selected day; week navigation selects its same weekday.

minDate?Date—

Earliest allowed day.

maxDate?Date—

Latest allowed day.

weekStartsOn?"locale" | 0 | 1 | 2 | 3 | 4 | 5 | 6—

Calendar-compatible first weekday; Monday by default.

markers?((date: Date) => readonly CalendarMarkerTone[] | undefined)—

Marker dots under each date.

showTodayPill?booleantrue

Show Today when its week is off-screen.

isDateDisabled?((date: Date) => boolean)—

Custom blocked-day rule.

messages?Partial<CalendarMessages>—

Localized calendar labels.

firstDayOfWeek?0 | 1 | 2 | 3 | 4 | 5 | 61

1.x first weekday, Sunday=0.

locale?stringdevice locale

Label locale.

disabled?booleanfalse

Prevent changes.

haptics?boolean | SelectionHapticstrue

Press feedback.

motion?MotionOverridethe app feel

Shared press feel.

className?string—

Root classes.

style?StyleProp<ViewStyle>—

Native layout escape hatch.

testID?string—

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

PropDoesDefault
hapticsEnables selection or press feedbacktrue
motionOverrides the app's motion feelApp 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 press motion role, so it follows your app's feel. Pass motion to 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 onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items