HEEx
<div class="w-md">
<ConnieUI.Cards.option_card field={@form[:forward]}>
Forwarding to Accounting enabled
<:description>Sent on once fully signed.</:description>
<:off_title>Forwarding to Accounting disabled</:off_title>
<:off_description>Not sent on.</:off_description>
<:expanded>
<ConnieUI.Forms.text field={@form[:comment]} placeholder="Optional comment" />
</:expanded>
</ConnieUI.Cards.option_card>
</div>
Controls
Set by the example
field class
Docs
A settings card whose toggle reveals more when it is on.
For an option that is off by default and needs a sentence of explanation
either way, plus fields that only make sense once it is enabled. The card
sits on the secondary surface, like the cards in the template editor's signing
workflow.
## Example
<ConnieUI.Cards.option_card field={@form[:forward_to_accounting]}>
Forwarding to Accounting enabled
<:description>Sent on once fully signed.</:description>
<:off_title>Forwarding to Accounting disabled</:off_title>
<:off_description>Not sent on.</:off_description>
<:expanded>
<ConnieUI.Forms.text field={@form[:comment]} placeholder="Optional comment" />
</:expanded>
</ConnieUI.Cards.option_card>
| Attribute | Type | Default | Description |
|---|---|---|---|
| No data found. | |||
| field * | {:struct, Phoenix.HTML.FormField} |
|
|
| class | :any | nil |
|
| form | :string | nil |
the id of the `<form>` the toggle belongs to, when the card sits outside it
|
| Slot | Slot attributes | Description |
|---|---|---|
| No data found. | ||
| inner_block * | title shown when the toggle is on | |
| :description | sub-line shown when the toggle is on | |
| :off_title | title shown when off; falls back to the on title | |
| :off_description | sub-line shown when off; falls back to the on description | |
| :expanded | revealed below the toggle while it is on | |