Navigation Fancy Stable

ScrollProgress

Thin reading-progress bar that fills as the page — or a target element — scrolls, driven by a zero-JS CSS scroll-timeline where supported and a throttled scroll listener everywhere else, with an optional accessible progressbar label

Preview

Installation

pnpm add fancy-ui-svelte
import { ScrollProgress } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { ScrollProgress } from 'fancy-ui-svelte';
</script>

<ScrollProgress />

Examples

Basic Usage

Labelled

Accessible role="progressbar" with a live percentage readout.

Props

PropTypeDefaultDescription
target HTMLElement | nullnullAn element to track instead of the document. Forces JS mode — reactively, so a target that only becomes available after mount is still picked up correctly.
position "top" | "bottom" | "inline""top""top"/"bottom" pin the bar to that viewport edge (position: fixed); "inline" renders it in normal flow.
label string-Announces the bar as role="progressbar" with this accessible name. Forces JS mode; omitted, the bar is aria-hidden.
class string-Additional CSS classes
ref HTMLDivElement | nullnullBindable reference to the root element