Calendar (lv_calendar)

A month calendar that highlights today and user-defined dates.

Overview

The Calendar shows the days of a month in a 7×7 grid with weekday names, highlights today, and can mark user-defined dates. The displayed month and the highlighted/selected dates are all configurable.

Learn more in the LVGL Open documentation.

Properties

Parts

Style parts of the widget with local style (e.g. style_bg_color-knob="0xff0000") or with style sheets (e.g. <style name="style_knob" selector="knob">). See Styles to learn more.

PartDescription
mainThe calendar background: background and padding properties.
itemsThe day cells and weekday names (built on a button matrix): background and text properties. Weekday names and days outside the shown month (disabled) are drawn without background/border. Today's thicker border and the highlighted days' fill/border are forced to the theme's primary color in code, so they are not set via style properties.

Properties below are the widget's XML <api>; see API for how properties, parameters and elements work.

PropertyTypeDescription
today_yearintMark today’s year in the calendar
today_monthintMark today’s month in the calendar
today_dayintMark today’s day in the calendar
shown_yearintShow this year in the calendar
shown_monthintShow this month in the calendar
chinese_modeboolShow a Chinese calendar

<lv_calendar-header_arrow>

Add arrow buttons for navigating months

access add

No attributes — created as an empty child.

<lv_calendar-header_dropdown>

Add a dropdown for selecting months or years

access add

No attributes — created as an empty child.

Last updated on

On this page