diff --git a/dev/assets/images/social/README.png b/dev/assets/images/social/README.png index 08c48248..33910f56 100644 Binary files a/dev/assets/images/social/README.png and b/dev/assets/images/social/README.png differ diff --git a/dev/assets/images/social/SUMMARY.png b/dev/assets/images/social/SUMMARY.png index c0f602c8..452934e9 100644 Binary files a/dev/assets/images/social/SUMMARY.png and b/dev/assets/images/social/SUMMARY.png differ diff --git a/dev/assets/images/social/concepts/advanced/authoring_component_libraries.png b/dev/assets/images/social/concepts/advanced/authoring_component_libraries.png index f2c15b22..ab0dca9f 100644 Binary files a/dev/assets/images/social/concepts/advanced/authoring_component_libraries.png and b/dev/assets/images/social/concepts/advanced/authoring_component_libraries.png differ diff --git a/dev/assets/images/social/concepts/advanced/component_registry.png b/dev/assets/images/social/concepts/advanced/component_registry.png index e788c2b2..b474f448 100644 Binary files a/dev/assets/images/social/concepts/advanced/component_registry.png and b/dev/assets/images/social/concepts/advanced/component_registry.png differ diff --git a/dev/assets/images/social/concepts/advanced/hooks.png b/dev/assets/images/social/concepts/advanced/hooks.png index 91af4006..13c12a05 100644 Binary files a/dev/assets/images/social/concepts/advanced/hooks.png and b/dev/assets/images/social/concepts/advanced/hooks.png differ diff --git a/dev/assets/images/social/concepts/advanced/html_tragments.png b/dev/assets/images/social/concepts/advanced/html_tragments.png index 62bc78e5..252bf93e 100644 Binary files a/dev/assets/images/social/concepts/advanced/html_tragments.png and b/dev/assets/images/social/concepts/advanced/html_tragments.png differ diff --git a/dev/assets/images/social/concepts/advanced/provide_inject.png b/dev/assets/images/social/concepts/advanced/provide_inject.png index efacef18..61544a6e 100644 Binary files a/dev/assets/images/social/concepts/advanced/provide_inject.png and b/dev/assets/images/social/concepts/advanced/provide_inject.png differ diff --git a/dev/assets/images/social/concepts/advanced/rendering_js_css.png b/dev/assets/images/social/concepts/advanced/rendering_js_css.png index 696bc654..96685c9b 100644 Binary files a/dev/assets/images/social/concepts/advanced/rendering_js_css.png and b/dev/assets/images/social/concepts/advanced/rendering_js_css.png differ diff --git a/dev/assets/images/social/concepts/advanced/tag_formatter.png b/dev/assets/images/social/concepts/advanced/tag_formatter.png index 1c2215cf..8b3194a3 100644 Binary files a/dev/assets/images/social/concepts/advanced/tag_formatter.png and b/dev/assets/images/social/concepts/advanced/tag_formatter.png differ diff --git a/dev/assets/images/social/concepts/advanced/typing_and_validation.png b/dev/assets/images/social/concepts/advanced/typing_and_validation.png index 94e0a7ed..83a17458 100644 Binary files a/dev/assets/images/social/concepts/advanced/typing_and_validation.png and b/dev/assets/images/social/concepts/advanced/typing_and_validation.png differ diff --git a/dev/assets/images/social/concepts/fundamentals/access_component_input.png b/dev/assets/images/social/concepts/fundamentals/access_component_input.png index f5fcd06e..47c79984 100644 Binary files a/dev/assets/images/social/concepts/fundamentals/access_component_input.png and b/dev/assets/images/social/concepts/fundamentals/access_component_input.png differ diff --git a/dev/assets/images/social/concepts/fundamentals/autodiscovery.png b/dev/assets/images/social/concepts/fundamentals/autodiscovery.png index 72ebc202..b763f0d7 100644 Binary files a/dev/assets/images/social/concepts/fundamentals/autodiscovery.png and b/dev/assets/images/social/concepts/fundamentals/autodiscovery.png differ diff --git a/dev/assets/images/social/concepts/fundamentals/component_context_scope.png b/dev/assets/images/social/concepts/fundamentals/component_context_scope.png index 1fb6c412..4cf929b1 100644 Binary files a/dev/assets/images/social/concepts/fundamentals/component_context_scope.png and b/dev/assets/images/social/concepts/fundamentals/component_context_scope.png differ diff --git a/dev/assets/images/social/concepts/fundamentals/components_as_views.png b/dev/assets/images/social/concepts/fundamentals/components_as_views.png index c052b2e7..cc9b2de8 100644 Binary files a/dev/assets/images/social/concepts/fundamentals/components_as_views.png and b/dev/assets/images/social/concepts/fundamentals/components_as_views.png differ diff --git a/dev/assets/images/social/concepts/fundamentals/components_in_python.png b/dev/assets/images/social/concepts/fundamentals/components_in_python.png index 5bb61105..22e59015 100644 Binary files a/dev/assets/images/social/concepts/fundamentals/components_in_python.png and b/dev/assets/images/social/concepts/fundamentals/components_in_python.png differ diff --git a/dev/assets/images/social/concepts/fundamentals/defining_js_css_html_files.png b/dev/assets/images/social/concepts/fundamentals/defining_js_css_html_files.png index 205321ce..20b9e4bb 100644 Binary files a/dev/assets/images/social/concepts/fundamentals/defining_js_css_html_files.png and b/dev/assets/images/social/concepts/fundamentals/defining_js_css_html_files.png differ diff --git a/dev/assets/images/social/concepts/fundamentals/html_attributes.png b/dev/assets/images/social/concepts/fundamentals/html_attributes.png index 994ce8b9..43ce2b88 100644 Binary files a/dev/assets/images/social/concepts/fundamentals/html_attributes.png and b/dev/assets/images/social/concepts/fundamentals/html_attributes.png differ diff --git a/dev/assets/images/social/concepts/fundamentals/single_file_components.png b/dev/assets/images/social/concepts/fundamentals/single_file_components.png index 5b0a7c81..3732c79c 100644 Binary files a/dev/assets/images/social/concepts/fundamentals/single_file_components.png and b/dev/assets/images/social/concepts/fundamentals/single_file_components.png differ diff --git a/dev/assets/images/social/concepts/fundamentals/slots.png b/dev/assets/images/social/concepts/fundamentals/slots.png index f20a8a87..e2c5d277 100644 Binary files a/dev/assets/images/social/concepts/fundamentals/slots.png and b/dev/assets/images/social/concepts/fundamentals/slots.png differ diff --git a/dev/assets/images/social/concepts/fundamentals/subclassing_components.png b/dev/assets/images/social/concepts/fundamentals/subclassing_components.png index 15636cf9..76e4ee21 100644 Binary files a/dev/assets/images/social/concepts/fundamentals/subclassing_components.png and b/dev/assets/images/social/concepts/fundamentals/subclassing_components.png differ diff --git a/dev/assets/images/social/concepts/fundamentals/template_tag_syntax.png b/dev/assets/images/social/concepts/fundamentals/template_tag_syntax.png index fb816637..14d48c1c 100644 Binary files a/dev/assets/images/social/concepts/fundamentals/template_tag_syntax.png and b/dev/assets/images/social/concepts/fundamentals/template_tag_syntax.png differ diff --git a/dev/assets/images/social/getting_started/adding_js_and_css.png b/dev/assets/images/social/getting_started/adding_js_and_css.png index 9d8e1623..cede67d4 100644 Binary files a/dev/assets/images/social/getting_started/adding_js_and_css.png and b/dev/assets/images/social/getting_started/adding_js_and_css.png differ diff --git a/dev/assets/images/social/getting_started/adding_slots.png b/dev/assets/images/social/getting_started/adding_slots.png index a5f00b34..189dc65a 100644 Binary files a/dev/assets/images/social/getting_started/adding_slots.png and b/dev/assets/images/social/getting_started/adding_slots.png differ diff --git a/dev/assets/images/social/getting_started/components_in_templates.png b/dev/assets/images/social/getting_started/components_in_templates.png index 2db92eac..52152c08 100644 Binary files a/dev/assets/images/social/getting_started/components_in_templates.png and b/dev/assets/images/social/getting_started/components_in_templates.png differ diff --git a/dev/assets/images/social/getting_started/parametrising_components.png b/dev/assets/images/social/getting_started/parametrising_components.png index dca802e6..ab8b419d 100644 Binary files a/dev/assets/images/social/getting_started/parametrising_components.png and b/dev/assets/images/social/getting_started/parametrising_components.png differ diff --git a/dev/assets/images/social/getting_started/your_first_component.png b/dev/assets/images/social/getting_started/your_first_component.png index cc9a1c83..88918ccf 100644 Binary files a/dev/assets/images/social/getting_started/your_first_component.png and b/dev/assets/images/social/getting_started/your_first_component.png differ diff --git a/dev/assets/images/social/guides/devguides/dependency_mgmt.png b/dev/assets/images/social/guides/devguides/dependency_mgmt.png index f5b00faa..a745c934 100644 Binary files a/dev/assets/images/social/guides/devguides/dependency_mgmt.png and b/dev/assets/images/social/guides/devguides/dependency_mgmt.png differ diff --git a/dev/assets/images/social/guides/devguides/slot_rendering.png b/dev/assets/images/social/guides/devguides/slot_rendering.png index 887a429c..c0d8d9d6 100644 Binary files a/dev/assets/images/social/guides/devguides/slot_rendering.png and b/dev/assets/images/social/guides/devguides/slot_rendering.png differ diff --git a/dev/assets/images/social/guides/devguides/slots_and_blocks.png b/dev/assets/images/social/guides/devguides/slots_and_blocks.png index 44eb6ca7..f60ddc57 100644 Binary files a/dev/assets/images/social/guides/devguides/slots_and_blocks.png and b/dev/assets/images/social/guides/devguides/slots_and_blocks.png differ diff --git a/dev/assets/images/social/guides/setup/dev_server_setup.png b/dev/assets/images/social/guides/setup/dev_server_setup.png index d640c6ab..0fa8be9b 100644 Binary files a/dev/assets/images/social/guides/setup/dev_server_setup.png and b/dev/assets/images/social/guides/setup/dev_server_setup.png differ diff --git a/dev/assets/images/social/guides/setup/logging_and_debugging.png b/dev/assets/images/social/guides/setup/logging_and_debugging.png index 09270916..c01c3af2 100644 Binary files a/dev/assets/images/social/guides/setup/logging_and_debugging.png and b/dev/assets/images/social/guides/setup/logging_and_debugging.png differ diff --git a/dev/assets/images/social/guides/setup/syntax_highlight.png b/dev/assets/images/social/guides/setup/syntax_highlight.png index 9dfcf0ed..fa9a216e 100644 Binary files a/dev/assets/images/social/guides/setup/syntax_highlight.png and b/dev/assets/images/social/guides/setup/syntax_highlight.png differ diff --git a/dev/assets/images/social/migrating_from_safer_staticfiles.png b/dev/assets/images/social/migrating_from_safer_staticfiles.png index c68a1d6b..be6f9886 100644 Binary files a/dev/assets/images/social/migrating_from_safer_staticfiles.png and b/dev/assets/images/social/migrating_from_safer_staticfiles.png differ diff --git a/dev/assets/images/social/overview/code_of_conduct.png b/dev/assets/images/social/overview/code_of_conduct.png index 2a214864..23ff0de6 100644 Binary files a/dev/assets/images/social/overview/code_of_conduct.png and b/dev/assets/images/social/overview/code_of_conduct.png differ diff --git a/dev/assets/images/social/overview/community.png b/dev/assets/images/social/overview/community.png index b772bee4..1c2b35e2 100644 Binary files a/dev/assets/images/social/overview/community.png and b/dev/assets/images/social/overview/community.png differ diff --git a/dev/assets/images/social/overview/compatibility.png b/dev/assets/images/social/overview/compatibility.png index 16fc294f..f07094a0 100644 Binary files a/dev/assets/images/social/overview/compatibility.png and b/dev/assets/images/social/overview/compatibility.png differ diff --git a/dev/assets/images/social/overview/contributing.png b/dev/assets/images/social/overview/contributing.png index 7810b006..c1a64201 100644 Binary files a/dev/assets/images/social/overview/contributing.png and b/dev/assets/images/social/overview/contributing.png differ diff --git a/dev/assets/images/social/overview/development.png b/dev/assets/images/social/overview/development.png index 2ef599cc..94c9c80f 100644 Binary files a/dev/assets/images/social/overview/development.png and b/dev/assets/images/social/overview/development.png differ diff --git a/dev/assets/images/social/overview/installation.png b/dev/assets/images/social/overview/installation.png index e4d50ae8..0830ef4e 100644 Binary files a/dev/assets/images/social/overview/installation.png and b/dev/assets/images/social/overview/installation.png differ diff --git a/dev/assets/images/social/overview/license.png b/dev/assets/images/social/overview/license.png index 37aa6408..f27981ee 100644 Binary files a/dev/assets/images/social/overview/license.png and b/dev/assets/images/social/overview/license.png differ diff --git a/dev/assets/images/social/overview/security_notes.png b/dev/assets/images/social/overview/security_notes.png index bf27ec70..4d1ab05d 100644 Binary files a/dev/assets/images/social/overview/security_notes.png and b/dev/assets/images/social/overview/security_notes.png differ diff --git a/dev/assets/images/social/overview/welcome.png b/dev/assets/images/social/overview/welcome.png index 08c48248..33910f56 100644 Binary files a/dev/assets/images/social/overview/welcome.png and b/dev/assets/images/social/overview/welcome.png differ diff --git a/dev/assets/images/social/reference/api.png b/dev/assets/images/social/reference/api.png index f233f3fe..40d2e508 100644 Binary files a/dev/assets/images/social/reference/api.png and b/dev/assets/images/social/reference/api.png differ diff --git a/dev/assets/images/social/reference/commands.png b/dev/assets/images/social/reference/commands.png index 6758a5a7..e1086a8e 100644 Binary files a/dev/assets/images/social/reference/commands.png and b/dev/assets/images/social/reference/commands.png differ diff --git a/dev/assets/images/social/reference/components.png b/dev/assets/images/social/reference/components.png index 97559c4a..05b568c7 100644 Binary files a/dev/assets/images/social/reference/components.png and b/dev/assets/images/social/reference/components.png differ diff --git a/dev/assets/images/social/reference/exceptions.png b/dev/assets/images/social/reference/exceptions.png index ff1178ca..10fe7cb2 100644 Binary files a/dev/assets/images/social/reference/exceptions.png and b/dev/assets/images/social/reference/exceptions.png differ diff --git a/dev/assets/images/social/reference/middlewares.png b/dev/assets/images/social/reference/middlewares.png index 2528d903..d5129cba 100644 Binary files a/dev/assets/images/social/reference/middlewares.png and b/dev/assets/images/social/reference/middlewares.png differ diff --git a/dev/assets/images/social/reference/settings.png b/dev/assets/images/social/reference/settings.png index 42dd44c7..90ed5e23 100644 Binary files a/dev/assets/images/social/reference/settings.png and b/dev/assets/images/social/reference/settings.png differ diff --git a/dev/assets/images/social/reference/tag_formatters.png b/dev/assets/images/social/reference/tag_formatters.png index 1c2215cf..8b3194a3 100644 Binary files a/dev/assets/images/social/reference/tag_formatters.png and b/dev/assets/images/social/reference/tag_formatters.png differ diff --git a/dev/assets/images/social/reference/template_tags.png b/dev/assets/images/social/reference/template_tags.png index 0b9e2b7a..0d0f9e2e 100644 Binary files a/dev/assets/images/social/reference/template_tags.png and b/dev/assets/images/social/reference/template_tags.png differ diff --git a/dev/assets/images/social/reference/template_vars.png b/dev/assets/images/social/reference/template_vars.png index 72f07615..e7e892d1 100644 Binary files a/dev/assets/images/social/reference/template_vars.png and b/dev/assets/images/social/reference/template_vars.png differ diff --git a/dev/assets/images/social/reference/urls.png b/dev/assets/images/social/reference/urls.png index 19550f2f..5715721a 100644 Binary files a/dev/assets/images/social/reference/urls.png and b/dev/assets/images/social/reference/urls.png differ diff --git a/dev/assets/images/social/release_notes.png b/dev/assets/images/social/release_notes.png index c9db8348..27e3a706 100644 Binary files a/dev/assets/images/social/release_notes.png and b/dev/assets/images/social/release_notes.png differ diff --git a/dev/reference/template_tags/index.html b/dev/reference/template_tags/index.html index 39d48af2..e9ee3a75 100644 --- a/dev/reference/template_tags/index.html +++ b/dev/reference/template_tags/index.html @@ -1,7 +1,7 @@ Template tags - Django-Components
Skip to content

Template tagsยค

All following template tags are defined in

django_components.templatetags.component_tags

Import as

{% load component_tags %}
 

componentยค

{% component [arg, ...] **kwargs [only] %}
 {% endcomponent %}
-

See source code

Renders one of the components that was previously registered with @register() decorator.

Args:

  • name (str, required): Registered name of the component to render
  • All other args and kwargs are defined based on the component itself.

If you defined a component "my_table"

from django_component import Component, register
+

See source code

Renders one of the components that was previously registered with @register() decorator.

Args:

  • name (str, required): Registered name of the component to render
  • All other args and kwargs are defined based on the component itself.

If you defined a component "my_table"

from django_component import Component, register
 
 @register("my_table")
 class MyTable(Component):
@@ -39,10 +39,10 @@
 {% endcomponent %}
 

Isolating componentsยค

By default, components behave similarly to Django's {% include %}, and the template inside the component has access to the variables defined in the outer template.

You can selectively isolate a component, using the only flag, so that the inner template can access only the data that was explicitly passed to it:

{% component "name" positional_arg keyword_arg=value ... only %}
 

component_css_dependenciesยค

{% component_css_dependencies %}
-

See source code

Marks location where CSS link tags should be rendered after the whole HTML has been generated.

Generally, this should be inserted into the <head> tag of the HTML.

If the generated HTML does NOT contain any {% component_css_dependencies %} tags, CSS links are by default inserted into the <head> tag of the HTML. (See JS and CSS output locations)

Note that there should be only one {% component_css_dependencies %} for the whole HTML document. If you insert this tag multiple times, ALL CSS links will be duplicately inserted into ALL these places.

component_js_dependenciesยค

{% component_js_dependencies %}
-

See source code

Marks location where JS link tags should be rendered after the whole HTML has been generated.

Generally, this should be inserted at the end of the <body> tag of the HTML.

If the generated HTML does NOT contain any {% component_js_dependencies %} tags, JS scripts are by default inserted at the end of the <body> tag of the HTML. (See JS and CSS output locations)

Note that there should be only one {% component_js_dependencies %} for the whole HTML document. If you insert this tag multiple times, ALL JS scripts will be duplicately inserted into ALL these places.

fillยค

{% fill name data=None default=None %}
+

See source code

Marks location where CSS link tags should be rendered after the whole HTML has been generated.

Generally, this should be inserted into the <head> tag of the HTML.

If the generated HTML does NOT contain any {% component_css_dependencies %} tags, CSS links are by default inserted into the <head> tag of the HTML. (See JS and CSS output locations)

Note that there should be only one {% component_css_dependencies %} for the whole HTML document. If you insert this tag multiple times, ALL CSS links will be duplicately inserted into ALL these places.

component_js_dependenciesยค

{% component_js_dependencies %}
+

See source code

Marks location where JS link tags should be rendered after the whole HTML has been generated.

Generally, this should be inserted at the end of the <body> tag of the HTML.

If the generated HTML does NOT contain any {% component_js_dependencies %} tags, JS scripts are by default inserted at the end of the <body> tag of the HTML. (See JS and CSS output locations)

Note that there should be only one {% component_js_dependencies %} for the whole HTML document. If you insert this tag multiple times, ALL JS scripts will be duplicately inserted into ALL these places.

fillยค

{% fill name data=None default=None %}
 {% endfill %}
-

See source code

Use this tag to insert content into component's slots.

{% fill %} tag may be used only within a {% component %}..{% endcomponent %} block. Runtime checks should prohibit other usages.

Args:

  • name (str, required): Name of the slot to insert this content into. Use "default" for the default slot.
  • default (str, optional): This argument allows you to access the original content of the slot under the specified variable name. See Accessing original content of slots
  • data (str, optional): This argument allows you to access the data passed to the slot under the specified variable name. See Scoped slots

Examples:

Basic usage:

{% component "my_table" %}
+

See source code

Use this tag to insert content into component's slots.

{% fill %} tag may be used only within a {% component %}..{% endcomponent %} block. Runtime checks should prohibit other usages.

Args:

  • name (str, required): Name of the slot to insert this content into. Use "default" for the default slot.
  • default (str, optional): This argument allows you to access the original content of the slot under the specified variable name. See Accessing original content of slots
  • data (str, optional): This argument allows you to access the data passed to the slot under the specified variable name. See Scoped slots

Examples:

Basic usage:

{% component "my_table" %}
   {% fill "pagination" %}
     < 1 | 2 | 3 >
   {% endfill %}
@@ -84,7 +84,7 @@
   {% endfill %}
 {% endcomponent %}
 

html_attrsยค

{% html_attrs attrs=None defaults=None **kwargs %}
-

See source code

Generate HTML attributes (key="value"), combining data from multiple sources, whether its template variables or static text.

It is designed to easily merge HTML attributes passed from outside with the internal. See how to in Passing HTML attributes to components.

Args:

  • attrs (dict, optional): Optional dictionary that holds HTML attributes. On conflict, overrides values in the default dictionary.
  • default (str, optional): Optional dictionary that holds HTML attributes. On conflict, is overriden with values in the attrs dictionary.
  • Any extra kwargs will be appended to the corresponding keys

The attributes in attrs and defaults are merged and resulting dict is rendered as HTML attributes (key="value").

Extra kwargs (key=value) are concatenated to existing keys. So if we have

attrs = {"class": "my-class"}
+

See source code

Generate HTML attributes (key="value"), combining data from multiple sources, whether its template variables or static text.

It is designed to easily merge HTML attributes passed from outside with the internal. See how to in Passing HTML attributes to components.

Args:

  • attrs (dict, optional): Optional dictionary that holds HTML attributes. On conflict, overrides values in the default dictionary.
  • default (str, optional): Optional dictionary that holds HTML attributes. On conflict, is overriden with values in the attrs dictionary.
  • Any extra kwargs will be appended to the corresponding keys

The attributes in attrs and defaults are merged and resulting dict is rendered as HTML attributes (key="value").

Extra kwargs (key=value) are concatenated to existing keys. So if we have

attrs = {"class": "my-class"}
 

Then

{% html_attrs attrs class="extra-class" %}
 

will result in class="my-class extra-class".

Example:

<div {% html_attrs
     attrs
@@ -95,7 +95,7 @@
 

renders

<div class="my-class extra-class" data-id="123">
 

See more usage examples in HTML attributes.

provideยค

{% provide name **kwargs %}
 {% endprovide %}
-

See source code

The "provider" part of the provide / inject feature. Pass kwargs to this tag to define the provider's data. Any components defined within the {% provide %}..{% endprovide %} tags will be able to access this data with Component.inject().

This is similar to React's ContextProvider, or Vue's provide().

Args:

  • name (str, required): Provider name. This is the name you will then use in Component.inject().
  • **kwargs: Any extra kwargs will be passed as the provided data.

Example:

Provide the "user_data" in parent component:

@register("parent")
+

See source code

The "provider" part of the provide / inject feature. Pass kwargs to this tag to define the provider's data. Any components defined within the {% provide %}..{% endprovide %} tags will be able to access this data with Component.inject().

This is similar to React's ContextProvider, or Vue's provide().

Args:

  • name (str, required): Provider name. This is the name you will then use in Component.inject().
  • **kwargs: Any extra kwargs will be passed as the provided data.

Example:

Provide the "user_data" in parent component:

@register("parent")
 class Parent(Component):
     template = """
       <div>
@@ -126,7 +126,7 @@
 

โŒ Don't do this

user = self.inject("user_data")["user"]
 

slotยค

{% slot name **kwargs [default] [required] %}
 {% endslot %}
-

See source code

Slot tag marks a place inside a component where content can be inserted from outside.

Learn more about using slots.

This is similar to slots as seen in Web components, Vue or React's children.

Args:

  • name (str, required): Registered name of the component to render
  • default: Optional flag. If there is a default slot, you can pass the component slot content without using the {% fill %} tag. See Default slot
  • required: Optional flag. Will raise an error if a slot is required but not given.
  • **kwargs: Any extra kwargs will be passed as the slot data.

Example:

@register("child")
+

See source code

Slot tag marks a place inside a component where content can be inserted from outside.

Learn more about using slots.

This is similar to slots as seen in Web components, Vue or React's children.

Args:

  • name (str, required): Registered name of the component to render
  • default: Optional flag. If there is a default slot, you can pass the component slot content without using the {% fill %} tag. See Default slot
  • required: Optional flag. Will raise an error if a slot is required but not given.
  • **kwargs: Any extra kwargs will be passed as the slot data.

Example:

@register("child")
 class Child(Component):
     template = """
       <div>
diff --git a/dev/sitemap.xml b/dev/sitemap.xml
index 68d3fd31..7240edc9 100644
--- a/dev/sitemap.xml
+++ b/dev/sitemap.xml
@@ -2,214 +2,214 @@
 
     
          https://emilstenstrom.github.io/django-components/latest/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/SUMMARY/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/migrating_from_safer_staticfiles/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/release_notes/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/advanced/authoring_component_libraries/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/advanced/component_registry/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/advanced/hooks/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/advanced/html_tragments/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/advanced/provide_inject/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/advanced/rendering_js_css/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/advanced/tag_formatter/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/advanced/typing_and_validation/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/access_component_input/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/autodiscovery/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/component_context_scope/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/components_as_views/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/components_in_python/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/defining_js_css_html_files/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/html_attributes/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/single_file_components/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/slots/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/subclassing_components/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/concepts/fundamentals/template_tag_syntax/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/getting_started/adding_js_and_css/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/getting_started/adding_slots/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/getting_started/components_in_templates/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/getting_started/parametrising_components/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/getting_started/your_first_component/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/guides/devguides/dependency_mgmt/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/guides/devguides/slot_rendering/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/guides/devguides/slots_and_blocks/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/guides/setup/dev_server_setup/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/guides/setup/logging_and_debugging/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/guides/setup/syntax_highlight/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/overview/code_of_conduct/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/overview/community/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/overview/compatibility/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/overview/contributing/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/overview/development/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/overview/installation/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/overview/license/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/overview/security_notes/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/overview/welcome/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/reference/api/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/reference/commands/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/reference/components/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/reference/exceptions/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/reference/middlewares/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/reference/settings/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/reference/tag_formatters/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/reference/template_tags/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/reference/template_vars/
-         2025-01-08
+         2025-01-09
     
     
          https://emilstenstrom.github.io/django-components/latest/reference/urls/
-         2025-01-08
+         2025-01-09
     
 
\ No newline at end of file
diff --git a/dev/sitemap.xml.gz b/dev/sitemap.xml.gz
index 848f24e6..cf09c0a9 100644
Binary files a/dev/sitemap.xml.gz and b/dev/sitemap.xml.gz differ
diff --git a/versions.json b/versions.json
index b6372068..34fa87c9 100644
--- a/versions.json
+++ b/versions.json
@@ -1,7 +1,7 @@
 [
   {
     "version": "dev",
-    "title": "dev (6c2a687)",
+    "title": "dev (a79b24b)",
     "aliases": []
   },
   {