Link Spread

An absolutely positioned anchor that makes an entire container clickable.

Loading preview…

Installation

Usage

Place link spread inside a relatively positioned parent to make the whole card surface clickable while keeping the card content visible and accessible. Always pass an aria-label, because the anchor has no visible text of its own.

1<script lang="ts">
2	import LinkSpread from '~/components/link-spread/link-spread.svelte';
3</script>
4
5<article class="relative">
6	<h3>Card title</h3>
7	<p>Card copy</p>
8	<LinkSpread href="/details" aria-label="Open details" />
9</article>