PhoenixLiveCalendar.Components.Header (PhoenixLiveCalendar v0.1.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: true). When :auto, the button is hidden if today is visible.
  • 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

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.
  • 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.