Skip to content

Commit c160f73

Browse files
authored
Update index.rst
1 parent de15540 commit c160f73

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/Turbo/doc/index.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,37 @@ With content:
288288
A placeholder.
289289
</turbo-frame>
290290

291+
Minimal layout for Turbo Frames
292+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
293+
294+
.. versionadded:: 2.22
295+
296+
The minimal layout for Turbo Frames was added in Turbo 2.22.
297+
298+
Since Turbo does not need the content outside of the frame, reducing the amount that is rendered can be a useful optimisation.
299+
300+
.. code-block:: html+twig
301+
302+
{% extends '@Turbo/frame.html.twig' %}
303+
304+
{% block body %}
305+
<turbo-frame id="frame_id">
306+
Content of the Turbo Frame
307+
</turbo-frame>
308+
{% endblock %}
309+
310+
{# renders as: #}
311+
<!DOCTYPE html>
312+
<html>
313+
<head>
314+
</head>
315+
<body>
316+
<turbo-frame id="frame_id">
317+
Content of the Turbo Frame
318+
</turbo-frame>
319+
</body>
320+
</html>
321+
291322
Writing Tests
292323
^^^^^^^^^^^^^
293324

0 commit comments

Comments
 (0)