LinkButton

4 variants. Open one in isolation: use the link on each card.


src/ui/0_atoms/LinkButton.astro
---
/**
* Button-styled link for external destinations (retailer pages, publisher
* links). Deliberately distinct from the `tag` pill (which labels metadata):
* squared corners, canvas fill, 1px border, full-ink mono text, and a raised
* fill on hover. Use for actions; use `Badge` / `.tag` for labels.
*/
interface Props {
href: string
/** Visible text; optional slot overrides it. */
label?: string
/** External destination: defaults target/rel to `_blank` + `noopener noreferrer`. */
external?: boolean
target?: string
rel?: string
title?: string
class?: string
'aria-label'?: string
}
const {
href,
label,
external = false,
target,
rel,
title,
class: className,
'aria-label': ariaLabel,
} = Astro.props
const resolvedTarget = target ?? (external ? '_blank' : undefined)
const resolvedRel = rel ?? (external ? 'noopener noreferrer' : undefined)
---
<a
href={href}
title={title}
target={resolvedTarget}
rel={resolvedRel}
aria-label={ariaLabel}
class:list={[
'inline-flex items-center box-border rounded border border-border bg-surface px-3 py-1.5',
'font-mono text-sm text-ink no-underline transition-colors',
'hover:bg-surface-raised hover:border-ink-faint',
'focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2',
className,
]}
>
<slot>{label}</slot>
</a>