sveltekit-link

Svelte action for more intelligent links in Sveltekit

Usage no npm install needed!

<script type="module">
  import sveltekitLink from 'https://cdn.skypack.dev/sveltekit-link';
</script>

README

Sveltekit Link

npm npm bundle size License

Sveltekit Link is a Svelte action for creating more intelligent link elements in Sveltekit.

Features

  • Automatically detects if a link is outbound and applies target="_blank" and rel="noopener noreferrer
  • Automatically detects if a link is internal and applies Sveltekit's prefetching on hover and mobile tap

Usage

npm i sveltekit-link
<script>
  import link from 'sveltekit-link';
</script>

<a use:link href="some-link">Click me</a>