🚀  Astro — URLs prefetching on hover


This component capture mouse hovering on links with internal URLs. Then, it will prefetch the HTML document beforehand.

Keywords:

  • astro
  • astro-component
  • native
  • vanilla
  • prefetch
  • javascript
  • links

Component live demo

Hover links below!

🚀  Astro — URLs prefetching on hover

NPM Downloads ISC License PRs Welcome
Astro TypeScript Prettier EditorConfig ESLint

This component capture mouse hovering on links with internal URLs.
Then, it will prefetch the HTML document beforehand.

The goal is to make further page loading snappier.
It's useful with SSG but also with SSR in certain scenarios.

It plays well with this page transition component:
astro-page-transition

📦  Installation

pnpm i astro-hover-prefetch

🛠  Usage

---
import { HoverPrefetch } from 'astro-hover-prefetch';
// ...
---
<!-- ... -->
<head>
  <!-- Place component inside `HEAD` tag -->

  <!-- 'max' property is optional -->
  <HoverPrefetch max={8} />

  <!-- ... -->
</head>

TypeScript API


name
type
required
default
max
number
false
8

Changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.6 (2023-01-05)

Note: Version bump only for package astro-hover-prefetch

1.0.5 (2022-11-19)

Note: Version bump only for package astro-hover-prefetch

1.0.4 (2022-10-17)

Bug Fixes

  • correct astro component import (2c5b896)
  • licenses report scope (3df8f4f)

1.0.3 (2022-10-17)

Bug Fixes

  • remove package prefix, simplify import method (73bd31b)

0.12.4 (2022-09-22)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.12.3 (2022-08-20)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.12.2 (2022-07-31)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.12.1 (2022-07-24)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.12.0 (2022-07-18)

Features

  • ts properties extractor for docs (9a8e65e)

Bug Fixes

0.11.0 (2022-06-28)

Features

  • better defaults properties (cc55aec)

0.10.12 (2022-06-26)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.10.11 (2022-06-25)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.10.10 (2022-06-22)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.10.9 (2022-06-22)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.10.8 (2022-06-21)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.10.7 (2022-06-20)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.10.6 (2022-06-20)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.10.5 (2022-06-19)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.10.4 (2022-06-19)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.10.3 (2022-06-19)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.10.2 (2022-06-19)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.10.1 (2022-06-19)

Note: Version bump only for package @julian_cataldo/astro-prefetch

0.10.0 (2022-06-19)

Features

  • init app prefetch component (7bc7f9f)
...

⚠️  Having an issue? / 🗣   Wanna share feedback or suggestion?

✍️  Open an Issue or a Pull Request   on GitHub -or-   Contact me   on my Website.