PhoenixLiveCalendar.Components.Header (PhoenixLiveCalendar v0.3.0)

Copy Markdown View Source

Calendar toolbar component with navigation, title, and view switcher.

Summary

Functions

Renders the calendar header toolbar.

Functions

header(assigns)

Renders the calendar header toolbar.

Attributes

  • title — The title text (e.g., "April 2026")
  • view — Current view mode atom
  • views — List of available view modes (default: [:month, :week, :day])
  • on_prev — Event or JS command for previous navigation
  • on_next — Event or JS command for next navigation
  • on_today — Event or JS command for "go to today"
  • on_view_change — Event or JS command for view switching
  • today_visible — Whether today is in the current visible range (default: false)
  • show_today_button — Whether to show the today button at all (default: :auto — hidden while today is visible)
  • layout:auto (default) collapses to a start-aligned row when both wings are empty; :centered/:start force a layout (:start keeps wing content inline after the title)
  • help_label — aria label for the info (ⓘ) disclosure
  • translations — Translation overrides
  • class — Additional CSS classes
  • dir — Text direction (:ltr or :rtl)

Slots

  • toolbar_start — Custom content before the navigation
  • toolbar_end — Custom content after the view switcher
  • help — Content for the info (ⓘ) disclosure (a no-JS details popover)

Attributes

  • title (:string) (required)

  • view (:atom) - Defaults to :month.

  • views (:list) - Defaults to [:month, :week, :day].

  • on_prev (:any) (required)

  • on_next (:any) (required)

  • on_today (:any) (required)

  • on_view_change (:any) - Defaults to nil.

  • today_visible (:boolean) - Defaults to false.

  • show_today_button (:any) - Defaults to :auto.

  • layout (:atom) - :centered — the classic three-zone toolbar (today | ‹ title › | views). :start — a single start-aligned row. :auto (default) — centered while any wing has content; when BOTH wings are empty (today hidden, no view switcher, no info/slots) the grid would render as a barren bar with a lone centered title, so it collapses to the start-aligned row instead.

    Defaults to :auto.

  • translations (:map) - Defaults to %{}.

  • class (:string) - Defaults to "".

  • dir (:atom) - Defaults to :ltr.

  • help_label (:string) - Defaults to "About".

Slots

  • toolbar_start
  • toolbar_end
  • help - Optional content for an info (ⓘ) disclosure shown at the end of the toolbar — e.g. a key explaining the calendar's markings. Rendered as a no-JS <details> popover.