PhiaUi.Components.BookingCalendar (phia_ui v0.1.17)

Copy Markdown View Source

Airbnb-style booking calendar with per-cell availability states.

Unlike RangeCalendar (pure range selection), BookingCalendar adds availability states per cell: :available, :unavailable, :check_in_only, :check_out_only.

Supports optional price display per cell and range selection with visual band.

Example

<.booking_calendar
  year={2026}
  month={3}
  availability={%{~D[2026-03-15] => :unavailable, ~D[2026-03-20] => :check_in_only}}
  prices={%{~D[2026-03-10] => "$120"}}
  range_start={@from}
  range_end={@to}
  on_select="pick_date"
  on_prev="prev_month"
  on_next="next_month"
/>

Summary

Functions

booking_calendar(assigns)

Attributes

  • year (:integer) (required)
  • month (:integer) (required)
  • availability (:map) - Defaults to %{}.
  • prices (:map) - Defaults to %{}.
  • range_start (:any) - Defaults to nil.
  • range_end (:any) - Defaults to nil.
  • on_select (:string) - Defaults to nil.
  • on_prev (:string) - Defaults to nil.
  • on_next (:string) - Defaults to nil.
  • first_day (:atom) - Defaults to :mon. Must be one of :mon, or :sun.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.