PtahUi.Components.Banner (PtahUI v0.1.0)

Copy Markdown View Source

Top-of-page announcement banner with optional countdown timer.

The timer requires a Banner JS hook that reads data-end (ISO 8601 timestamp) and writes a countdown string into #timer-countdown.

Summary

Functions

banner(assigns)

Attributes

  • text (:string) - Defaults to "".
  • end_time (:any) - ISO 8601 datetime string for the countdown timer. Defaults to nil.
  • gradient_from_class (:string) - Tailwind from-* class for the gradient start colour. Defaults to "from-violet-500".
  • gradient_to_class (:string) - Tailwind to-* class for the gradient end colour. Defaults to "to-transparent".
  • gradient_stop_class (:string) - Tailwind gradient colour-stop class. Defaults to "from-85%".
  • text_class (:string) - Classes applied to the banner text and timer. Defaults to "text-white/80 font-bold".
  • class (:string) - Extra classes for the wrapper element. Defaults to nil.