Back to Components

Modern Agenda

Calendars
about 1 month ago

About

Agenda Calendar App πŸ“…

A modern agenda calendar application built with React Native and Expo. Features a clean design with dark/light mode support, smooth animations, and an intuitive user interface.

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
  • Day Selector: Horizontal scrolling day selector for quick navigation
  • Month Picker: Easy month and year selection with modal interface
  • Task Management: View and manage todos/events for each day

πŸ“ Project Structure

text
agenda-calendar-app/ β”œβ”€β”€ app/ # Expo Router app directory β”‚ β”œβ”€β”€ _layout.tsx # Root layout with theme provider β”‚ β”œβ”€β”€ index.tsx # Main calendar screen β”‚ └── modal.tsx # Todo detail modal β”‚ β”œβ”€β”€ components/ β”‚ └── calendar/ # 🎯 Calendar components (main focus) β”‚ β”œβ”€β”€ CalendarAgenda.tsx # Main calendar component β”‚ β”œβ”€β”€ CalendarHeader.tsx # Custom header with month picker & theme toggle β”‚ β”œβ”€β”€ DaySelector.tsx # Horizontal day selector β”‚ β”œβ”€β”€ MonthPicker.tsx # Month/year picker modal β”‚ β”œβ”€β”€ AgendaItem.tsx # Individual todo item component β”‚ β”œβ”€β”€ EmptyDay.tsx # Empty state for days with no todos β”‚ β”œβ”€β”€ date-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:

typescript
// Light mode theme export const lightCalendarTheme = { backgroundColor: "#F5F1EC", selectedDayBackgroundColor: "#1A1A1A", selectedDayTextColor: "#FFFFFF", todayTextColor: "#1A1A1A", dayTextColor: "#1A1A1A", textDayHeaderFontSize: 13, textDayFontSize: 17, // ... 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 day
  • selectedDayTextColor: Text color on selected day
  • todayTextColor: Color for today's date
  • dayTextColor: Default day text color
  • textDayHeaderFontSize: Size of day headers (M, T, W, etc.)
  • textDayFontSize: Size of date numbers
  • textDayFontWeight: Weight of date numbers ("500", "600", etc.)

2. Calendar Component Styling β†’ components/calendar/MonthPicker.tsx & components/calendar/DaySelector.tsx

The calendar components use react-native-calendars library. You can customize:

  • Adjust the stylesheet.day.basic configuration for custom day styling
  • Modify the calendarTheme object for advanced styling
  • Change day shape and size

Example: Changing selected day shape in MonthPicker:

typescript
"stylesheet.day.basic": { base: { width: 44, height: 56, borderRadius: 22, }, selected: { backgroundColor: isDarkMode ? "#FFFFFF" : "#1A1A1A", borderRadius: 22, }, // ... }

3. Agenda Item Styling β†’ components/calendar/AgendaItem.tsx

Customize how individual todo items appear in the agenda list. Modify the styles constant at the bottom of the file to change:

  • Card background and border colors
  • Text colors and sizes
  • Priority indicators
  • Category badges
  • Completion toggle styling

4. Header Styling β†’ components/calendar/CalendarHeader.tsx

Modify the calendar header that shows month/year and theme toggle. Customize:

  • Month text styling
  • Today button appearance
  • Theme toggle button
  • Header background and spacing

Day Header Format

To change day headers (currently single letters: M, T, W), edit:

components/calendar/MonthPicker.tsx - LocaleConfig (if using react-native-calendars):

typescript
import { LocaleConfig } from "react-native-calendars"; LocaleConfig.locales["en"] = { dayNamesShort: ["S", "M", "T", "W", "T", "F", "S"], // Change these // ... };

components/calendar/DaySelector.tsx - Similar LocaleConfig setup if needed.

πŸ”§ Customizing Functionality

Adding/Modifying Todos

Mock Data Location: components/calendar/mock-data.ts

This file contains sample todos. To add your own data source:

  1. Replace the mockTodos array with your data
  2. Update the getTodosForDate() function to fetch from your API/database
  3. Modify the Todo interface in components/calendar/types.ts if needed

Example:

typescript
export const mockTodos: Todo[] = [ { id: "1", title: "Meeting with team", date: "2024-01-15", time: "10:00", completed: false, priority: "high", category: "Work", categoryColor: "#2D8A56", }, // ... more todos ];

Calendar Behavior

Main Component: components/calendar/CalendarAgenda.tsx

Key functions you can modify:

  • buildDayTimeline(): Number of days to show in timeline (default: 30)
  • handleDayPress(): Behavior when a day is tapped
  • handleTodoToggle(): Behavior when a todo is toggled
  • scrollToDate(): How scrolling to a date works

Example: Change number of days shown:

typescript
function buildDayTimeline(baseDate: string, totalDays: number = 30) { // Change 30 to your desired number of days // ... }

Date Formatting

Utilities: components/calendar/date-helpers.ts

Contains helper functions:

  • parseDateString(): Parses YYYY-MM-DD format string
  • getMonthYear(): Returns formatted "Month Year" string
  • getDateString(): Converts Date object to YYYY-MM-DD string
  • getTodayString(): Returns today's date as YYYY-MM-DD string
  • isToday(): Checks if date string is today

πŸ“± Usage

Basic Setup

  1. Install dependencies:

    bash
    npm install
  2. Start the development server:

    bash
    npx expo start
  3. Run on your platform:

    bash
    # iOS npm run ios # Android npm run android

πŸ—‚οΈ Key Files Reference

FilePurpose
components/calendar/CalendarAgenda.tsxMain calendar component with day selector and agenda
components/calendar/theme.ts🎨 All theme colors and styling
components/calendar/date-helpers.tsDate formatting and utility functions
components/calendar/types.tsTypeScript interfaces for todos and calendar data
components/calendar/mock-data.tsSample data for development
components/calendar/MonthPicker.tsxMonth/year picker modal with calendar
components/calendar/DaySelector.tsxHorizontal day selector component
app/index.tsxMain screen that uses CalendarAgenda
context/ThemeContext.tsxTheme state management

🎯 Quick Customization Guide

Change Selected Day Color

β†’ Edit components/calendar/theme.ts β†’ selectedDayBackgroundColor in lightCalendarTheme or darkCalendarTheme

Change Day Header Size

β†’ Edit components/calendar/theme.ts β†’ textDayHeaderFontSize

Change Selected Day Shape

β†’ Edit components/calendar/MonthPicker.tsx β†’ stylesheet.day.basic.base.borderRadius (22 = circle, 8 = rounded rectangle, 0 = square)

Change Day Text Size

β†’ Edit components/calendar/theme.ts β†’ textDayFontSize

Change Agenda Item Colors

β†’ Edit components/calendar/theme.ts β†’ agendaColors.light or agendaColors.dark object

Add Custom Styling to Days

β†’ Edit components/calendar/MonthPicker.tsx or components/calendar/DaySelector.tsx β†’ calendarTheme object

Change Number of Days in Timeline

β†’ Edit components/calendar/CalendarAgenda.tsx β†’ buildDayTimeline() function β†’ totalDays parameter (default: 30)

πŸ› οΈ 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 (Ionicons)
  • react-native-safe-area-context: Safe area handling

πŸ“ Type Definitions

All calendar-related types are defined in components/calendar/types.ts:

  • Todo: Todo item structure
  • WeekDay: Day in the timeline
  • MarkedDate: Calendar marking configuration
  • DayData: Day with associated todos

Todo Interface:

typescript
interface Todo { id: string; title: string; description?: string; date: string; // YYYY-MM-DD format time?: string; // HH:mm format endTime?: string; // HH:mm format completed: boolean; priority: "low" | "medium" | "high"; category?: string; categoryColor?: string; }

🎨 Theme System

The app uses a dual theme system:

  1. Calendar Theme (components/calendar/theme.ts): Specific to calendar component

    • lightCalendarTheme / darkCalendarTheme: For react-native-calendars
    • agendaColors.light / agendaColors.dark: For agenda components
  2. 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! πŸš€

Posted by

E

eren

@eren