DayDecorators

Prebuilt DayDecorators. All are data-driven via per-date lookups returning null/empty/false for undecorated days. Factories reading Material theme defaults are @Composable — call them in composition (once, outside dayContent, ideally remembered) and pass the resulting list to DefaultDay.

Functions

Link copied to clipboard
fun badge(maxCount: Int = 9, containerColor: Color = MaterialTheme.colorScheme.error, contentColor: Color = MaterialTheme.colorScheme.onError, selectedOutlineColor: Color? = null, count: (LocalDate) -> Int): DayDecorator

Count bubble at the cell's top-end corner (top-start in RTL). Counts <= 0 draw nothing; counts above maxCount render as "maxCount+". Draws over the day content.

Link copied to clipboard
fun eventDots(maxDots: Int = 3, dotSize: Dp = 4.dp, spacing: Dp = 2.dp, colors: (LocalDate) -> List<Color>): DayDecorator

Up to maxDots colored dots centered near the cell bottom.

fun eventDots(selectedColor: Color, maxDots: Int = 3, dotSize: Dp = 4.dp, spacing: Dp = 2.dp, colors: (LocalDate) -> List<Color>): DayDecorator

eventDots whose dots draw in selectedColor on a selected day in DefaultDay.

Link copied to clipboard
fun eventDotsForEvents(eventsByDate: (LocalDate) -> List<CalendarEvent<*>>, defaultColor: Color = MaterialTheme.colorScheme.primary, maxDots: Int = 3, dotSize: Dp = 4.dp, spacing: Dp = 2.dp): DayDecorator

Up to maxDots distinct event colors for each day from eventsByDate.

Link copied to clipboard
fun heatmap(shape: Shape = CircleShape, colorScale: (Float) -> Color = defaultHeatmapScale(), intensity: (LocalDate) -> Float?): DayDecorator

GitHub-style intensity fill (0f..1f) of shape; null draws nothing.

Link copied to clipboard
fun progressBar(thickness: Dp = 3.dp, color: Color = MaterialTheme.colorScheme.primary, trackColor: Color = MaterialTheme.colorScheme.primary.copy(alpha = 0.12f), progress: (LocalDate) -> Float?): DayDecorator

0f..1f linear bar near the cell bottom; null draws nothing.

Link copied to clipboard
fun progressRing(strokeWidth: Dp = 2.dp, color: Color = MaterialTheme.colorScheme.primary, trackColor: Color = MaterialTheme.colorScheme.primary.copy(alpha = 0.12f), progress: (LocalDate) -> Float?): DayDecorator

0f..1f progress arc around the cell; null draws nothing.

Link copied to clipboard
fun rangePreview(selectionState: CalendarSelectionState, targetDate: LocalDate?, color: Color = MaterialTheme.colorScheme.primaryContainer.copy(alpha = 0.45f)): DayDecorator

Translucent range preview connector band when selectionState's selection has an open rangeStart (rangeEnd == null) and targetDate is non-null and distinct from rangeStart.

Link copied to clipboard
fun spanningEventBars(eventsByDate: (LocalDate) -> List<CalendarEvent<*>>, maxBars: Int = 2, barHeight: Dp = 4.dp, barSpacing: Dp = 2.dp, defaultColor: Color = MaterialTheme.colorScheme.primary): DayDecorator

Up to maxBars horizontal event bars near the bottom of the cell.

Link copied to clipboard
fun stackedBars(maxBars: Int = 3, barWidth: Dp = 14.dp, barHeight: Dp = 2.5.dp, spacing: Dp = 2.dp, colors: (LocalDate) -> List<Color>): DayDecorator

Up to maxBars short horizontal stacked color bars centered near the bottom of the cell.

Link copied to clipboard
fun strikethrough(color: Color = MaterialTheme.colorScheme.onSurfaceVariant, thickness: Dp = 1.dp, dates: (LocalDate) -> Boolean): DayDecorator

Line through the day number for matching dates. Draws over the content.

Link copied to clipboard
fun underline(color: Color = MaterialTheme.colorScheme.primary, thickness: Dp = 2.dp, dates: (LocalDate) -> Boolean): DayDecorator

Short line under the day number for matching dates.