{% extends "djust_theming/catalogue/base.html" %} {% load theme_tags theme_components djust_components %} {% block title %}Components{% endblock %} {% block catalogue_content %}

Components

{{ total_count }} components across {{ components_by_category|length }} categories. Pick one to see it live, copy the usage, and read its props.

{% comment %} The category filter is a `toggle_group` bound to `set_category`; the pressed chip is the server's `active_category`, rendered rather than toggled in JS. {% endcomment %}
{% toggle_group name="category" options=category_options value=active_category event="set_category" size="sm" %}
{% comment %} One `card` per component — `visible_components` is the server's filtered list, so an empty result is an `empty_state`, not every card `display:none`. The thumbnail is a template tag over a process-wide cache, not state: 24 rendered examples in `visible_components` would ship on every event. {% endcomment %} {% if visible_components %}
{% for comp in visible_components %} {% comment %} Both attributes carry the RESOLVED path. The href used to be relative ("button/"), which is correct only while the document URL is still the index: a dj-navigate changes the URL with pushState without reloading, so a relative href on a card that outlives that swap resolves against the new URL and points at /components/gauge/gauge/. `url` already accounts for the mount point, so there is nothing to gain from the relative form. {% endcomment %} {% card title=comp.display_name class="dc-card" %}
{% theme_badge comp.component_type variant=comp.component_type %} {{ comp.category }}
{% if comp.description %}

{{ comp.description }}

{% endif %} {% component_thumbnail comp.name as thumb %}{% if thumb %}{% endif %} {% if comp.example_count %}
{{ comp.example_count }} example{{ comp.example_count|pluralize }}
{% endif %} {% endcard %}
{% endfor %}
{% else %} {% empty_state title="No components match" description=search_query %} {% endif %} {% endblock %}