{# Macro button / link_button / icon_button
Uso:
{% from "dg/components/button.html" import button, link_button, icon_button %}
{{ button("Crear", variant="primary") }}
{{ link_button("Ver", href="/x", variant="ghost") }}
{{ icon_button("plus", aria_label="Nuevo") }}
#}
{% macro button(
label,
variant="ghost",
size="md",
type="button",
icon=none,
icon_position="left",
aria_label=none,
disabled=false,
extra_class="",
attrs=""
) %}
{%- set _size = " btn-sm" if size == "sm" else "" -%}
{%- set _var = "btn-" ~ variant -%}
{%- endmacro %}
{% macro link_button(
label,
href="#",
variant="ghost",
size="md",
icon=none,
icon_position="left",
target="",
aria_label=none,
extra_class=""
) %}
{%- set _size = " btn-sm" if size == "sm" else "" -%}
{%- set _var = "btn-" ~ variant -%}
{%- endmacro %}
{% macro icon_button(name, aria_label, extra_class="", attrs="") %}
{%- from "dg/components/icon.html" import icon %}
{%- endmacro %}