PhoenixKitProjects.Web.Components.TabsStrip (PhoenixKitProjects v0.2.0)

Copy Markdown View Source

daisyUI tabs tabs-boxed segment switcher driven by the active value + a list of {value, label, icon} tuples. Used in AssignmentFormLive ("From library" / "Create new") and ready for reuse anywhere a small set of mutually-exclusive panes shares a single LV-managed assign.

Each tab is a <button phx-click> (no form submission) so the consumer's handle_event/3 controls the switch. The clicked tab's value is delivered as phx-value-value, so handlers match on %{"value" => v}.

Example

<.tabs_strip
  event="set_task_mode"
  active={@task_mode}
  tabs={[
    {"existing", gettext("From library"), "hero-rectangle-stack"},
    {"new", gettext("Create new"), "hero-plus"}
  ]}
/>

Summary

Functions

tabs_strip(assigns)

Attributes

  • event (:string) (required)
  • active (:string) (required)
  • tabs (:list) (required) - list of {value, label, icon} tuples.