SwipeUI

Calendar

A month in an elevated card: a chosen-day circle that pulls across to the next pick, months that slide under the finger, today's dot, ranges with week bars, and hold-and-drag picking that turns months at the edges.

npx @swipeui/cli add calendar
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

  • Showing a month on a screen and letting people pick a day, such as a booking, delivery or planner date.
  • Picking a range inline (`mode="range"`), with blocked days, minimum and maximum dates.
  • Planners that mark days with up to three coloured dots.
  • A month that folds into the chosen week to save room (`collapsible`).

When not to use it

  • A date field in a form. Use Date picker.
  • A range with presets and Apply in a sheet. Use Date range picker.
  • Choosing a day this week. Use Week strip.

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 calendar
  • Adds components/swipeui/ui/calendar.tsx, components/swipeui/ui/calendar-format.ts, components/swipeui/ui/use-calendar-month.ts, components/swipeui/ui/use-calendar.ts and 14 shared helpers.
  • Installs react-native-gesture-handler, react-native-reanimated, 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 { Calendar } from '@/components/swipeui/ui/calendar';

<Calendar value={date} onValueChange={setDate} />;

The chosen day is written out under the card ("Thursday, November 12, 2026"). Pass caption={false} to leave it out.

Examples

A range with blocked nights. Tap the first and last days, or hold a day and drag; rest against a side edge to carry the range into the next month. A range never runs across a blocked day:

<Calendar
  mode="range"
  range={stay}
  onRangeChange={setStay}
  minDate={new Date()}
  isDateDisabled={isBooked}
/>

A planner with up to three dots per day, folding into the chosen week:

<Calendar
  collapsible
  markers={(date) => (hasMeeting(date) ? ['primary'] : undefined)}
  onValueChange={setDay}
/>

API reference

CalendarProps

PropTypeDefaultDescription
mode?"range" | "single"'single'

single picks one day; range picks a first and last day.

value?Date | null—

The chosen day (controlled, single mode).

defaultValue?Date | nullnull

The day it starts with (uncontrolled, single mode).

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

Reports a chosen day.

range?DateRange—

The chosen range (controlled, range mode). In single mode, a range shown but not edited (1.x).

defaultRange?DateRange{}

The range it starts with (uncontrolled, range mode).

onRangeChange?((range: DateRange) => void)—

Reports a range: the first day alone after one tap, then both.

month?Date—

The visible month (controlled).

defaultMonth?Datethe chosen day, else today

The month it opens on.

onMonthChange?((month: Date) => void)—

Reports the visible month once a page settles.

minDate?Date—

The earliest day that can be chosen.

maxDate?Date—

The latest day that can be chosen.

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

Your own rule for days that can't be chosen.

maxLength?numberunlimited

Range mode: the longest range in days, counting both ends. A drag or a second tap stops there, with a limit haptic.

weekStartsOn?"locale" | WeekStart1

First day of the week, Sunday = 0, or locale to follow the locale's week where the engine reports it (browsers do; Hermes doesn't, so it falls back to Monday). Monday by default, so the app and the web match.

firstDayOfWeek?WeekStart—

1.x name for weekStartsOn.

locale?stringthe device's

Locale for month and weekday names.

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

Dots under days, up to three: return their tones for a day.

todayIndicator?"dot" | "none"'dot'

Today's marker: a small neutral dot under its number, or none.

showToday?booleantrue

A Today button in the header while another month is showing.

outsideDays?"dim" | "hidden" | "normal"'dim'

Days from the neighbouring months: dimmed (still pressable, without turning the month), hidden, or like the rest.

selectedShape?"circle" | "preset"'circle'

The selected day's shape: a circle, or the preset's control corners.

surface?"card" | "plain"'card'

An elevated card around the month, or no surface (inside a sheet or popover).

caption?booleantrue

The chosen day (or range) written out under the card.

swipeMonths?booleantrue

Swipe sideways to turn months; the month follows the finger.

paintSelect?booleantrue

★ Hold a day and drag: the highlight follows the finger, and lifting picks (a range from the held day in range mode).

holdDelay?number350

How long a finger rests on a day before dragging starts, in milliseconds (content timing).

edgePaging?booleantrue

★ While holding, resting against the card's side edges turns the month.

edgePageDelay?number1000

The first turn comes as the finger reaches an edge; this is how long between further turns while it rests there, in milliseconds (content timing).

collapsible?booleanfalse

★ Swipe the card up to fold the month into the chosen week, and down to open it; a header button does the same.

defaultCollapsed?booleanfalse

Start folded to one week (uncontrolled).

disabled?booleanfalse

No turning, choosing or dragging.

haptics?boolean | SelectionHapticstrue

Haptics: a switch, or per part (select for picks, detent for each day dragged over and each month turned, limit at the first or last month).

motion?MotionOverridethe app's feel

Highlight, page and caption motion.

messages?Partial<CalendarMessages>CALENDAR_MESSAGES

Built-in strings and English name fallbacks.

className?string—

Classes on the card.

style?StyleProp<ViewStyle>—

Card style.

testID?string—

Root identifier; days append -<year>-<month>-<day>, plus -caption, -title, -highlight.

Composition and behavior

  • The month sits in an elevated card (surface="plain" inside a sheet). Every month has six rows, so the card never changes height.
  • The chosen day is a circle. Picking another day stretches it into a capsule that pulls away from the old day and lands on the new one: the leading edge on the toggle spring, the trailing edge on the slower overlay spring. Reduce Motion moves it at once.
  • Days from the neighbouring months are dimmed and can be chosen without turning the month. Today has a small neutral dot under its number.
  • Swipe sideways to turn months: the month follows your finger, the title slides with it, and a release turns the page. The ends stretch and answer with a warning tick. Vertical swipes still scroll the screen.
  • ★ Hold a day and drag: a tinted highlight follows your finger, a tick for each day. Lifting picks the day, or sets the range from the day you held. Resting against a side edge turns the month at once, then every edgePageDelay, without lifting.
  • ★ collapsible folds the month into the chosen week with a swipe up (a swipe down opens it) or the header chevron. In the web preview, use the chevron.
  • On the web: arrows move a day or a week, PageUp and PageDown a month, Home and End to the week's edges, and Enter chooses.
  • Names come from Intl, with English fallbacks in messages for Hermes builds without locale data. The week starts on Monday on every platform, so the app and the web match; weekStartsOn="locale" follows the locale where the engine reports it (browsers do, Hermes doesn't).

Calendar settings

PropDoesDefault
modesingle or rangesingle
surfacecard (elevated) or plaincard
captionThe chosen day or range written out under the cardtrue
selectedShapecircle or preset cornerscircle
outsideDaysdim, hidden or normaldim
todayIndicatordot or nonedot
showTodayA Today button while another month showstrue
markersUp to three dot tones per daynone
swipeMonthsSwipe to turn monthstrue
paintSelect / holdDelay★ Hold a day and drag to pick (ms to hold)true, 350
edgePaging / edgePageDelay★ Turn months at the side edges while holding (ms between turns)true, 1000
collapsible / defaultCollapsed★ Fold the month into the chosen weekfalse
weekStartsOnFirst day of the week (Sunday = 0), or locale1 (Monday)
minDate / maxDate / isDateDisabledDays that can't be chosennone
maxLengthLongest range in days (range mode); drags and taps stop thereunlimited
hapticsAll, or { select, detent, limit }on
messagesBuilt-in strings and English name fallbacksEnglish
motionA local motion feel or overridethe app's feel

Behavior and gestures

  • Tap a day to choose it: the circle stretches away from the old day and lands on the new one. Days from the neighbouring months are dimmed and can be chosen without turning the month.
  • Swipe sideways to turn months: the month follows the finger and the title slides with it; the previous and next buttons do the same. Turning stops at your minimum and maximum dates with a warning tick.
  • Range mode: tap the first day, then the last; or hold a day and drag. A tinted highlight follows the finger, resting against a side edge turns the month without lifting (then every second), a range stops before a day that can't be chosen, and lifting sets the range.
  • Single mode: hold a day and slide; lifting chooses the day under the finger.
  • The chosen day ("Sunday, November 8, 2026") or range ("From Nov 9 to Nov 14, 2026, 6 days") is written out under the card.
  • With `collapsible`, swipe up to fold the month into the chosen week and down to open it, or use the header chevron.
  • On the web: arrows move a day or a week, PageUp and PageDown a month, Home and End to the week's edges, and Enter chooses.

Accessibility

  • Each day reads its full date, plus "today", "outside this month" or "unavailable", and reports selected; range days say Range start, Range end or In selected range.
  • Month changes and finished ranges are announced; the caption is a polite live region.
  • Previous month, Next month, Today and Show week are named buttons, so swiping, dragging and folding are all optional.
  • At large accessibility text sizes the month becomes a list of full-width day rows.

Motion

  • Uses the select, toggle, overlay, morph, layout and press motion roles, so it follows your app's feel. Pass motion to tune this one instance.
  • The chosen-day circle's leading edge springs on the toggle role and its trailing edge on the slower overlay role, so it stretches into a capsule and lands.
  • Months and the title turn on the select spring and follow the finger while dragging; the ends stretch.
  • Folding to a week springs on the layout role; the caption rises in on morph.
  • Reduce Motion: the circle and months move at once, the caption fades, and haptics stay.

Performance

  • Only the visible month and its two neighbours render. Drags report one day at a time from the UI thread.
  • All maths uses local calendar fields, so daylight-saving days never shift a date; today refreshes at midnight and when the app returns.

Notes for AI

  • Single mode uses value/onValueChange; range mode uses range/onRangeChange. In single mode a `range` prop is drawn but not edited (1.x).
  • The week starts on Monday on every platform; pass weekStartsOn (Sunday = 0) or `locale` to follow the locale's week where the engine reports it. `firstDayOfWeek` still works.
  • Pass `surface="plain" caption={false}` inside a sheet or popover.

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