Maui.Flash (maui v0.1.17)

Summary

Functions

Flash container with positioning support.

Individual flash message component.

Use .flash_group to place flash container in your layout.

Callback implementation for Phoenix.LiveComponent.mount/1.

Callback implementation for Phoenix.LiveComponent.render/1.

Functions

container(assigns)

Flash container with positioning support.

Attributes

  • position (:string) - Defaults to "top-right".
  • Global attributes are accepted.

Slots

  • inner_block

flash(assigns)

Individual flash message component.

Attributes

  • id (:string)
  • position (:string) - Defaults to "top-right".
  • Global attributes are accepted.

Slots

  • inner_block

flash_group(assigns)

Use .flash_group to place flash container in your layout.

If you want to use in liveview page, pass option live={true}

example:

<Maui.Flash.flash_group flash={@flash} live={true}>

Attributes

  • flash (:map) (required)
  • live (:boolean) - Defaults to false.
  • limit (:integer) - Defaults to 5.
  • position (:string) - Defaults to "top-right". Must be one of "top-left", "top-right", "top-center", "bottom-left", "bottom-right", or "bottom-center".
  • auto_dismiss (:integer) - Defaults to 5000.
  • show_close (:boolean) - Defaults to true.

handle_event(binary, map, socket)

Callback implementation for Phoenix.LiveComponent.handle_event/3.

mount(socket)

Callback implementation for Phoenix.LiveComponent.mount/1.

render(assigns)

Callback implementation for Phoenix.LiveComponent.render/1.

send_flash(message, opts \\ [])

update(assigns, socket)

Callback implementation for Phoenix.LiveComponent.update/2.