<a href="" class="n7-link ">
    Link text

</a>
<{% if span %}span{% else %}a href="{{ href }}"{% endif %}{% if allyHidden %} tabindex="-1" aria-hidden="true"{% endif %} class="n7-link{%- block classes %} {{ classes }}{%- endblock -%}">
    {%- block content -%}
        {% if iconOnly %}
            <span class="sr-only">{{ label }}</span>
        {% else %}
            {{ label }}
        {% endif %}
         {% if accessibleLabel %}<span class="sr-only">{{ accessibleLabel }}</span>{% endif %}
    {%- endblock -%}
    {%- block icon -%}
        {% if hasIcon %}
            {% render '@icon--small', { id: icon, size: iconSize, classes: iconClasses }, true %}
        {% endif %}
        {% if iconOnly %}
            {% render '@icon--medium', { id: icon, size: iconSize, classes: iconClasses }, true %}
        {% endif %}
    {%- endblock -%}
</{% if span %}span{% else %}a{% endif %}>
{
  "label": "Link text",
  "icon": "mini--pencil-square",
  "iconSize": "w-1e h-1e",
  "href": null
}
  • Content:
    /* LINK */
    @layer components {
        .n7-link {
            @apply inline-flex gap-2 items-center n7-link-primary hover:underline hover:n7-link-primary-hover focus:text-primary-800 text-sm md:text-base;
        }
    
        .n7-link--sm {
            @apply gap-1.5 text-sm;
        }
    
        .n7-link--lg {
            @apply gap-2.5 text-lg;
        }
    
        .n7-link--underline {
            @apply underline;
        }
    }
  • URL: /components/raw/link/link.css
  • Filesystem Path: components/02-atoms/link/link.css
  • Size: 379 Bytes

Link component.

Configurations:

  • icon: value - icon id
  • classes: value - set classes
  • label: value - set link label
  • iconSize: value - set icon size classes
  • accessibleLabel: value - eventual accessible text for screen reader (gives more context for “read more” link text)
  • allyHidden: true -adds attributes in order to hyde the link from keyboard and screenreader (used in card fully clickable)
  • hasIcon: true - to display an icon
  • iconOnly: true - to display only an icon (no visible text)