Links-list
Mostrar parámetros
Parámetros del componente
params:
- name: idPrefix
type: string
required: false
description: String to prefix id for each item if no id is specified on each item.
- name: hasNav
type: boolean
required: false
description: Defaults to `true`. If `false`, there will be no nav assuming the component will be wrapped with a custom nav with it's own aria-label.
- name: items
type: array
required: true
description: Array of nav items objects.
params:
- name: href
type: string
required: false
description: Item link.
- name: target
type: string
required: false
description: The target where the item should link to.
- name: text
type: string
required: true
description: If `html` is set, this is not required. Text to use within each nav item label. If `html` is provided, the `text` argument will be ignored.
- name: html
type: string
required: true
description: If `text` is set, this is not required. HTML to use within each nav item label. If `html` is provided, the `text` argument will be ignored.
- name: id
type: string
required: false
description: Specific id attribute for the item. If omitted, then idPrefix option will be applied.
- name: disabled
type: boolean
required: false
description: If true, nav will be disabled.
- name: sub
type: boolean
required: false
description: If true, content provided will be revealed when the item is expanded.
- name: html
type: string
required: true
description: Provide content for the sub.
- name: classes
type: string
required: false
description: Classes to add to the sub container.
- name: iconRight
type: object
required: false
description: This is the optional icon at right. If this is not set, the icon at right will be a default right arrow.
- name: html
type: string
required: false
description: Use this html to insert a custom svg inline icon. If this is set, the type are not used.
- name: type
type: string
required: false
description: Predefined icon types are `arrow`, `chevron`, `none`.
- name: containerClasses
type: string
required: false
description: Classes applied to the parent div of icon. Useful to vertical align the icon.
- name: icon
type: object
required: false
description: This is the optional icon at left
- name: html
type: string
required: true
description: Use this html to insert a custom svg inline icon. If this is set, the type are not used.
- name: containerClasses
type: string
required: false
description: Classes applied to the parent div of icon. Useful to vertical align the icon.
- name: containerClasses
type: string
required: false
description: Classes to add to the parent `<li>` of the item.
- name: classes
type: string
required: false
description: Classes to add to the item.
- name: attributes
type: object
required: false
description: HTML attributes (for example data attributes) to add to the item.
- name: listClasses
type: string
required: false
description: Classes to add to the `<ul>` that holds the items.
- name: classes
type: string
required: false
description: Classes to add to the nav container.
- name: attributes
type: object
required: false
description: HTML attributes (for example data attributes) to add to the nav container.
Por defecto #
Mostrar códigodel ejemplo: Por defecto
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "default",
"items": [
{
"href": "#",
"text": "Item 1"
},
{
"href": "#",
"text": "Item 2"
},
{
"href": "#",
"text": "Item 3"
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="default-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="default-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 2
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="default-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Con varios tipos de icono a la derecha #
Utiliza el parámetro `iconRight` y sus parámetro: `type`, `html` y `containerClasses` para cambiar el tipo de icono de la derecha.
Mostrar códigodel ejemplo: Con varios tipos de icono a la derecha
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "iconright",
"items": [
{
"href": "#",
"text": "Sin iconRight (arrow por defecto)"
},
{
"href": "#",
"text": "iconRight.type: arrow",
"iconRight": {
"type": "arrow"
}
},
{
"href": "#",
"text": "iconRight.type: chevron",
"iconRight": {
"type": "chevron"
}
},
{
"href": "#",
"text": "iconRight.type: none",
"iconRight": {
"type": "none"
}
},
{
"href": "#",
"text": "Con icono pesonalizado usando iconRight.html",
"iconRight": {
"html": "<svg class=\"self-center\" aria-hidden=\"true\" focusable=\"false\" width=\"1em\" height=\"1em\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6.28572 1.71429C6.12793 1.71429 6.00001 1.84221 6.00001 2V3.14286H10V2C10 1.84221 9.87209 1.71429 9.71429 1.71429H6.28572ZM11.7143 3.14286V2C11.7143 0.895431 10.8189 0 9.71429 0H6.28572C5.18115 0 4.28572 0.895431 4.28572 2V3.14286H1.14286C0.669476 3.14286 0.285721 3.52662 0.285721 4C0.285721 4.47338 0.669476 4.85714 1.14286 4.85714H5.14286H10.8572H14.8572C15.3305 4.85714 15.7143 4.47338 15.7143 4C15.7143 3.52662 15.3305 3.14286 14.8572 3.14286H11.7143ZM2.85715 6.28571C2.69243 6.28571 2.53572 6.3568 2.42722 6.48073C2.31872 6.60466 2.26897 6.76939 2.29074 6.93266L3.4336 15.5041C3.47145 15.788 3.71361 16 4.00001 16H12C12.2864 16 12.5286 15.788 12.5664 15.5041L13.7093 6.93266C13.7311 6.76939 13.6813 6.60466 13.5728 6.48073C13.4642 6.3568 13.3076 6.28571 13.1429 6.28571H2.85715Z\" fill=\"currentColor\"></path>\n </g></svg>"
}
},
{
"href": "#",
"text": "iconRight.containerClasses para posicionar el icono",
"sub": {
"html": "<p>También se puede usar item.containerClasses para quitar el padding lateral del item.</p><p>Lorem, ipsum, dolor sit amet consectetur adipisicing elit. Esse consequuntur rem, unde doloribus eaque accusantium? Distinctio recusandae laudantium tenetur explicabo, vero, repellat, earum debitis voluptatem maxime perspiciatis doloribus adipisci qui?</p>"
},
"iconRight": {
"type": "arrow",
"containerClasses": "absolute right-0 top-[50%] -mt-[0.5em]"
},
"containerClasses": "relative border-y border-neutral-base -my-px"
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="iconright-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Sin iconRight (arrow por defecto)
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="iconright-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
iconRight.type: arrow
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="iconright-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
iconRight.type: chevron
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<g>
<path fill="currentColor" fill-rule="evenodd" d="M3.4685 0.427C3.8512 0.0443 4.4717 0.0443 4.8545 0.427L10.388 5.9606C10.962 6.5346 10.962 7.4654 10.388 8.0395L4.8545 13.573C4.4717 13.9557 3.8512 13.9557 3.4685 13.573C3.0858 13.1903 3.0858 12.5698 3.4685 12.1871L8.6556 7L3.4685 1.813C3.0858 1.4303 3.0858 0.8098 3.4685 0.427Z" clip-rule="evenodd" stroke-width="1"></path>
</g>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="iconright-4" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
iconRight.type: none
</div>
</div>
</a>
</li>
<li class="relative px-base">
<a id="iconright-5" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Con icono pesonalizado usando iconRight.html
</div>
</div>
<div class="self-center h-full">
<svg class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.28572 1.71429C6.12793 1.71429 6.00001 1.84221 6.00001 2V3.14286H10V2C10 1.84221 9.87209 1.71429 9.71429 1.71429H6.28572ZM11.7143 3.14286V2C11.7143 0.895431 10.8189 0 9.71429 0H6.28572C5.18115 0 4.28572 0.895431 4.28572 2V3.14286H1.14286C0.669476 3.14286 0.285721 3.52662 0.285721 4C0.285721 4.47338 0.669476 4.85714 1.14286 4.85714H5.14286H10.8572H14.8572C15.3305 4.85714 15.7143 4.47338 15.7143 4C15.7143 3.52662 15.3305 3.14286 14.8572 3.14286H11.7143ZM2.85715 6.28571C2.69243 6.28571 2.53572 6.3568 2.42722 6.48073C2.31872 6.60466 2.26897 6.76939 2.29074 6.93266L3.4336 15.5041C3.47145 15.788 3.71361 16 4.00001 16H12C12.2864 16 12.5286 15.788 12.5664 15.5041L13.7093 6.93266C13.7311 6.76939 13.6813 6.60466 13.5728 6.48073C13.4642 6.3568 13.3076 6.28571 13.1429 6.28571H2.85715Z" fill="currentColor"></path>
</g>
</svg>
</div>
</a>
</li>
<li class="relative border-y border-neutral-base -my-px">
<a id="iconright-6" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
iconRight.containerClasses para posicionar el icono
</div>
</div>
<div class="absolute right-0 top-[50%] -mt-[0.5em]">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
<div class=" c-paragraph-base text-neutral-dark -mt-base mr-lg" id="sub-iconright-6">
<p>También se puede usar item.containerClasses para quitar el padding lateral del item.</p>
<p>Lorem, ipsum, dolor sit amet consectetur adipisicing elit. Esse consequuntur rem, unde doloribus eaque accusantium? Distinctio recusandae laudantium tenetur explicabo, vero, repellat, earum debitis voluptatem maxime perspiciatis doloribus adipisci qui?</p>
</div>
</li>
</ul>
</nav>
<!-- /links-list -->
Con icono #
Mostrar códigodel ejemplo: Con icono
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "with-icon",
"items": [
{
"href": "#",
"text": "Item 1",
"icon": {
"html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" class=\"inline-block align-middle\"><path d=\"M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z\" fill=\"currentColor\"></path></svg>"
}
},
{
"href": "#",
"text": "Item 2",
"icon": {
"html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" class=\"inline-block align-middle\"><path d=\"M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z\" fill=\"currentColor\"></path></svg>"
}
},
{
"href": "#",
"text": "Item 3",
"icon": {
"html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" class=\"inline-block align-middle\"><path d=\"M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z\" fill=\"currentColor\"></path></svg>"
}
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="with-icon-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle">
<path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path>
</svg>
</div>
<div data-element="c-links-list__text" class="flex-1">
Item 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-icon-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle">
<path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path>
</svg>
</div>
<div data-element="c-links-list__text" class="flex-1">
Item 2
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-icon-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle">
<path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path>
</svg>
</div>
<div data-element="c-links-list__text" class="flex-1">
Item 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Con clases de css aplicadas #
Mostrar códigodel ejemplo: Con clases de css aplicadas
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "with-classes-applied",
"items": [
{
"href": "#",
"text": "Item grande con icono",
"classes": "flex justify-between items-center py-base text-2xl",
"icon": {
"html": "<div class=\"flex items-center justify-center p-sm -ml-sm bg-neutral-lighter rounded-full text-4xl\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" class=\"inline-block align-middle\"><path d=\"M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z\" fill=\"currentColor\"></path></svg></div>"
}
},
{
"href": "#",
"text": "Item grande con icono",
"classes": "flex justify-between items-center py-base text-2xl",
"icon": {
"html": "<div class=\"flex items-center justify-center p-sm -ml-sm bg-neutral-lighter rounded-full text-4xl\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" class=\"inline-block align-middle\"><path d=\"M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z\" fill=\"currentColor\"></path></svg></div>"
}
},
{
"href": "#",
"text": "Item grande con icono",
"classes": "flex justify-between items-center py-base text-2xl",
"icon": {
"html": "<div class=\"flex items-center justify-center p-sm -ml-sm bg-neutral-lighter rounded-full text-4xl\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" class=\"inline-block align-middle\"><path d=\"M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z\" fill=\"currentColor\"></path></svg></div>"
}
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="with-classes-applied-1" href="#" class="c-link flex justify-between items-center py-base text-2xl">
<div class="flex gap-base justify-between items-center flex-1">
<div class="self-center h-full">
<div class="flex items-center justify-center p-sm -ml-sm bg-neutral-lighter rounded-full text-4xl"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle">
<path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path>
</svg></div>
</div>
<div data-element="c-links-list__text" class="flex-1">
Item grande con icono
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-classes-applied-2" href="#" class="c-link flex justify-between items-center py-base text-2xl">
<div class="flex gap-base justify-between items-center flex-1">
<div class="self-center h-full">
<div class="flex items-center justify-center p-sm -ml-sm bg-neutral-lighter rounded-full text-4xl"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle">
<path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path>
</svg></div>
</div>
<div data-element="c-links-list__text" class="flex-1">
Item grande con icono
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-classes-applied-3" href="#" class="c-link flex justify-between items-center py-base text-2xl">
<div class="flex gap-base justify-between items-center flex-1">
<div class="self-center h-full">
<div class="flex items-center justify-center p-sm -ml-sm bg-neutral-lighter rounded-full text-4xl"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle">
<path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path>
</svg></div>
</div>
<div data-element="c-links-list__text" class="flex-1">
Item grande con icono
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Con listclasses aplicado: con líneas horizontales arriba y abajo #
Mostrar códigodel ejemplo: Con listclasses aplicado: con líneas horizontales arriba y abajo
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "with-listclasses",
"listClasses": "divide-y divide-neutral-base border-t border-b border-neutral-base",
"items": [
{
"href": "#",
"text": "Item 1",
"icon": {
"html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" class=\"inline-block align-middle\"><path d=\"M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z\" fill=\"currentColor\"></path></svg>"
}
},
{
"href": "#",
"text": "Item 2",
"icon": {
"html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" class=\"inline-block align-middle\"><path d=\"M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z\" fill=\"currentColor\"></path></svg>"
}
},
{
"href": "#",
"text": "Item 3",
"icon": {
"html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" class=\"inline-block align-middle\"><path d=\"M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z\" fill=\"currentColor\"></path></svg>"
}
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base border-t border-b border-neutral-base">
<li class="relative px-base">
<a id="with-listclasses-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle">
<path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path>
</svg>
</div>
<div data-element="c-links-list__text" class="flex-1">
Item 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-listclasses-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle">
<path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path>
</svg>
</div>
<div data-element="c-links-list__text" class="flex-1">
Item 2
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-listclasses-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle">
<path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path>
</svg>
</div>
<div data-element="c-links-list__text" class="flex-1">
Item 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Con containerclasses aplicado: con aspecto de cards #
Mostrar códigodel ejemplo: Con containerclasses aplicado: con aspecto de cards
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "with-containerclasses",
"listClasses": "border border-transparent",
"items": [
{
"href": "#",
"text": "Item 1",
"containerClasses": "my-sm px-base border border-neutral-base rounded",
"icon": {
"html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" class=\"inline-block align-middle\"><path d=\"M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z\" fill=\"currentColor\"></path></svg>"
}
},
{
"href": "#",
"text": "Item 2",
"containerClasses": "my-sm px-base border border-neutral-base rounded",
"icon": {
"html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" class=\"inline-block align-middle\"><path d=\"M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z\" fill=\"currentColor\"></path></svg>"
}
},
{
"href": "#",
"text": "Item 3",
"containerClasses": "px-base border border-neutral-base rounded",
"icon": {
"html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" class=\"inline-block align-middle\"><path d=\"M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z\" fill=\"currentColor\"></path></svg>"
}
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="border border-transparent">
<li class="my-sm px-base border border-neutral-base rounded">
<a id="with-containerclasses-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle">
<path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path>
</svg>
</div>
<div data-element="c-links-list__text" class="flex-1">
Item 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="my-sm px-base border border-neutral-base rounded">
<a id="with-containerclasses-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle">
<path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path>
</svg>
</div>
<div data-element="c-links-list__text" class="flex-1">
Item 2
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="px-base border border-neutral-base rounded">
<a id="with-containerclasses-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle">
<path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path>
</svg>
</div>
<div data-element="c-links-list__text" class="flex-1">
Item 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Con item deshabilitado #
Mostrar códigodel ejemplo: Con item deshabilitado
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "with-disabled-item",
"items": [
{
"href": "#",
"text": "Item 1"
},
{
"href": "#",
"text": "Item 2"
},
{
"href": "#",
"text": "Item 3",
"disabled": true
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="with-disabled-item-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-disabled-item-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 2
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-disabled-item-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base text-neutral-base no-underline pointer-events-none" aria-disabled="true" tabindex="-1">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Sin href #
Mostrar códigodel ejemplo: Sin href
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "without-href",
"items": [
{
"href": "#",
"text": "Item 1"
},
{
"text": "Item 2"
},
{
"href": "#",
"text": "Item 3"
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="without-href-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<div id="without-href-2" class=" flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div class="flex-1">
Item 2
</div>
</div>
</div>
</li>
<li class="relative px-base">
<a id="without-href-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Con item activo #
Mostrar códigodel ejemplo: Con item activo
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "with-active-item",
"items": [
{
"href": "#",
"text": "Item 1"
},
{
"href": "#",
"text": "Item 2",
"active": true
},
{
"href": "#",
"text": "Item 3"
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="with-active-item-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-active-item-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base font-bold" aria-current="page">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
<strong class="font-bold">Item 2</strong>
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-active-item-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Con target en los enlaces #
Mostrar códigodel ejemplo: Con target en los enlaces
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "with-target-in-links",
"items": [
{
"href": "#",
"text": "Item 1",
"target": "_blank",
"attributes": {
"title": "Se abre en ventana nueva"
}
},
{
"href": "#",
"text": "Item 2",
"target": "_blank",
"attributes": {
"title": "Se abre en ventana nueva"
}
},
{
"href": "#",
"text": "Item 3",
"target": "_blank",
"attributes": {
"title": "Se abre en ventana nueva"
}
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="with-target-in-links-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base" target="_blank" title="Se abre en ventana nueva">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-target-in-links-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base" target="_blank" title="Se abre en ventana nueva">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 2
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-target-in-links-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base" target="_blank" title="Se abre en ventana nueva">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Con un texto de item muy largo #
Mostrar códigodel ejemplo: Con un texto de item muy largo
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "with-very-long-option-text",
"items": [
{
"href": "#",
"text": "No debe haber enlaces de más de 250 caracteres, que es el máximo admitido en accesibilidad, con excepción de nombres de leyes. Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Maecenas faucibus mollis interdum. Donec id elit non mi porta gravida at eget metus."
},
{
"href": "#",
"text": "No debe haber enlaces de más de 250 caracteres, que es el máximo admitido en accesibilidad, con excepción de nombres de leyes. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Donec sed odio dui. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cras mattis consectetur purus sit amet fermentum."
},
{
"href": "#",
"text": "No debe haber enlaces de más de 250 caracteres, que es el máximo admitido en accesibilidad, con excepción de nombres de leyes. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Sed posuere consectetur est at lobortis."
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="with-very-long-option-text-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
No debe haber enlaces de más de 250 caracteres, que es el máximo admitido en accesibilidad, con excepción de nombres de leyes. Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Maecenas faucibus mollis interdum. Donec id elit non mi porta gravida at eget metus.
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-very-long-option-text-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
No debe haber enlaces de más de 250 caracteres, que es el máximo admitido en accesibilidad, con excepción de nombres de leyes. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Donec sed odio dui. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cras mattis consectetur purus sit amet fermentum.
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="with-very-long-option-text-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
No debe haber enlaces de más de 250 caracteres, que es el máximo admitido en accesibilidad, con excepción de nombres de leyes. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Sed posuere consectetur est at lobortis.
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Con contenido descriptivo en cada item #
Mostrar códigodel ejemplo: Con contenido descriptivo en cada item
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "descriptive-example",
"items": [
{
"href": "#",
"text": "Item 1",
"sub": {
"html": "<p>Este es un párrafo explicativo metido con un sub.html dentro del Item</p>"
}
},
{
"href": "#",
"text": "Item 2",
"sub": {
"html": "<p>Este es un párrafo explicativo metido con un sub.html dentro del Item</p>"
}
},
{
"href": "#",
"text": "Item 3",
"sub": {
"html": "<p>Este es un párrafo explicativo metido con un sub.html dentro del Item</p>"
}
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="descriptive-example-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
<div class=" c-paragraph-base text-neutral-dark -mt-base mr-lg" id="sub-descriptive-example-1">
<p>Este es un párrafo explicativo metido con un sub.html dentro del Item</p>
</div>
</li>
<li class="relative px-base">
<a id="descriptive-example-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 2
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
<div class=" c-paragraph-base text-neutral-dark -mt-base mr-lg" id="sub-descriptive-example-2">
<p>Este es un párrafo explicativo metido con un sub.html dentro del Item</p>
</div>
</li>
<li class="relative px-base">
<a id="descriptive-example-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
<div class=" c-paragraph-base text-neutral-dark -mt-base mr-lg" id="sub-descriptive-example-3">
<p>Este es un párrafo explicativo metido con un sub.html dentro del Item</p>
</div>
</li>
</ul>
</nav>
<!-- /links-list -->
Con idprefix #
Muestra el código para ver el idPrefix aplicado.
Mostrar códigodel ejemplo: Con idprefix
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "site-menu-item",
"items": [
{
"href": "#",
"text": "Opción 1"
},
{
"href": "#",
"text": "Opción 2"
},
{
"href": "#",
"text": "Opción 3"
},
{
"href": "#",
"text": "Opción 4"
},
{
"href": "#",
"text": "Opción 5"
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="site-menu-item-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="site-menu-item-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 2
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="site-menu-item-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="site-menu-item-4" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 4
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="site-menu-item-5" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 5
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Con ids individuales #
Muestra el código para ver los ids aplicados.
Mostrar códigodel ejemplo: Con ids individuales
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"items": [
{
"href": "#",
"text": "Opción 1",
"id": "option-A"
},
{
"href": "#",
"text": "Opción 2",
"id": "option-B"
},
{
"href": "#",
"text": "Opción 3",
"id": "option-C"
},
{
"href": "#",
"text": "Opción 4",
"id": "option-D"
},
{
"href": "#",
"text": "Opción 5",
"id": "option-E"
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="option-A" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="option-B" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 2
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="option-C" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="option-D" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 4
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="option-E" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 5
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Con atributos #
Muestra el código para ver cómo se aplican los atributos.
Mostrar códigodel ejemplo: Con atributos
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"items": [
{
"href": "#",
"text": "Opción 1",
"attributes": {
"data-attribute-1": "value-A",
"data-attribute-2": "value-B",
"data-attribute-3": "value-C"
}
},
{
"href": "#",
"text": "Opción 2",
"attributes": {
"data-attribute-1": "value-A",
"data-attribute-2": "value-B",
"data-attribute-3": "value-C"
}
},
{
"href": "#",
"text": "Opción 3",
"attributes": {
"data-attribute-1": "value-A",
"data-attribute-2": "value-B",
"data-attribute-3": "value-C"
},
"sub": {
"attributes": {
"data-attribute-1": "value-A",
"data-attribute-2": "value-B",
"data-attribute-3": "value-C"
},
"html": "<p>Este es un párrafo explicativo metido con un sub.html dentro del Item</p><p>Este es otro párrafo.</p>"
}
},
{
"href": "#",
"text": "Opción 4",
"attributes": {
"data-attribute-1": "value-A",
"data-attribute-2": "value-B",
"data-attribute-3": "value-C"
}
},
{
"href": "#",
"text": "Opción 5",
"attributes": {
"data-attribute-1": "value-A",
"data-attribute-2": "value-B",
"data-attribute-3": "value-C"
}
}
],
"attributes": {
"aria-label": "Menu destacado",
"id": "nav-id-example"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado" id="nav-id-example">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="links-list-item-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base" data-attribute-1="value-A" data-attribute-2="value-B" data-attribute-3="value-C">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="links-list-item-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base" data-attribute-1="value-A" data-attribute-2="value-B" data-attribute-3="value-C">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 2
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="links-list-item-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base" data-attribute-1="value-A" data-attribute-2="value-B" data-attribute-3="value-C">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
<div class=" c-paragraph-base text-neutral-dark -mt-base mr-lg" id="sub-links-list-item-3">
<p>Este es un párrafo explicativo metido con un sub.html dentro del Item</p>
<p>Este es otro párrafo.</p>
</div>
</li>
<li class="relative px-base">
<a id="links-list-item-4" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base" data-attribute-1="value-A" data-attribute-2="value-B" data-attribute-3="value-C">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 4
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="links-list-item-5" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base" data-attribute-1="value-A" data-attribute-2="value-B" data-attribute-3="value-C">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Opción 5
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->
Sin nav #
Usa el parámetro "hasNav": false
para no rodear el componente con una etiqueta <nav>
, asumiendo que el componente estará rodeado con un nav personalizado con su propio aria-label
si lo necesita.
Mostrar códigodel ejemplo: Sin nav
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "hasnav-false",
"hasNav": false,
"items": [
{
"href": "#",
"text": "Item 1"
},
{
"href": "#",
"text": "Item 2"
},
{
"href": "#",
"text": "Item 3"
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<div data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="hasnav-false-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="hasnav-false-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 2
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="hasnav-false-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</div>
<!-- /links-list -->
Ejemplo mixto #
Mostrar códigodel ejemplo: Ejemplo mixto
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "mixed-example",
"items": [
{
"href": "#",
"html": "<strong>Deudas</strong>",
"classes": "flex justify-between items-center py-base text-lg",
"sub": {
"html": "<p class=\"c-paragraph-base mb-0\">Tienes <span class=\"text-alert-base\">deudas fuera de plazo</span></p>"
}
},
{
"href": "#",
"html": "<strong>Historial de pagos</strong>",
"classes": "flex justify-between items-center py-base text-lg"
},
{
"href": "#",
"html": "<strong>Certificado de corriente de pago</strong>",
"classes": "flex justify-between items-center py-base text-lg",
"sub": {
"html": "<p class=\"c-paragraph-base mb-0\">Tienes <strong>1 certificado disponible</strong>.</p>"
}
},
{
"href": "#",
"html": "<strong>Valoraciones de inmuebles</strong>",
"classes": "flex justify-between items-center py-base text-lg"
},
{
"href": "#",
"html": "<strong>Aplazamiento y fraccionamiento</strong>",
"classes": "flex justify-between items-center py-base text-lg",
"sub": {
"html": "<p class=\"c-paragraph-base mb-0\">Tienes 1 deuda fraccionada, has pagado <strong>2 fracciones</strong> de 5.</p>"
}
}
],
"attributes": {
"aria-label": "Menu destacado"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="mixed-example-1" href="#" class="c-link flex justify-between items-center py-base text-lg">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
<strong>Deudas</strong>
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
<div class=" c-paragraph-base text-neutral-dark -mt-base mr-lg" id="sub-mixed-example-1">
<p class="c-paragraph-base mb-0">Tienes <span class="text-alert-base">deudas fuera de plazo</span></p>
</div>
</li>
<li class="relative px-base">
<a id="mixed-example-2" href="#" class="c-link flex justify-between items-center py-base text-lg">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
<strong>Historial de pagos</strong>
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="mixed-example-3" href="#" class="c-link flex justify-between items-center py-base text-lg">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
<strong>Certificado de corriente de pago</strong>
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
<div class=" c-paragraph-base text-neutral-dark -mt-base mr-lg" id="sub-mixed-example-3">
<p class="c-paragraph-base mb-0">Tienes <strong>1 certificado disponible</strong>.</p>
</div>
</li>
<li class="relative px-base">
<a id="mixed-example-4" href="#" class="c-link flex justify-between items-center py-base text-lg">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
<strong>Valoraciones de inmuebles</strong>
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="mixed-example-5" href="#" class="c-link flex justify-between items-center py-base text-lg">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
<strong>Aplazamiento y fraccionamiento</strong>
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
<div class=" c-paragraph-base text-neutral-dark -mt-base mr-lg" id="sub-mixed-example-5">
<p class="c-paragraph-base mb-0">Tienes 1 deuda fraccionada, has pagado <strong>2 fracciones</strong> de 5.</p>
</div>
</li>
</ul>
</nav>
<!-- /links-list -->
Activar un item con javascript #
Puedes activar un item con Javascript, usa la función global activateItemLinksList(elementWrapper, idItem)
para activar un item de la lista, usando sus ids. Ej: Abre la consola del navegador y escribe activateItemLinksList("links-list-js", "links-list-js-3")
para activar el último item de la lista.
Mostrar códigodel ejemplo: Activar un item con javascript
Contenido
Nunjucks macro
{% from "components/links-list/_macro.links-list.njk" import componentLinksList %}
{{ componentLinksList({
"idPrefix": "links-list-js",
"items": [
{
"href": "#",
"text": "Item 1"
},
{
"href": "#",
"text": "Item 2"
},
{
"href": "#",
"text": "Item 3"
}
],
"attributes": {
"aria-label": "Menu destacado",
"id": "links-list-js"
}
}) }}
HTML
<!-- links-list -->
<nav data-module="c-links-list" aria-label="Menu destacado" id="links-list-js">
<ul class="divide-y divide-neutral-base">
<li class="relative px-base">
<a id="links-list-js-1" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 1
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="links-list-js-2" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 2
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
<li class="relative px-base">
<a id="links-list-js-3" href="#" class="c-link flex justify-between items-center gap-base flex-1 py-base">
<div class="flex gap-base justify-between items-center flex-1">
<div data-element="c-links-list__text" class="flex-1">
Item 3
</div>
</div>
<div class="self-center h-full">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em">
<path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path>
</svg>
</div>
</a>
</li>
</ul>
</nav>
<!-- /links-list -->