Calendar View
Month/week/day calendar view with event slots.
Preview
January 2026
Mon
Tue
Wed
Thu
Fri
Sat
Sun
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Usage
views.py
python
from djust import LiveView
from djust.components import CalendarView
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = CalendarView()my_template.html
django
{{ component }}Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| events | list | None | None | List of dicts with ``date`` (YYYY-MM-DD), ``title``, optional ``color`` |
| month | int | 1 | Month number (1-12) |
| year | int | 2026 | Four-digit year |
| view | str | 'month' | "month", "week", or "day" (default: "month") |
| start_day | int | 0 | First day of week, 0=Mon 6=Sun (default: 0) |
| event | str — renames the event; identity is `name` | '' | djust click event for day cells |
| custom_class | str | '' | Additional CSS classes |
| **kwargs | — passed to `Component.__init__`: `name=` identifies the instance in the events it sends, `id=` sets `component.id`, and any other keyword is kept as state | — | — |
Source & styles
| File | Path | Notes |
|---|---|---|
| module | djust.components.components.calendar_view | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 10 of this component's classes at line 2211, 2212, 2213, 2214, 2215, 2216, 2218, 2219, 2526, 2527. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |