MailglassAdmin.Preview.Tabs (MailglassAdmin v1.0.0)

Copy Markdown View Source

Tabs function component: HTML · Text · Raw · Headers tab strip plus the matching content pane per 05-UI-SPEC lines 220-228 + 294-352.

  • HTML (default) — sandboxed iframe with srcdoc={@html_body}. Width driven by @device_width (375 / 768 / 1024). phx-update="ignore"
    • nonce-based id forces a fresh iframe on every re-render so email CSS never bleeds between scenarios.
  • Text<pre class="font-mono text-xs"> with @text_body.
  • Raw<pre> with the RFC 5322 envelope string.
  • Headers — two-column table: header name (mono, bold) + value.

Tab strip uses role="tablist" / role="tab" / aria-selected per 05-UI-SPEC Accessibility Interactions lines 509-514.

Boundary classification: submodule auto-classifies into the MailglassAdmin root boundary.

Summary

Functions

Renders the tab strip + the active tab's content pane.

Functions

tab_content(assigns)

Attributes

  • active_tab (:atom) (required)
  • html_body (:string) - Defaults to "".
  • text_body (:string) - Defaults to "".
  • raw_envelope (:string) - Defaults to "".
  • headers (:list) - Defaults to [].
  • device_width (:integer) (required)
  • render_nonce (:integer) (required)

tabs(assigns)

(since 0.1.0)

Renders the tab strip + the active tab's content pane.

Attributes

  • active_tab (:atom) - Defaults to :html. Must be one of :html, :text, :raw, or :headers.
  • html_body (:string) - Defaults to "".
  • text_body (:string) - Defaults to "".
  • raw_envelope (:string) - Defaults to "".
  • headers (:list) - Defaults to [].
  • device_width (:integer) - Defaults to 768.
  • render_nonce (:integer) (required)