Saltar al contenido
DS

Componentes · Acciones

Enlace <Link>

Enlaces dentro del texto, de navegación, con flecha o con disco; los internos se traducen solos a /es.

import Link from '@vivla-cms/ds/primitives/Link.astro'

Ejemplos

Props

Props de Link
Prop Valores Por defecto Para qué
href * string — —
locale string — —
external boolean false —
track string — —
variant underlinearrowplainnavdisc 'underline' —
target string — —
rel string — —
data-* string | undefined — Se pasan tal cual al elemento.
aria-* string | undefined — Se pasan tal cual al elemento.

Slots: contenido

Notas del código

El comentario de cabecera de Link.astro, tal cual (en inglés, como el código): si cambia el código, cambia esto.

the one anchor primitive. Every internal href is passed through localizeHref() so /es pages keep the visitor in Spanish (house rule); external opts out (language toggle, outbound URLs) and adds rel. track becomes data-track for the delegated click tracker in apps/web/src/lib/analytics.ts.

<Link href="/listings" track="nav_click">Casas</Link>
<Link href="/how-it-works" variant="arrow">Cómo funciona</Link>
<Link href="/listings" variant="nav" aria-current="page">Casas</Link>

Figma Components_Web · Action (74zqbI8QliQL1oyXyFbsBT):

underline = «Text link» 136:62 — inside a paragraph: always underlined,
            inherits the paragraph size, content/primary → content/
            secondary on hover.
nav       = «Link» 136:57 — navigation: typography-02-M (16/22 medium),
            content/primary at rest → content/secondary on hover, as the
            final hand-off's navbar and menu draw it (1560:2192,
            1558:2180, 30/10: links in content/primary; hover follows
            the Text link 136:62 rule); the active one (`aria-current`)
            carries a 4 px dot 6 px before the label (`align-top`:
            the empty dot would otherwise be the inline-flex's
            baseline and drop the active label 2 px below its
            neighbours, Jorge 05/11); disabled =
            action/disabled/text. (Until 30/10 the rest state was
            content/secondary.)
disc      = «Link arrow» / «Link button» 276:418 — at the end of a block,
            never inside a text: the label (typography-02-M medium) 16 px
            before a 56 px `action` disc holding line/arrow-right 20.
            Hover: label on-surface-muted + disc action-hover. Focus: ONE
            2 px `focus` ring around label and disc (radius 40, 4 px
            outside the disc, 16 px before the label), drawn by a
            pseudo-element so the layout never moves. `aria-disabled`
            greys both (disabled roles) and stops the pointer.
plain     = a standalone text link, on its own line (the statement and
            split-banner CTAs): NO underline at rest, underlined on hover
            (web review 05/11, Jaime and Laura: «queda muy limpio sin el
            subrayado» — every link that is not inside a sentence). Do
            not add `underline` back to it; a link inside running text
            (or among plain labels, where only the rule tells it apart)
            is `underline`.
arrow predates Components_Web.

<Link href="/how-it-works" variant="disc">Cómo funciona</Link>

Dónde se usa

84 veces en 47 archivos de la web y los bloques del CMS.

Ver los archivos
esc