|
1 | | -# `phx-` HTML attributes |
| 1 | +# phx-* HTML attributes |
2 | 2 |
|
3 | 3 | A summary of special HTML attributes used in Phoenix LiveView templates. |
4 | 4 | Each attribute is linked to its documentation for more details. |
@@ -58,13 +58,13 @@ Attribute values can be: |
58 | 58 |
|
59 | 59 | ### On `<form>` elements |
60 | 60 |
|
61 | | -| Attribute | Value | |
62 | | -|-------------------------------------------------------|----------------------------------------------------------------------------| |
63 | | -| [`phx-change`](../client/form-bindings.md) | Event name or [JS commands](../client/bindings.md#js-commands) | |
64 | | -| [`phx-submit`](../client/form-bindings.md) | Event name or [JS commands](../client/bindings.md#js-commands) | |
65 | | -| [`phx-auto-recover`](../client/form-bindings.md) | Event name, [JS commands](../client/bindings.md#js-commands) or `"ignore"` | |
66 | | -| [`phx-trigger-action`](../client/form-bindings.md) | `true` or `false` | |
67 | | -| [`phx-no-usage-tracking`](../client/form-bindings.md) | `true` or `false` | |
| 61 | +| Attribute | Value | |
| 62 | +|--------------------------------------------------------------------------------------------|----------------------------------------------------------------------------| |
| 63 | +| [`phx-change`](../client/form-bindings.md#form-events) | Event name or [JS commands](../client/bindings.md#js-commands) | |
| 64 | +| [`phx-submit`](../client/form-bindings.md#form-events) | Event name or [JS commands](../client/bindings.md#js-commands) | |
| 65 | +| [`phx-auto-recover`](../client/form-bindings.md#recovery-following-crashes-or-disconnects) | Event name, [JS commands](../client/bindings.md#js-commands) or `"ignore"` | |
| 66 | +| [`phx-trigger-action`](../client/form-bindings.md#submitting-the-form-action-over-http) | Presence (or `true`) disconnects the LiveView and submits the form | |
| 67 | +| [`phx-no-usage-tracking`](../client/form-bindings.md#error-feedback) | Presence (or `true`) opts-out of reporting unused form fields | |
68 | 68 |
|
69 | 69 | ### On `<button>` elements |
70 | 70 |
|
@@ -175,3 +175,10 @@ let liveSocket = new LiveSocket("/live", Socket, {hooks: Hooks}) |
175 | 175 | <link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} /> |
176 | 176 | <script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}></script> |
177 | 177 | ``` |
| 178 | + |
| 179 | +## Formatting & Syntax |
| 180 | + |
| 181 | +| Attribute | Value | |
| 182 | +|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------| |
| 183 | +| [`phx-no-format`](Phoenix.LiveView.HTMLFormatter.html#module-skip-formatting) | Presence (or `true`) skips automatic HEEx formatting for the element block | |
| 184 | +| [`phx-no-curly-interpolation`](Phoenix.Component.html#sigil_H/2-interpolating-blocks) | Presence (or `true`) disables `{...}` interpolation inside the element, requiring `<%= ... %>` syntax | |
0 commit comments