This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Expo Calendar
A library that provides an API for interacting with the device's system calendars, events, reminders, and associated records.
To provide quicker updates,
expo-calendaris currently unsupported in Expo Go and Snack. To use it, create a development build.
expo-calendar provides an API for interacting with the device's system calendars, events, reminders, and associated records.
Additionally, it provides methods to launch the system-provided calendar UI to allow the user to view or edit events. On iOS, they present either EKEventViewController or EKEventEditViewController as a modal.
Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
Configuration in app config
You can configure expo-calendar using its built-in config plugin if you use config plugins in your project (Continuous Native Generation (CNG)). The plugin allows you to configure various properties that cannot be set at runtime and require building a new app binary to take effect. If your app does not use CNG, then you'll need to manually configure the library.
Example app.json with config plugin
Configurable properties
Are you using this library in an existing React Native app?
If you're not using Continuous Native Generation (CNG) (you're using native ios project manually), then you need to configure following permissions in your native project:
-
For iOS, add
NSCalendarsUsageDescription,NSCalendarsFullAccessUsageDescription, andNSRemindersUsageDescriptionto your project's ios/[app]/Info.plist:<key>NSCalendarsUsageDescription</key> <string>Allow $(PRODUCT_NAME) to access your calendar</string> <key>NSCalendarsFullAccessUsageDescription</key> <string>Allow $(PRODUCT_NAME) to access your calendar</string> <key>NSRemindersUsageDescription</key> <string>Allow $(PRODUCT_NAME) to access your reminders</string>When requesting write-only calendar access on iOS 17+, add
NSCalendarsWriteOnlyAccessUsageDescriptioninstead ofNSCalendarsFullAccessUsageDescription:<key>NSCalendarsWriteOnlyAccessUsageDescription</key> <string>Allow $(PRODUCT_NAME) to add events to your calendars</string>
Usage
import * as Calendar from 'expo-calendar'; import { useEffect } from 'react'; import { StyleSheet, View, Text, Button } from 'react-native'; const BasicUsage = () => { useEffect(() => { (async () => { const { status } = await Calendar.requestCalendarPermissions(); if (status === 'granted') { const calendars = Calendar.getCalendars(Calendar.EntityTypes.EVENT); console.log('Here are all your calendars:'); console.log(JSON.stringify(calendars)); } })(); }, []); return ( <View style={styles.container}> <Text>Calendar Module Example</Text> <Button title="Create a new calendar" onPress={createCalendar} /> </View> ); }; async function createCalendar() { const newCalendar = await Calendar.createCalendar({ title: 'Expo Calendar', color: 'blue', entityType: Calendar.EntityTypes.EVENT, }); console.log(`Your new calendar: ${JSON.stringify(newCalendar)}`); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'space-around', }, });
API
import * as Calendar from 'expo-calendar';
Unless specified otherwise, all dates are returned in the ISO 8601 format.
No API data file found, sorry!
Permissions
Android
If you only intend to use the system-provided calendar UI, you don't need to request any permissions.
Otherwise, you must add the following permissions to your app.json inside the expo.android.permissions array.
iOS
If you only intend to create events using system-provided calendar UI with createEventInCalendarAsync, you don't need to request permissions.
The following usage description keys are used by this library: