{% with element=href|yesno:"a,button" %}
{# djlint:off #}
<{{ element }} class="nav-link{% if active %} active{% elif disabled %} disabled{% endif %} {{ class }}"
{% if active %} aria-current="page" {% elif disabled %} aria-disabled="true"{% endif %}
{% if href %}href="{{ href}}"{% endif %}
{{ attrs }}>
{% if icon %}{% endif %}
{% if text %}
{{ text }}
{% endif %}
{{ slot }}
{{ element }}>
{# djlint:on #}
{% endwith %}