LanternUI.Components.GroupBand (LanternUI v0.8.2)

Copy Markdown View Source

Tinted full-width group header: chevron · glyph · name · count · trailing action (the +).

<.group_band name="In progress" count={12} group="tickets:in_progress">
  <:glyph><.status_glyph status={:in_progress} /></:glyph>
  <:action navigate="/tickets/new?status=in_progress" label="New ticket in In progress">
    <.icon name="plus" />
  </:action>
</.group_band>

<.group_band name="Done" count={40} collapsed patch="/tickets?show_done=1">
  <:glyph><.status_glyph status={:done} /></:glyph>
</.group_band>

Pass group (and no navigate/patch/href) to make the name row a client-side collapse control: data-lantern-collapse plus aria-expanded. Matching siblings carry data-lantern-group (see list_row/1). Put data-lantern-persist on the band with the same key so the collapsed set survives LiveView patches — see docs/behaviours.md.

A collapsed band with navigate/patch/href stays a link (chevron points right). Interactive bands always render the down chevron; CSS rotates it when [data-collapsed] is set so a client toggle needs no re-render.

Summary

Functions

group_band(assigns)

Attributes

  • name (:string) (required) - Group label (status name, section title).
  • count (:any) - Optional count shown after the name. Defaults to nil.
  • collapsed (:boolean) - When true, chevron points right. Defaults to false.
  • group (:string) - Collapse key. Renders the name row as a button when there is no link target. Defaults to nil.
  • navigate (:string) - LiveView navigate on the name row. Defaults to nil.
  • patch (:string) - LiveView patch on the name row. Defaults to nil.
  • href (:any) - Href on the name row. Defaults to nil.
  • class (:any) - Extra classes merged onto the band. Defaults to nil.
  • Global attributes are accepted. Arbitrary HTML/phx-* attributes passed through.

Slots

  • glyph - Leading glyph (status circle, etc.).
  • action - Trailing control, typically a + that files into this group. Accepts attributes:
    • navigate (:string)
    • patch (:string)
    • href (:any)
    • label (:string)
    • class (:any)