diff --git a/src/LiveComponent/doc/index.rst b/src/LiveComponent/doc/index.rst index 2e691a42025..5ae711353bd 100644 --- a/src/LiveComponent/doc/index.rst +++ b/src/LiveComponent/doc/index.rst @@ -42,7 +42,7 @@ A real-time product search component might look like this:: } } -.. code-block:: html+twig +.. code-block:: twig {# templates/components/ProductSearch.html.twig #} {# for the Live Component to work, there must be a single root element @@ -2236,7 +2236,7 @@ Defer Rendering If a component is heavy to render, you can defer rendering it until after the page has loaded. To do this, add the ``defer`` option: -.. code-block:: html+twig +.. code-block:: twig {{ component('SomeHeavyComponent', { defer: true }) }} @@ -2252,13 +2252,13 @@ real component once the page has loaded. To add some loading text before the real component is loaded, use the ``loading-template`` option to point to a template: -.. code-block:: html+twig +.. code-block:: twig {{ component('SomeHeavyComponent', { defer: true, loading-template: 'spinning-wheel.html.twig' }) }} Or override the ``loadingContent`` block: -.. code-block:: html+twig +.. code-block:: twig {% component SomeHeavyComponent with { defer: true }) }} {% block loadingContent %}Loading...{% endblock %} @@ -2266,7 +2266,7 @@ Or override the ``loadingContent`` block: To change the initial tag from a ``div`` to something else, use the ``loading-tag`` option: -.. code-block:: html+twig +.. code-block:: twig {{ component('SomeHeavyComponent', { defer: true, loading-tag: 'span' }) }} @@ -2282,11 +2282,11 @@ This is useful for components that are far down the page and are not needed unti To use this, add the ``lazy`` attribute to your component: -.. code-block:: html+twig +.. code-block:: twig {{ component('SomeHeavyComponent', { lazy: true }) }} -.. code-block:: html+twig +.. code-block:: twig