View Source LiveToast.Components (Live Toast v0.5.0)

This module defines the components used in the rendering of the default toast messages. You can use this as a reference to create your own version of these components.

Summary

Functions

Attributes

  • flash (:map) (required) - the map of flash messages.
  • id (:string) - the optional id of flash container. Defaults to "toast-group".
  • corner (:atom) - the corner to display the toasts. Defaults to :bottom_right.
  • toast_class_fn (:any) - function to override the look of the toasts. Defaults to &LiveToast.toast_class_fn/1.

Attributes

  • f (:map) (required) - the map of flash messages.
  • corner (:atom) - the corner to display the toasts. Defaults to :bottom_right.
  • toast_class_fn (:any) - function to override the look of the toasts. Defaults to &LiveToast.toast_class_fn/1.

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.
  • target (:any) - the target for the phx-click event. Defaults to nil.
  • duration (:integer) - the time in milliseconds before the message is automatically dismissed. Defaults to 6000.
  • class_fn (:any) (required) - function to override the look of the toasts.
  • corner (:atom) (required) - the corner to display the toasts.
  • icon (:any) - the optional icon to render in the flash message. Defaults to nil.
  • action (:any) - the optional action to render in the flash message. Defaults to nil.
  • component (:any) - the optional component to render the flash message. Defaults to nil.
  • 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.

Functions

Attributes

  • flash (:map) (required) - the map of flash messages.
  • id (:string) - the optional id of flash container. Defaults to "toast-group".
  • corner (:atom) - the corner to display the toasts. Defaults to :bottom_right.
  • toast_class_fn (:any) - function to override the look of the toasts. Defaults to &LiveToast.toast_class_fn/1.

Attributes

  • f (:map) (required) - the map of flash messages.
  • corner (:atom) - the corner to display the toasts. Defaults to :bottom_right.
  • toast_class_fn (:any) - function to override the look of the toasts. Defaults to &LiveToast.toast_class_fn/1.

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.
  • target (:any) - the target for the phx-click event. Defaults to nil.
  • duration (:integer) - the time in milliseconds before the message is automatically dismissed. Defaults to 6000.
  • class_fn (:any) (required) - function to override the look of the toasts.
  • corner (:atom) (required) - the corner to display the toasts.
  • icon (:any) - the optional icon to render in the flash message. Defaults to nil.
  • action (:any) - the optional action to render in the flash message. Defaults to nil.
  • component (:any) - the optional component to render the flash message. Defaults to nil.
  • 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.