PhoenixDuskmoon.Component.Flash (PhoenixDuskmoon v6.0.8)

View Source

Duskmoon UI Flash Component

Use this component to display flash messages. Replace default flash in Phoenix project.

<.dm_flash_group flash={@flash} />

Summary

Functions

Renders flash notices.

Shows the flash group with standard titles and content.

Functions

dm_flash(assigns)

Renders flash notices.

Examples

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

Attributes

  • id (:string) - the optional id of flash container. Defaults to "flash".
  • 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.
  • autoshow (:boolean) - whether to auto show the flash on mount. Defaults to true.
  • close (:boolean) - whether the flash can be closed. Defaults to true.
  • 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.

dm_flash_group(assigns)

Shows the flash group with standard titles and content.

Examples

<.dm_flash_group flash={@flash} />

Attributes

  • flash (:map) (required) - the map of flash messages.