@chynna/react-calendar
Version:
A flexible and feature-rich calendar component library for React applications with drag-and-drop support, multiple views (Day, Week, Month, Year), and plugin architecture
36 lines (35 loc) • 1.36 kB
TypeScript
import React from 'react';
import { CalendarApp } from '@/types';
export type ViewHeaderType = 'day' | 'week' | 'month' | 'year';
export type ViewSwitcherMode = 'buttons' | 'select';
interface ViewHeaderProps {
calendar: CalendarApp;
/** View type */
viewType: ViewHeaderType;
/** Current date */
currentDate: Date;
/** Previous period */
onPrevious?: () => void;
/** Next period */
onNext?: () => void;
/** Go to today */
onToday?: () => void;
/** Custom title (optional, takes priority over default title) */
customTitle?: string;
/** Custom subtitle (optional, only for Day view) */
customSubtitle?: string;
/** Whether to show TodayBox (default determined by viewType: day=false, week/month=true) */
showTodayBox?: boolean;
/** ViewSwitcher mode (default: 'select') */
switcherMode?: ViewSwitcherMode;
/** Sticky year for Year view (optional, only for Year view) */
stickyYear?: number | null;
/** Push-away offset for sticky year (in pixels) */
stickyYearOffset?: number;
/** Next year that's pushing the sticky year (optional, only for Year view) */
nextYear?: number | null;
/** Offset for the next year coming from below (in pixels) */
nextYearOffset?: number;
}
declare const ViewHeader: React.FC<ViewHeaderProps>;
export default ViewHeader;