PhoenixKitProjects.Web.Components.EmptyState (PhoenixKitProjects v0.3.0)

Copy Markdown View Source

Centered icon + heading + optional sub-text + optional CTA. Used in every list view ("No projects yet.", "No templates yet.", "No tasks assigned to you right now.").

Slots

  • :cta — optional call-to-action element (typically a <.link> or button) rendered below the description.

Example

<.empty_state icon="hero-clipboard-document-list" title="No projects yet.">
  <:cta>
    <.smart_link
      navigate={Paths.new_project()}
      emit={{PhoenixKitProjects.Web.ProjectFormLive, %{"live_action" => "new"}}}
      embed_mode={@embed_mode}
      class="btn btn-primary btn-xs"
    >
      <.icon name="hero-plus" class="w-3.5 h-3.5" /> New project
    </.smart_link>
  </:cta>
</.empty_state>

Summary

Functions

empty_state(assigns)

Attributes

  • icon (:string) - Defaults to "hero-clipboard-document-list".
  • title (:string) (required)
  • description (:string) - Defaults to nil.
  • class (:string) - Defaults to "py-16".

Slots

  • cta