Collapsible right-hand panel plus a toggle that remembers open/closed in
localStorage.
<.side_panel_toggle
id="tickets-panel-toggle"
panel_id="tickets-panel"
panel_key="tickets"
open={@panel_open}
phx-click="toggle_panel"
/>
<.side_panel id="tickets-panel" open={@panel_open} aria-label="Project panel">
<.inspector>…</.inspector>
</.side_panel>The toggle is a button/1 with label/kbd plus the persist attrs. It owns
the LanternSidePanel hook. On mount, with no stored choice, the panel
defaults open at ≥1280px and closed below. After that the viewer's last
choice wins. The LiveView still owns open — the hook pushes set_panel
(override with event) when the stored value disagrees with aria-pressed.
Not resizable. Not the app-shell sidebar (LanternSidebar).
Summary
Functions
Attributes
id(:string) (required) - DOM id; referenced by the toggle's aria-controls.open(:boolean) - Whether the panel is shown. Defaults tofalse.class(:any) - Extra classes merged onto the panel. Defaults tonil.- Global attributes are accepted. Arbitrary HTML/
phx-*attributes passed through.
Slots
inner_block(required) - Panel body.
Attributes
id(:string) (required) - DOM id for the hook.panel_id(:string) (required) - id of theside_panel/1this toggle controls.panel_key(:string) (required) - localStorage key suffix, e.g.tickets. Stored aslui-side-panel:<key>.open(:boolean) - Current open state; mirrored to aria-pressed. Defaults tofalse.event(:string) - LiveView event the hook pushes on restore:%{open: boolean}. Defaults to"set_panel".persist_event(:string) - Optional server event name the hook listens to for an explicit persist. Defaults to"side_panel".label(:string) - Accessible name and tooltip. Defaults to"Toggle panel".kbd(:string) - Optional keyboard hint in the tooltip. Defaults tonil.variant(:string) - Defaults to"outline". Must be one of"ghost","outline", or"primary".size(:string) - Defaults to"md". Must be one of"sm","md", or"lg".class(:any) - Extra classes merged onto the button. Defaults tonil.- Global attributes are accepted. Arbitrary HTML/
phx-*attributes passed through.
Slots
inner_block- Override the default panel-split glyph.