OctantisWeb.Components.AppBridge.Toast (octantis v0.2.0)

View Source

Renders Shopify toast notices.

Uses ShopifyToastHook to integrate with AppBridge

Be sure to load in AppBridge js in your template (you can use <OctantisWeb.Components.Head.javascript /> to do so).

Examples

<.toast kind={:info} flash={@flash} id="toastinfo" />
<.toast kind={:error} flash={@flash} id="toasterror" />

See

Summary

Functions

Attributes

  • id (:string) - the optional id of toast container. Defaults to "toast".
  • flash (:map) - the map of flash messages to display. Defaults to %{}.
  • kind (:atom) - used for styling and flash lookup.Must be one of :info, or :error.
  • phx_hook (:string) - The hook to handle onDismiss. Defaults to "ShopifyToastHook".

Functions

toast(assigns)

Attributes

  • id (:string) - the optional id of toast container. Defaults to "toast".
  • flash (:map) - the map of flash messages to display. Defaults to %{}.
  • kind (:atom) - used for styling and flash lookup.Must be one of :info, or :error.
  • phx_hook (:string) - The hook to handle onDismiss. Defaults to "ShopifyToastHook".