Skip to content

Add support for custom placeholder for CalendarListΒ #2144

@ngima

Description

@ngima

Type

Feature Request

Description

When using the CalendarList to scroll through months, users may encounter an empty calendar with the current month & year displayed in large bold text when scrolling quickly. It would be beneficial to provide the option for users to customize the placeholder displayed in this scenario.

Expected Behavior

An option to set the placeholder in the CalendarList. So, when a user scrolls quickly through the months in the CalendarList, instead of seeing the empty calendar with the current month displayed in large bold text, they would see a custom placeholder that they have set. This custom placeholder could be a Component, that the user has specified in the code. The placeholder will be displayed when no data of month is present in a calendar and it will give an option to provide a better user experience.

Add a function of following type in CalendarListProps

renderPlaceholder: (year: number, month: number)=>React. ReactElement

So we can pass renderPlaceholder in CalendarList as below

<CalendarList
  // Specify what should be rendered instead of ActivityIndicator
  renderPlaceholder={(year: number, month: number) => <SomeCompoent year={year} month={month}/>}
  ...calendarParams
/>

Screenshots

NOTE

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions