Update README.md (#766)

Updated documentation for dynamic components.
Close #764 .
This commit is contained in:
vb8448 2024-11-24 11:26:38 +01:00 committed by GitHub
parent 6dd8fce83c
commit 9f891453d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1085,6 +1085,20 @@ Instead, you can use **dynamic components**. Dynamic components are used in plac
{% endcomponent %}
```
or in case you use the `django_components.component_shorthand_formatter` tag formatter:
```django
{% dynamic is=component_name title="Cat Museu" %}
{% fill "content" %}
HELLO_FROM_SLOT_1
{% endfill %}
{% fill "sidebar" %}
HELLO_FROM_SLOT_2
{% endfill %}
{% enddynamic %}
```
These behave same way as regular components. You pass it the same args, kwargs, and slots as you would
to the component that you want to render.