Published release 0.2.1. Unreleased PR #2 reference.
LOOM 0.2.1 / PLOTTING AND CALENDARS
MonthlyCalendar
A date-only monthly grid with caller-owned event, today, and selection styling.
Seven three-cell columns make a 21-cell grid. Narrow viewports clip whole
glyphs without changing date geometry. Weekday labels use Monday-first array
order and are rotated according to firstWeekday. Names are caller-localizable;
the widget never reads the wall clock or changes terminal modes.
Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.
Example
_ = MonthlyCalendar(month: try CalendarMonth(year: 2026, month: 10))Members on this page
Feature guides and release status
MonthlyCalendar
struct MonthlyCalendarConforms to: Swift.Sendable, Swift.SendableMetatype, Widget.
A date-only monthly grid with caller-owned event, today, and selection styling.
Seven three-cell columns make a 21-cell grid. Narrow viewports clip whole
glyphs without changing date geometry. Weekday labels use Monday-first array
order and are rotated according to firstWeekday. Names are caller-localizable;
the widget never reads the wall clock or changes terminal modes.
month
var month: CalendarMonthA public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:8firstWeekday
var firstWeekday: CalendarWeekdayA public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:9showsMonthHeader
var showsMonthHeader: BoolA public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:10showsWeekdays
var showsWeekdays: BoolA public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:11showsSurroundingDays
var showsSurroundingDays: BoolA public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:12fixedWeekCount
var fixedWeekCount: BoolA public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:13monthNames
var monthNames: [String]A public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:14weekdayLabels
var weekdayLabels: [String]A public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:18style
var style: StyleVisual attributes used when painting this value.
Source · MonthlyCalendar.swift:19headerStyle
var headerStyle: StyleA public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:20weekdayStyle
var weekdayStyle: StyleA public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:21weekendPatch
var weekendPatch: StylePatchA public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:22surroundingPatch
var surroundingPatch: StylePatchA public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:23events
var events: [CalendarDay : StylePatch]Asynchronous throwing stream of InputEvent batches, consumed on the main actor.
Source · MonthlyCalendar.swift:24today
var today: CalendarDay?A public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:25todayPatch
var todayPatch: StylePatchA public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:26selectedDay
var selectedDay: CalendarDay?A public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:27selectionPatch
var selectionPatch: StylePatchA public field of this type. Its value type and mutability are shown in the declaration.
Source · MonthlyCalendar.swift:28init(month:events:)
init(month: CalendarMonth, events: [CalendarDay : StylePatch] = [:])Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (2)
month- Argument type and any default are shown in the declaration; see the behavior notes above.
events- Argument type and any default are shown in the declaration; see the behavior notes above.
requiredHeight
var requiredHeight: Int { get }Number of rows needed for all enabled headers and weeks, before clipping.
Source · MonthlyCalendar.swift:36date(at:in:)
func date(at point: Point, in area: Rect) -> CalendarDay?Maps a visible day label to its date.
Separators, headers, and hidden surrounding days have no target.
Parameters (2)
at- Argument type and any default are shown in the declaration; see the behavior notes above.
in- Argument type and any default are shown in the declaration; see the behavior notes above.
Returns CalendarDay?.
render(in:buffer:)
func render(in area: Rect, buffer: inout Buffer)Paints this widget into the assigned terminal-cell rectangle. Application code owns state, input routing, and terminal lifetime.
Parameters (2)
in- Argument type and any default are shown in the declaration; see the behavior notes above.
buffer- Mutable destination cell grid.