Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
smnandre committed Feb 19, 2024
1 parent 6022726 commit 4b0e79c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/LiveComponent/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ A real-time product search component might look like this::
}
}

.. code-block:: html+twig
.. code-block:: twig

Check failure on line 45 in src/LiveComponent/doc/index.rst

View workflow job for this annotation

GitHub Actions / DOCtor-RST

Please use "html+twig" instead of "twig"
{# templates/components/ProductSearch.html.twig #}
{# for the Live Component to work, there must be a single root element
Expand Down Expand Up @@ -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 }) }}
Expand All @@ -2252,21 +2252,21 @@ 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 %}
{{ end_component() }}
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' }) }}
Expand All @@ -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

Check failure on line 2289 in src/LiveComponent/doc/index.rst

View workflow job for this annotation

GitHub Actions / DOCtor-RST

Please use "html+twig" instead of "twig"
<twig:Acme foo="bar" lazy />
Expand Down

0 comments on commit 4b0e79c

Please sign in to comment.