Skip to content

Commit 7654124

Browse files
authored
Add phx-no-format and phx-no-curly-interpolation to cheatsheet (#4065)
- Update heading to remove backticks (inline code elements looks bad in current ExDoc version) - Update form-related attribute links to point to specific sections - Briefly describe `phx-trigger-action` and `phx-no-usage-tracking` inline
1 parent 98088bc commit 7654124

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

guides/cheatsheets/html-attrs.cheatmd

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `phx-` HTML attributes
1+
# phx-* HTML attributes
22

33
A summary of special HTML attributes used in Phoenix LiveView templates.
44
Each attribute is linked to its documentation for more details.
@@ -58,13 +58,13 @@ Attribute values can be:
5858

5959
### On `<form>` elements
6060

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 |
6868

6969
### On `<button>` elements
7070

@@ -175,3 +175,10 @@ let liveSocket = new LiveSocket("/live", Socket, {hooks: Hooks})
175175
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
176176
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}></script>
177177
```
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

Comments
 (0)