Data display
Full Calendar
An event calendar drawn by FullCalendar 7, with month, week and day views, configured with the library's own options. It loads the library on demand in the app's language, follows the light and dark color scheme and redraws when Livewire sends new options. For picking a date in a form, use the calendar or date picker instead.
Nothing to show
A spinner shows while the library loads, then a month grid with the two events on their days, under a toolbar with the previous and next buttons and the month name in the app's language; FullCalendar 7 shows no toolbar without headerToolbar. options is what FullCalendar takes in new FullCalendar.Calendar(element, options), as a PHP array.
Events from Livewire #
After addReview() the calendar is drawn again with the new event, staying on the week and view the user was looking at.
Nothing to show
Nothing to show
Events from a URL #
FullCalendar requests the URL with start and end query parameters for the range on screen, and again when the user moves to another month or week.
Nothing to show
Callbacks written in JavaScript #
data-options is a JavaScript object merged over options, for what a PHP array cannot carry: here clicking an event calls open() with its id, and clicking a day calls create() with the date.
Nothing to show
Nothing to show
Week view and toolbar #
Any FullCalendar option works: here initialView opens the week grid and headerToolbar adds view switches.
Nothing to show
Nothing to show
Rendered event #
rendered fires with the FullCalendar instance each time the calendar is drawn.
Nothing to show
Nothing to show
Locale and palette #
locale sets the language and palette the theme colors.
Nothing to show
Nothing to show
Customization #
Classes go to the calendar <div>; loadable: reaches the wrapper around it.
Nothing to show
Nothing to show
Reference
tk:full-calendar
| Prop | Type | Default | Description |
|---|---|---|---|
options |
array | null |
The FullCalendar options: initialView, events, headerToolbar, initialDate... |
locale |
string | the app's locale | The language of the calendar (pt_BR, en, es...). Its translation file is loaded with the library. |
theme |
string | monarch |
The FullCalendar 7 theme to load. |
palette |
string | blue |
The color palette of the theme. |
data-options is an attribute, not a prop: a JavaScript expression that returns an object of options.
Events
| Event | Detail | When |
|---|---|---|
rendered |
{ fullCalendar }, the FullCalendar instance |
The calendar was drawn: the first time and on each update of the options. |
started |
The library started loading. Not fired with loadable:silent. |
|
completed |
The library is loaded; the calendar is drawn right after. | |
failed |
The library could not be loaded, or FullCalendar threw while drawing. |
Prefixes
| Prefix | Goes to |
|---|---|
loadable: |
The wrapper around the calendar, the spinner and the error. loadable:silent hides the spinner. |
loadable:loading: |
The spinner shown while the library loads. |
loadable:error: |
The error message. |
Events
rendered is dispatched on the calendar element, the <div> the tag's attributes go to, and does not bubble: listen on the tag itself. started, completed and failed are dispatched on the wrapper around it and do not bubble either, so they are listened to with the loadable: prefix.
With Alpine:
Nothing to show
Calling a Livewire action:
Nothing to show
Customization
Classes and attributes on the tag go to the calendar <div>, which is w-full h-full by default. To reach the elements around it, prefix the attribute (listed in the Reference above).
Nothing to show
The height follows FullCalendar's height and aspectRatio options.
Accessibility
FullCalendar renders the grid with its own roles and labels, and its toolbar buttons are real buttons with accessible names in the calendar's language. The spinner and the error message are role="status" regions.
Behavior notes
- The library, the
themeand itspaletteare loaded fromhttps://cdn.jsdelivr.net/npm/fullcalendar@7by the first calendar on the page. Whenwindow.FullCalendaralready exists, as when the app bundles it, none of them is requested:themeandpalettehave no effect and the app loads the theme and its CSS itself. The locale file is still requested from jsDelivr. - The locale file is loaded for any locale other than
enanden-US. A regional code with no file of its own (pt-xx) falls back to the language (pt); a language with no file leaves the calendar in English. - The color scheme follows the
darkclass of<html>: the wrapper'sdata-color-schemeswitches betweenlightanddark, which the themes use, without redrawing. - A Livewire update that changes
optionsupdates the same calendar (resetOptions), so the date, the view, the scroll and the focus stay; neweventsshow at once. When an option the previous options had is missing (aweekendsthe server stopped sending), the calendar is created again at the same date and view, so that option goes back to its default andrenderedbrings the new instance.getCalendar(), callable from Alpine expressions on the tag, returns the current instance. data-optionsis merged deeply overoptions: nested objects are combined key by key ({ headerToolbar: { end: 'today prev,next' } }keeps the PHPheaderToolbar.start), while arrays and other values are taken whole fromdata-options.