# `MailglassAdmin.Preview.Tabs`
[🔗](https://github.com/szTheory/mailglass/blob/v1.0.0/lib/mailglass_admin/preview/tabs.ex#L1)

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.

# `tab_content`

## 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`
*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)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
