Skip to content

Commit 4a498b0

Browse files
authored
Update index.rst
1 parent 2cae524 commit 4a498b0

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

src/Turbo/doc/index.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,44 @@ a Turbo Frame, and retrieve the ID of this frame::
250250
}
251251
}
252252

253+
<twig:Turbo:Frame> Twig Component
254+
^^^^^^^^^^^^^
255+
256+
.. versionadded:: 2.22
257+
258+
The `<twig:Turbo:Frame>` Twig Component was added in Turbo 2.22.
259+
260+
Simple example:
261+
262+
.. code-block:: html+twig
263+
264+
<twig:Turbo:Frame id="the_frame_id" />
265+
266+
{# renders as: #}
267+
<turbo-frame id="the_frame_id"></turbo-frame>
268+
269+
With a HTML attribute:
270+
271+
.. code-block:: html+twig
272+
273+
<twig:Turbo:Frame id="the_frame_id" loading="lazy" src="{{ path('block') }}" />
274+
275+
{# renders as: #}
276+
<turbo-frame id="the_frame_id" loading="lazy" src="https://example.com/block"></turbo-frame>
277+
278+
With content:
279+
280+
.. code-block:: html+twig
281+
282+
<twig:Turbo:Frame id="the_frame_id" src="{{ path('block') }}">
283+
A placeholder.
284+
</twig:Turbo:Frame>
285+
286+
{# renders as: #}
287+
<turbo-frame id="the_frame_id" src="https://example.com/block">
288+
A placeholder.
289+
</turbo-frame>
290+
253291
Writing Tests
254292
^^^^^^^^^^^^^
255293

0 commit comments

Comments
 (0)