Web · Components
EventCalendar
Event calendar and scheduler: month, week, day, agenda and year views.
Live example
Preview
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
Code
Events
- Events appear here when you interact with the preview.
Loading from the server range by range (onRangeChange + loading)
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
Read-only agenda, custom row rendering
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
Import
Event calendar and scheduler: month, week, day, agenda and year views.
- Editing: Events are moved by dragging and resized from their bottom/top edge (the right edge in month view). A timed event dropped on the all-day row becomes all-day, and vice versa. Dragging over an empty area selects a new event range. Everything snaps to 15 minutes.
- Recurring events: A subset of RFC 5545 RRULE (daily, weekly, monthly "last Friday of the month", yearly, count, until, excluded days). When an occurrence changes, "This event / This and following / All" is asked;
applyEventChangeapplies the result to the list. - Mobile: In narrow areas the week shrinks to 3 days; swipe left/right to navigate; long press an event to drag it; details open in a bottom sheet.
- Keyboard: On an event Enter opens the details, Alt+arrows move it, Alt+Shift+↑/↓ changes the duration, Delete deletes it. PageUp/PageDown go to the previous/next range.
- Times are wall-clock times (
"2026-10-31T14:30"); no time zone conversion is done. The locale and week start come from theUIProviderlocale.
Examples
defaultEventCalendarMessages
constantDefault (Turkish) texts.
enEventCalendarMessages
constantEnglish texts.
describeRecurrence
functionTurns a recurrence rule into readable text: "Every week: Monday, Wednesday", "Every month, on the last Friday", "Every 2 days, 10 times". Use it in the detail card and your own forms.
Examples
parseRecurrence
functionTurns an RFC 5545 RRULE string into a RecurrenceRule object; undefined when not recognized. An "RRULE:" prefix is allowed. Supported fields: FREQ, INTERVAL, COUNT, UNTIL, BYDAY, BYMONTHDAY, BYMONTH.
Examples
formatRRule
functionTurns a RecurrenceRule object into an RFC 5545 RRULE string (without the "RRULE:" prefix). To write calendar files (.ics) or store it in one database field.
Examples
getOccurrences
functionOccurrences of the events (recurrences expanded) between the given days. For your own lists, notifications or exports.
Examples
applyEventChange
functionApplies an EventChange to the event list and returns the new list (does not mutate the input). For recurring events, by scope:
"this": the occurrence is excluded from the series (exclude) and a new one-off event is added in its place."following": the series ends before this occurrence (until/count) and a new series starts from it."all": the whole series shifts by the same amount (weekly days shift too).
Examples
applyEventDelete
functionApplies an EventDeletion: a non-recurring event is deleted; for a recurring one, by scope the occurrence is excluded ("this"), the series ends before it ("following") or the whole series is deleted ("all").
Examples
EventDetailsContext
interfaceValues passed to the function that renders the detail card's content.
| Name | Type | Description |
|---|---|---|
occurrence | EventOccurrence<T> | The clicked occurrence (for recurrences, that day's occurrence). |
close | () => void | Closes the card. |
EventCalendarProps
interfaceProps of the EventCalendar component.
| Name | Type | Default | Description |
|---|---|---|---|
events | readonly T[] | Events. Recurring ones (recurrence) are expanded for the visible range; even with thousands of events only the visible range is computed. | |
view? | EventCalendarView | View when controlled. | |
defaultView? | EventCalendarView | "week" | Initial view when uncontrolled. |
onViewChange? | (view: EventCalendarView) => void | Called when the view changes. | |
views? | readonly EventCalendarView[] | ["month", "week", "day", "agenda"] | Views offered in the view switcher (in order). If a single view is given, the switcher is hidden. |
date? | DateInput | Shown day when controlled ("2026-10-31" or a Date). | |
defaultDate? | DateInput | today | Initial day when uncontrolled. |
onDateChange? | (date: string) => void | Called with the ISO day when the shown day changes. | |
onRangeChange? | (range: EventCalendarRange) => void | Called when the visible range changes (on first render too). For loading events from a server range by range. | |
onEventClick? | (occurrence: EventOccurrence<T>) => void | Called when an event is clicked. Also called while the detail card (eventDetails) is open. | |
onEventChange? | (change: EventChange<T>) => void | Called when an event is dragged or resized. If given, events become editable. For a recurring event, "This event / This and following / All" is asked first. Use applyEventChange to update the list. | |
onEventCreate? | (slot: EventSlot) => void | Called when an empty area is clicked or a range is selected by dragging (long press and drag on touch). If given, areas become selectable; usually a form window opens. | |
onEventDelete? | (deletion: EventDeletion<T>) => void | The "Delete" button in the detail card and the Delete key on the focused event. Can be applied with applyEventDelete. | |
onEventEdit? | (occurrence: EventOccurrence<T>) => void | The "Edit" button in the detail card. If omitted, the button is not shown. | |
eventDetails? | boolean | ((event: T, context: EventDetailsContext<T>) => ReactNode) | true | Detail card that opens next to the event on click (a bottom sheet on mobile). false disables it; with a function you render the card body. |
renderEvent? | (event: T, info: EventRenderInfo) => ReactNode | To render the inside of the event box yourself. | |
editable? | boolean | true` if `onEventChange` is given | Are dragging and resizing enabled? Can be disabled per event with editable: false. |
selectable? | boolean | true` if `onEventCreate` is given | Is empty area selection enabled? |
weekStartsOn? | 0 | 1 | 2 | 3 | 4 | 5 | 6 | First day of the week. If omitted, by locale (Monday for tr-TR). | |
minTime? | string | "00:00" | First hour of the time grid. |
maxTime? | string | "24:00" | Last hour of the time grid ("24:00" is end of day). |
slotDuration? | number | 30 | Interval of the thin lines in the grid (minutes). |
snapDuration? | number | 15 | Snap interval while dragging (minutes). |
hourHeight? | number | 48 | Height of one hour (px). |
scrollToTime? | string | Time to scroll to when the week/day view opens ("08:00"). If omitted, one hour before now if today is visible, otherwise 08:00. | |
businessHours? | BusinessHours | Business hours; outside them is shown dimmed. | |
narrowDays? | number | 3 | Number of days in the week view on narrow areas (below 640 px); swipe to move between days. |
agendaDays? | number | 30 | Number of days shown on one page of the agenda. |
showWeekNumbers? | boolean | false | Show ISO week numbers? |
dimPastEvents? | boolean | true | Show past events dimmed? |
defaultDuration? | number | 60 | Duration of a timed event with no duration (minutes). |
loading? | boolean | Shows a thin loading bar on top (e.g. while a range loads). | |
toolbar? | boolean | true | Toolbar (today, previous/next, title, view switcher). |
toolbarEnd? | ReactNode | Items appended to the end of the toolbar (e.g. a "New event" button). | |
messages? | Partial<EventCalendarMessages> | Texts of this calendar; for the whole app use the ui.eventCalendar namespace of the dictionary. See EventCalendarMessages. | |
locale? | string | Locale of date and time formats. If omitted, the UIProvider locale. | |
className? | string | "h-[42rem]" | Classes of the container. The height is set here. |
aria-label? | string | Screen reader name. |
Calendar views.
EventCalendarMessages
interfaceTexts of EventCalendar. Pass only the ones you want to change with messages; the rest are the Turkish defaults. Placeholders such as {count} are replaced with values.
| Name | Type | Default | Description |
|---|---|---|---|
label | string | "Etkinlik takvimi" | Screen reader name of the calendar. |
today | string | "Bugün" | |
previous | string | "Önceki" | |
next | string | "Sonraki" | |
month | string | "Ay" | View names. |
week | string | "Hafta" | |
day | string | "Gün" | |
agenda | string | "Ajanda" | |
year | string | "Yıl" | |
days | string | "{count} gün" | Name of the week view on narrow screens. |
view | string | "Görünüm" | Screen reader name of the view picker. |
goToDate | string | "Tarihe git" | Go to date button. |
allDay | string | "Tüm gün" | |
more | string | "+{count} daha" | Events that do not fit. |
showLess | string | "Daralt" | Collapses the all-day row. |
noEvents | string | "Bu aralıkta etkinlik yok" | When the agenda has no events. |
newEvent | string | "Yeni etkinlik" | Name of the new event created while dragging. |
untitled | string | "(Başlıksız)" | Untitled event. |
edit | string | "Düzenle" | |
delete | string | "Sil" | |
close | string | "Kapat" | |
confirm | string | "Tamam" | |
cancel | string | "İptal" | |
recurringChange | string | "Tekrarlayan etkinlik değiştirilsin mi?" | Question asked when changing a recurring event. |
recurringDelete | string | "Tekrarlayan etkinlik silinsin mi?" | |
scopeThis | string | "Bu etkinlik" | |
scopeFollowing | string | "Bu ve sonraki etkinlikler" | |
scopeAll | string | "Tüm etkinlikler" | |
weekNumber | string | "{week}. hafta" | Week number. |
keyboardHint | string | "Taşımak için Alt ve ok tuşları, süreyi değiştirmek için Alt, Shift ve yukarı/aşağı ok" | Keyboard hint (screen reader). |
touchHint | string | "Taşımak için basılı tutup sürükleyin" | Touch hint (screen reader, React Native). |
moveEarlier | string | "Erkene al" | Accessibility action: move 15 minutes (the snap interval) earlier. |
moveLater | string | "İleriye al" | |
movePreviousDay | string | "Önceki güne taşı" | |
moveNextDay | string | "Sonraki güne taşı" | |
lengthen | string | "Uzat" | |
shorten | string | "Kısalt" | |
daily | string | "Her gün" | Recurrence texts. |
everyDays | string | "{count} günde bir" | |
weekly | string | "Her hafta" | |
everyWeeks | string | "{count} haftada bir" | |
monthly | string | "Her ay" | |
everyMonths | string | "{count} ayda bir" | |
yearly | string | "Her yıl" | |
everyYears | string | "{count} yılda bir" | |
onMonthDay | string | "ayın {day}. günü" | |
onLastMonthDay | string | "ayın son günü" | |
onNthWeekday | string | "ayın {nth}. {weekday}" | |
onLastWeekday | string | "ayın son {weekday}" | |
until | string | "{date} tarihine kadar" | |
times | string | "{count} kez" |
Weekday
typeDay of the week: 0 Sunday, 1 Monday … 6 Saturday.
NthWeekday
interfaceWhich weekday of the month or year: { day: 2, nth: 1 } is the first Tuesday of the month, { day: 5, nth: -1 } the last Friday.
| Name | Type | Description |
|---|---|---|
day | Weekday | Day of the week (0 Sunday … 6 Saturday). |
nth | number | Which one: 1 first, 2 second … ; -1 last, -2 second to last. |
CalendarEvent
interfaceAn event in the calendar. Times are wall-clock times (no time zone): "2026-10-31T14:30", "2026-10-31" for all day, or a Date (local time).
Extends: Core.CalendarEvent
| Name | Type | Description |
|---|---|---|
className? | string | Classes added to the event box. |
EventChange
typeA change made by dragging, resizing or the keyboard.
EventDeletion
typeDelete request.
EventOccurrence
typeAn occurrence in the visible range (for recurrences, that day's occurrence).
RecurrenceRule
interfaceA recurrence rule. A commonly used subset of the RFC 5545 (iCalendar) RRULE; the same rule can be given as text too ("FREQ=WEEKLY;BYDAY=MO,WE"). See parseRecurrence.
| Name | Type | Default | Description |
|---|---|---|---|
freq | "daily" | "weekly" | "monthly" | "yearly" | Frequency. | |
interval? | number | 1 | Every how many units (2 → every two weeks). |
count? | number | Total number of occurrences (the first included). Not given together with until. | |
until? | DateInput | Latest day of the last occurrence (inclusive). | |
byWeekday? | readonly (Weekday | NthWeekday)[] | Days of the week. Which days in weekly; with nth in monthly/yearly, like "the first Monday of the month"; a filter in daily. | |
byMonthDay? | readonly number[] | Days of the month (1–31; -1 is the last day of the month). | |
byMonth? | readonly number[] | Months (1 January … 12 December). |
Examples
RecurringScope
typeWhich occurrences of a recurring event change.
EventSlot
interfaceA time range selected by dragging or clicking on empty space.
| Name | Type | Description |
|---|---|---|
start | string | Start: "YYYY-MM-DDTHH:mm" when timed, "YYYY-MM-DD" when all-day. |
end | string | End: the end instant when timed, the last day (inclusive) when all-day. |
allDay | boolean | Selected from the all-day row or the month view? |
ApplyChangeOptions
interfaceOptions: id of the new event in operations that split an occurrence off. "<id>-<YYYY-MM-DD>" when omitted.
| Name | Type | Description |
|---|---|---|
createId? | (event: T, occurrenceStart: string) => string | number | Builds an id for a split occurrence or a new series. |
EventRenderInfo
interfaceInfo passed to the EventCalendarProps.renderEvent function.
| Name | Type | Description |
|---|---|---|
view | EventCalendarView | Which view it is rendered in. |
variant | "timed" | "bar" | "dot" | "agenda" | Shape of the box: "timed" is a box in the time grid, "bar" an all-day or multi-day bar, "dot" a timed row in month view, "agenda" an agenda row. |
time | string | Formatted time range ("09:00 – 10:30"); empty if all day. |
dragging | boolean | Is it being dragged? |