The host's preview of the draft, drawn while edit is off.
HEEx
<.switched_viewport
doc={@doc}
id="catalog-toggle-viewport"
toggle_id={@controls[:id]}
default_mode={@controls[:default_mode]}
>
<ConnieUI.CrdtEditor.preview_toggle id="catalog-preview-toggle" viewport_id="catalog-toggle-viewport" default_mode={:preview} />
</.switched_viewport>
Variant matrix
Every combination of one or two attributes, side by side.
Controls
Docs
Pill-shaped "Edit on/off" toggle meant to live in a page header.
Communicates with a sibling `previewable_viewport` via `send_update`. The
viewport owns the canonical mode state; this toggle mirrors it and lets
the user flip it.
| Attribute | Type | Default | Description |
|---|---|---|---|
| No data found. | |||
| id * | :string |
|
|
| viewport_id * | :string |
|
|
| default_mode * | :atom |
:preview | :edit
|
|