ObanChoreWeb.CoreComponents (ObanChore v0.2.3)

Copy Markdown View Source

Provides UI components for the ObanChore dashboard.

Summary

Functions

Renders a numeric badge.

Renders a warning banner for duplicate chore execution.

Renders flash notices.

Shows the flash group with standard titles and content.

Renders an input with label and error messages.

Renders a toggle for unique execution.

Functions

badge(assigns)

Renders a numeric badge.

Attributes

  • count (:integer) (required)
  • class (:string) - Defaults to nil.

duplicate_warning_banner(assigns)

Renders a warning banner for duplicate chore execution.

Attributes

  • on_confirm (:string) (required)
  • on_cancel (:string) (required)

flash(assigns)

Renders flash notices.

Examples

<.flash kind={:info} flash={@flash} />
<.flash kind={:info} phx-mounted={show("#flash")}>Welcome Back!</.flash>

Attributes

  • id (:string) - the optional id of flash container.
  • flash (:map) - the map of flash messages to display. Defaults to %{}.
  • title (:string) - Defaults to nil.
  • kind (:atom) - used for styling and flash lookup. Must be one of :info, or :error.
  • Global attributes are accepted. the arbitrary HTML attributes to add to the flash container.

Slots

  • inner_block - the optional inner block that renders the flash message.

flash_group(assigns)

Shows the flash group with standard titles and content.

Examples

<.flash_group flash={@flash} />

Attributes

  • flash (:map) (required) - the map of flash messages.
  • id (:string) - the optional id of flash container. Defaults to "flash-group".

hide(js \\ %Phoenix.LiveView.JS{}, selector)

input(assigns)

Renders an input with label and error messages.

Attributes

  • id (:any) - Defaults to nil.
  • name (:any)
  • label (:string) - Defaults to nil.
  • value (:any)
  • type (:string) - Defaults to "text".
  • field (Phoenix.HTML.FormField)
  • errors (:list) - Defaults to [].
  • default (:any) - Defaults to nil.
  • options (:list) - Defaults to [].
  • prompt (:string) - Defaults to nil.
  • Global attributes are accepted.

label(assigns)

Attributes

  • for (:string) - Defaults to nil.

Slots

  • inner_block (required)

show(js \\ %Phoenix.LiveView.JS{}, selector)

unique_execution_toggle(assigns)

Renders a toggle for unique execution.

Attributes

  • unique_execution (:boolean) (required)
  • worker_has_unique (:boolean) (required)
  • phx_click (:string) - Defaults to "toggle_unique".