Overview
TheAgendaList component is a specialized scrollable list that organizes agenda items by date sections. It extends React Native’s SectionList and must be wrapped with CalendarProvider to work properly. The component automatically handles date synchronization with the calendar and provides smooth scrolling between date sections.
The
AgendaList component must be wrapped with CalendarProvider to function correctly.Basic usage
Complete example
Props
TheAgendaList component extends all props from React Native’s SectionList component and adds the following custom props:
Specify theme properties to override specific styles for calendar parts.
The sections to render in the list. Each section should have a
title (date string in format ‘YYYY-MM-DD’) and data (array of items).Function to render each item in the list.
Day format in section title. Uses XDate formatting values by default, or moment.js format if
useMoment is true.Formatting reference: http://arshaw.com/xdate/#FormattingA custom function to format the section header’s title. This overrides
dayFormat if provided.Whether to use moment.js for date string formatting. When enabled, remember to pass
dayFormat with appropriate moment.js format (e.g., ‘dddd, MMM D’).Whether to mark today’s title with the “Today, …” string prefix.
Style object passed to the section header view.
Custom function to render section headers. Receives the section title (date string) as parameter.
Whether to block the date change in calendar (and calendar context provider) when the agenda scrolls.
Offset value for scrolling to section. Useful when you have sticky headers or other UI elements that might overlap the scrolled-to section.
Enable scrolling the agenda list to the next date with content when pressing a day without content.
Function to extract unique keys for list items. If not provided, uses the index as the key.
Callback called when the viewable items change. Receives info about viewable and changed items.
If defined, uses InfiniteList instead of SectionList for better performance with large datasets.Properties:
itemHeight(number): Height of each itemtitleHeight(number): Height of section headersitemHeightByType(Record<string, number>): Custom heights by item typevisibleIndicesChangedDebounce(number): Debounce time for visible indices changerenderFooter(() => React.ReactElement | null): Function to render footer
Inherited props
SinceAgendaList extends React Native’s SectionList, it also inherits all SectionList props including:
onScrollonMomentumScrollBeginonMomentumScrollEndonScrollToIndexFailedstickySectionHeadersEnabled(default: true)- And all other SectionList props
Notes
Section titles should match the current date format used in your calendar. The default format is ‘YYYY-MM-DD’.
The component automatically handles scrolling to the selected date when it changes in the calendar context.
Related components
- CalendarProvider - Required wrapper for AgendaList
- ExpandableCalendar - Often used together with AgendaList
- WeekCalendar - Alternative calendar component