Agenda Calendar App π
A customizable modern calendar agenda built with React Native, Expo, and TypeScript. Features a swipeable calendar with expandable header, dark/light mode support, and an intuitive task management interface. It is a base to build your own calendar app. It is easily customizable with your own data and styles.
Download the zip file from the button at the bottom left. You will receive an Expo project. Install the necessary packages and run it using Expo Go. A development build is not required.
π Features
- Swipeable Calendar: Horizontal scrolling calendar with expandable month view
- Dark/Light Mode: Seamless theme switching with cohesive design
- Haptic Feedback: Enhanced user experience with tactile responses
π Project Structure
agenda-calendar-app/
βββ app/ # Expo Router app directory
β βββ (tabs)/ # Tab navigation screens
β β βββ index.tsx # Main calendar screen
β β βββ explore.tsx # Explore screen, no functionality here, just a placeholder.
β βββ modal.tsx # Todo detail modal
β
βββ components/
β βββ calendar/ # π― Calendar components (main focus)
β βββ CalendarAgenda.tsx # Main calendar component
β βββ CalendarHeader.tsx # Custom header with date display
β βββ AgendaItem.tsx # Individual todo item component
β βββ EmptyDay.tsx # Empty state for days with no todos
β βββ helpers.ts # Date formatting utilities
β βββ theme.ts # π¨ Theme configuration (colors, styles)
β βββ types.ts # TypeScript type definitions
β βββ mock-data.ts # Sample todo data
β βββ index.ts # Component exports
β
βββ constants/
β βββ theme.ts # General app theme constants
β
βββ context/
β βββ ThemeContext.tsx # Theme context provider
β
βββ hooks/
βββ use-color-scheme.ts # Color scheme detection
βββ use-theme-color.ts # Theme color hook
π¨ Customizing the Calendar UI
Where to Update Calendar Styling
1. Theme Colors & Styles β components/calendar/theme.ts
This is the main file for customizing calendar appearance:
// Light mode theme
export const lightCalendarTheme = {
backgroundColor: "#F5F1EC",
selectedDayBackgroundColor: "#1A1A1A",
selectedDayTextColor: "#FFFFFF",
todayTextColor: "#1A1A1A",
dayTextColor: "#1A1A1A",
textDayHeaderFontSize: 14,
borderRadius: 8, // Selected day border radius
// ... more properties
};
// Dark mode theme
export const darkCalendarTheme = {
backgroundColor: "#0A0A0A",
selectedDayBackgroundColor: "#FFFFFF",
selectedDayTextColor: "#0A0A0A",
// ... more properties
};Key properties you can customize:
selectedDayBackgroundColor: Background color of selected dayselectedDayTextColor: Text color on selected daytodayTextColor: Color for today's datedayTextColor: Default day text colortextDayHeaderFontSize: Size of day headers (M, T, W, etc.)borderRadius: Shape of selected day indicator (8 = rounded rectangle)textDayFontSize: Size of date numbers
2. Calendar Component Styling β components/calendar/CalendarAgenda.tsx
The main calendar component where you can:
- Adjust the
stylesheet.day.basicconfiguration for custom day styling - Modify the
calendarThemeobject for advanced styling - Change the
LocaleConfigfor day name formatting
Example: Changing selected day shape:
"stylesheet.day.basic": {
base: {
width: 32,
height: 32,
borderRadius: 8, // Change this value (8 = rounded rectangle, 16 = circle)
},
// ...
}3. Agenda Item Styling β components/calendar/AgendaItem.tsx
Customize how individual todo items appear in the agenda list.
4. Header Styling β components/calendar/CalendarHeader.tsx
Modify the calendar header that shows "Today, 19 March" format.
Day Header Format
To change day headers (currently single letters: M, T, W), edit:
components/calendar/helpers.ts - formatDayHeader() function:
export function formatDayHeader(date: Date): { day: string; dayNum: string } {
const days = ["S", "M", "T", "W", "T", "F", "S"]; // Change these
// ...
}components/calendar/CalendarAgenda.tsx - LocaleConfig:
LocaleConfig.locales["en"] = {
dayNamesShort: ["S", "M", "T", "W", "T", "F", "S"], // Change these
// ...
};π§ Customizing Functionality
Adding/Modifying Todos
Mock Data Location: components/calendar/mock-data.ts
This file contains sample todos. To add your own data source:
- Replace the
mockTodosarray with your data - Update the
getTodosForDate()function to fetch from your API/database - Modify the
Todointerface incomponents/calendar/types.tsif needed
Calendar Behavior
Main Component: components/calendar/CalendarAgenda.tsx
Key functions you can modify:
buildStaticTimeline(): Number of days to show (default: 60)handleDayPress(): Behavior when a day is tappedhandleTodoToggle(): Behavior when a todo is toggledscrollToDate(): How scrolling to a date works
Date Formatting
Utilities: components/calendar/helpers.ts
Contains helper functions:
getDateString(): Converts Date to YYYY-MM-DD formatformatDayHeader(): Formats day name and numberbuildStaticTimeline(): Creates the day timeline
π± Usage
Basic Setup
-
Install dependencies:
bashnpm install -
Start the development server:
bashnpx expo start -
Run on your platform:
bash# iOS npm run ios # Android npm run android # Web npm run web
Using the Calendar Component
import { CalendarAgenda } from "@/components/calendar";
import { useTheme } from "@/context/ThemeContext";
function MyScreen() {
const { isDarkMode, toggleTheme } = useTheme();
return (
<CalendarAgenda
isDarkMode={isDarkMode}
onToggleTheme={toggleTheme}
onTodoPress={(todo) => console.log("Todo pressed:", todo)}
onTodoToggle={(todo) => console.log("Todo toggled:", todo)}
onDateChange={(date) => console.log("Date changed:", date)}
/>
);
}ποΈ Key Files Reference
| File | Purpose |
|---|---|
components/calendar/CalendarAgenda.tsx | Main calendar component with swipeable days |
components/calendar/theme.ts | π¨ All theme colors and styling |
components/calendar/helpers.ts | Date formatting and utility functions |
components/calendar/types.ts | TypeScript interfaces for todos and calendar data |
components/calendar/mock-data.ts | Sample data for development |
app/(tabs)/index.tsx | Main screen that uses CalendarAgenda |
context/ThemeContext.tsx | Theme state management |
π― Quick Customization Guide
Change Selected Day Color
β Edit components/calendar/theme.ts β selectedDayBackgroundColor
Change Day Header Size
β Edit components/calendar/theme.ts β textDayHeaderFontSize
Change Selected Day Shape
β Edit components/calendar/CalendarAgenda.tsx β stylesheet.day.basic.base.borderRadius
Change Day Header Letters
β Edit components/calendar/helpers.ts β formatDayHeader() function
β Edit components/calendar/CalendarAgenda.tsx β LocaleConfig.locales["en"].dayNamesShort
Add Custom Styling to Days
β Edit components/calendar/CalendarAgenda.tsx β calendarTheme object
π οΈ Dependencies
- react-native-calendars: Calendar component library
- expo-haptics: Haptic feedback
- expo-router: File-based routing
- react-native-reanimated: Animations
- @expo/vector-icons: Icon library
π Type Definitions
All calendar-related types are defined in components/calendar/types.ts:
Todo: Todo item structureWeekDay: Day in the timelineMarkedDate: Calendar marking configurationDayData: Day with associated todos
π¨ Theme System
The app uses a dual theme system:
- Calendar Theme (
components/calendar/theme.ts): Specific to calendar component - App Theme (
constants/theme.ts): General app colors
Both support light and dark modes and are synchronized for a cohesive experience.
Issue Reporting
If you find any issues with the code, please report them to us at reactnativecomponents.com
π License
This is built under reactnativecomponents.com, please do not sell this code or share with people who did not get the pro. If we find out you are selling this code, we will take legal action and your name will be shared publicly. Show respect for the work I put into.
Happy coding! π