Corex.Flash.Info (Corex v0.1.1)

View Source

Defaults for Phoenix :info flashes shown by toast_group/1.

FieldTypeRole
titleString.t()Toast title; body text comes from the flash message
type:info | :success | :errorZag toast type / styling
durationinteger() | :infinityVisible time in ms, or no auto-dismiss

Example

<.toast_group
  id="layout-toast"
  class="toast"
  flash={@flash}
  flash_info={%Corex.Flash.Info{title: "Success", type: :success, duration: 5000}}
>
  <:loading>
    <.heroicon name="hero-arrow-path" />
  </:loading>
  <:close>
    <.heroicon name="hero-x-mark" />
  </:close>
</.toast_group>

Summary

Types

t()

@type t() :: %Corex.Flash.Info{
  duration: integer() | :infinity,
  title: String.t(),
  type: :info | :success | :error
}