You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/helpers.md
+30-2
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ If you're rendering a Turbo Stream inside a your Blade files, you may use the `<
60
60
61
61
Just like in the Turbo Frames' `:id` prop, the `:target` prop of the Turbo Stream component accepts a string, a model instance, or an array to resolve the DOM ID using the `dom_id()` function.
62
62
63
-
### The `<x-turbo::refreshes-with>` Blade Component
63
+
### The `<x-turbo::refresh-method method="morph" />` Blade Component
64
64
65
65
We can configure which update method Turbo should so to update the document:
66
66
@@ -69,14 +69,42 @@ We can configure which update method Turbo should so to update the document:
69
69
|`replace`| Updates the entire body of the document on Turbo Visits |
70
70
|`morph`| Uses DOM morphing to update the document instead of replacing everything |
### The `<x-turbo::refresh-scroll scroll="preserve" />` Blade Component
85
+
72
86
You can also configure the scroll behavior on Turbo:
73
87
74
88
| Behavior | Description |
75
89
|---|---|
76
90
|`reset`| Resets the scroll position to the top, mimicking for the browser handles new page visits |
77
91
|`preserve`| Preserves the current scroll position (usually results in a better UX when used with the `morph` method) |
78
92
79
-
You may use the `<x-turbo::refreshes-with />` component in your main layout's `<head>` tag or on specific pages to configure how Turbo should update the page. Here's an example:
### The `<x-turbo::refreshes-with>` Blade Component
106
+
107
+
You may configure both the refresh method and scroll behavior using the `<x-turbo::refreshes-with />` component in your main layout's `<head>` tag or on specific pages to configure how Turbo should update the page. Here's an example:
0 commit comments