Mixins / foldkit-mixins-ui

CalendarOptions

interface · packages/mixins-ui/src/calendar.ts:310

interface CalendarOptions<Message> {
  readonly render?: ((resolved: ResolvedCalendar<Message>) => Html) | undefined
  readonly weekNumbers?: boolean | undefined
  readonly caption?: 'grid' | 'label' | undefined
  readonly dropdowns?: Dropdowns<Message> | undefined
  readonly paging?: 'both' | 'previous' | 'next' | 'none' | 'end' | undefined
  readonly preview?: Preview<Message> | undefined
  readonly detail?:
    ((date: Dates.CalendarDate) => Option.Option<string>) | undefined
}

What a Calendar draws beyond upstream's grid. Every option is off by default.

In the guides

Members

CalendarOptions.render

property · packages/mixins-ui/src/calendar.ts:312

readonly render?: ((resolved: ResolvedCalendar<Message>) => Html) | undefined

Draws the resolved bundles; default draw.

CalendarOptions.weekNumbers

property · packages/mixins-ui/src/calendar.ts:314

readonly weekNumbers?: boolean | undefined

A column of ISO 8601 week numbers before the days.

CalendarOptions.caption

property · packages/mixins-ui/src/calendar.ts:320

readonly caption?: 'grid' | 'label' | undefined

The days' heading: grid (default) is a button opening a grid of months, then of years; label the month and year as text. dropdowns replaces either.

property · packages/mixins-ui/src/calendar.ts:321

readonly dropdowns?: Dropdowns<Message> | undefined

CalendarOptions.paging

property · packages/mixins-ui/src/calendar.ts:327

readonly paging?: 'both' | 'previous' | 'next' | 'none' | 'end' | undefined

Which paging buttons are drawn; default both, either side of the caption. end draws both after it. Two months side by side draw previous on the first and next on the second.

CalendarOptions.preview

property · packages/mixins-ui/src/calendar.ts:328

readonly preview?: Preview<Message> | undefined

CalendarOptions.detail

property · packages/mixins-ui/src/calendar.ts:334

readonly detail?:
  ((date: Dates.CalendarDate) => Option.Option<string>) | undefined

A line under a day's number, such as its price or "2 events"; none for a day without one. A screen reader reads it after the date. Pick the recipe's detail axis to give it room or to draw it as a dot.