defmodule PyrauiWeb.DocsLive.CountdownDocs do use PyrauiWeb, :html def render(assigns) do ~H"""
Countdown timer component for events, offers, or games. Updates in real-time and dispatches events when complete.
<.countdown id="sale-timer" target_date={~U[2024-12-31 23:59:59Z]} />
<.countdown id="event-timer" target_date={@event_date} format={:detailed} />
<.countdown
id="timer"
target_date={@target_date}
on_complete="countdown-complete"
/>
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | - | Unique ID for the countdown |
| target_date | DateTime | NaiveDateTime | string | - | Target date/time for countdown |
| format | atom | :compact | Display format (:compact or :detailed) |
| on_complete | string | nil | Event name to dispatch when countdown completes |