reablocks
Version:
Component library for React
61 lines (59 loc) • 1.61 kB
TypeScript
import { CalendarTheme } from './CalendarTheme';
import { default as React, FC } from 'react';
export type CalendarViewType = 'days' | 'months' | 'years';
export interface CalendarProps {
/**
* The selected date(s) for the calendar.
*/
value?: Date | [Date, Date] | [Date, undefined] | [undefined, undefined] | undefined;
/**
* The minimum selectable date for the calendar.
*/
min?: Date;
/**
* The maximum selectable date for the calendar.
* Can also be set to 'now' to use the current date.
*/
max?: Date | 'now';
/**
* Whether the calendar is disabled.
*/
disabled?: boolean;
/**
* Whether the calendar is a range picker.
*/
isRange?: boolean;
/**
* The text or icon to use for next.
*/
nextArrow?: React.ReactNode | string;
/**
* The text or icon to use for previous.
*/
previousArrow?: React.ReactNode | string;
/**
* Whether to display day of week labels
*/
showDayOfWeek?: boolean;
/**
* Whether to highlight the today.
*/
showToday?: boolean;
/**
* Whether to animate the calendar.
*/
animated?: boolean;
/**
* A callback function that is called when the selected date(s) change.
*/
onChange?: (value: Date | [Date, Date]) => void;
/**
* A callback function that is called when the calendar view changes.
*/
onViewChange?: (view: CalendarViewType) => void;
/**
* Theme for the Calendar.
*/
theme?: CalendarTheme;
}
export declare const Calendar: FC<CalendarProps>;