lantern

Data display

Accordion & timeline

Disclose detail and show ordered history.

Accordion

WAI-ARIA disclosure groups with Fluxon 2.3.1's accordion/1 + accordion_item/1 composition API. Arrow keys move between headers; Enter and Space toggle the focused item.

Required open item

Single-open mode with prevent_all_closed keeps one answer available at all times.

Multiple open

multiple allows independent disclosure panels; icon={false} supports a custom visual treatment.

Fluxon-compatible container and item functions.
Independent, clean-room Lantern behavior.

API reference

Props and slots, introspected from the component.

accordion/1
Prop Type Default Description
animation_duration integer 300 Expand/collapse indicator transition duration in milliseconds.
class any nil Extra classes merged onto the accordion root.
controlled boolean false Server-driven value: `value` is truth, patches flow into the machine.
id string — Stable accordion id. A unique id is generated when omitted.
multiple boolean false Allow more than one item to be expanded at once.
on_change string nil Server event pushed on toggle (`lantern:accordion:set-value` replies).
on_change_client string nil Bubbling DOM CustomEvent dispatched on toggle.
prevent_all_closed boolean false Keep at least one enabled item expanded.
value list nil Expanded item ids for `controlled` mode (client mode ignores it).
Slots
:inner_block* One or more `accordion_item/1` components.
accordion_item/1
Prop Type Default Description
class any nil Extra classes merged onto the item root.
expanded boolean false Whether this item starts expanded.
icon boolean true Whether to render the built-in chevron.
id string — Stable item id used to connect its header and panel. A unique id is generated when omitted.
Slots
:header* Always-visible header content.
:panel* Expandable panel content.

Timeline

Vertical event sequence with a marker rail: timeline/1 plus timeline_item/1. Ordered list markup; pure server render, no JS hook.

Basic

Three items with status :done / :active / :pending plus label, at, and title. The state word always renders, so items stay legible in grayscale.

  1. enventory Deployed 2h ago
  2. foodfeed Deploying 40s
  3. skusync Queued just now

Statuses

One item per status, including :danger and :neutral.

  1. done Deployed
  2. active Deploying
  3. pending Queued
  4. danger Failed
  5. neutral Note

Collapsible detail

Deployment-log shape: title is the summary, :detail is the output. open starts expanded.

  1. enventory Deployed 2h ago
    ==> Building release
      Compiling 8 files (.ex)
      Generated enventory app
      ==> Deployed to production
  2. foodfeed Deploying 40s
    ==> Building release
      Compiling 12 files (.ex)
      Generated foodfeed app

Leading labels

label_position={:leading} on the container places timestamps in their own column; items inherit it.

  1. 2h ago
    enventory Deployed
  2. 40s
    foodfeed Deploying
  3. just now
    skusync Queued

Marker slot

:marker replaces the status dot or icon. Avatars and other custom glyphs are supported.

  1. PR #412 Merged 3h ago
  2. PR #418 Reviewing 12m
  3. PR #421 Queued just now

API reference

Props and slots, introspected from the component.

timeline/1
Prop Type Default Description
class any nil Extra classes merged onto the root element.
label_position inline | leading :inline Where items place `at`: `:inline` (default, inside content) or `:leading` (fixed column left of the marker rail). Inherited by items unless overridden.
Slots
:inner_block* One or more `timeline_item/1` children.
timeline_item/1
Prop Type Default Description
at string nil Preformatted timestamp or relative string; not formatted by the component.
class any nil Extra classes merged onto the item root.
icon string nil Optional lantern icon name rendered inside the marker instead of the plain dot.
label string nil State word (e.g. "Deployed", "Failed"). Set whenever status is meaningful.
label_position atom nil Where to place `at` (`:inline` or `:leading`). Inherits from the parent `timeline/1` when omitted; parent defaults to `:inline`.
open boolean false When `:detail` is present, whether the disclosure starts open.
status done | active | pending | danger | neutral :neutral Marker status; rendered as data-status for CSS coloring.
title string nil Primary line (e.g. app or event name).
Slots
:detail Collapsible body revealed under a native disclosure. When present, title/label/at become the summary.
:inner_block Optional body/description under the title.
:marker Custom marker content (e.g. an avatar). Replaces the status dot and `icon`. Sized by CSS so rail alignment is preserved.