Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Scroll Progress

    Thin bar at the top of the page or a scrolling container that fills as the reader scrolls.

    Release notes 2.4

    Marquee, number ticker, and typing text join the animation category. Every animation stops when the reader prefers reduced motion.

    Avatar group now spreads out on hover and shows each name in a small tooltip. Hidden members are listed on the plus chip.

    Scroll progress follows the page or the nearest scrolling container, so it works in modals, drawers, and long side panels.

    Spotlight card lights up its border where the pointer is, and keeps the glow centered when a keyboard user tabs into it.

    Release notes 2.4

    Marquee, number ticker, and typing text join the animation category. Every animation stops when the reader prefers reduced motion.

    Avatar group now spreads out on hover and shows each name in a small tooltip. Hidden members are listed on the plus chip.

    Scroll progress follows the page or the nearest scrolling container, so it works in modals, drawers, and long side panels.

    Spotlight card lights up its border where the pointer is, and keeps the glow centered when a keyboard user tabs into it.

    Release notes 2.4

    Marquee, number ticker, and typing text join the animation category. Every animation stops when the reader prefers reduced motion.

    Avatar group now spreads out on hover and shows each name in a small tooltip. Hidden members are listed on the plus chip.

    Scroll progress follows the page or the nearest scrolling container, so it works in modals, drawers, and long side panels.

    Spotlight card lights up its border where the pointer is, and keeps the glow centered when a keyboard user tabs into it.

    Release notes 2.4

    Marquee, number ticker, and typing text join the animation category. Every animation stops when the reader prefers reduced motion.

    Avatar group now spreads out on hover and shows each name in a small tooltip. Hidden members are listed on the plus chip.

    Scroll progress follows the page or the nearest scrolling container, so it works in modals, drawers, and long side panels.

    Spotlight card lights up its border where the pointer is, and keeps the glow centered when a keyboard user tabs into it.

    Release notes 2.4

    Marquee, number ticker, and typing text join the animation category. Every animation stops when the reader prefers reduced motion.

    Avatar group now spreads out on hover and shows each name in a small tooltip. Hidden members are listed on the plus chip.

    Scroll progress follows the page or the nearest scrolling container, so it works in modals, drawers, and long side panels.

    Spotlight card lights up its border where the pointer is, and keeps the glow centered when a keyboard user tabs into it.

    @php
        $box = 'relative h-56 overflow-y-auto rounded-xl border border-line bg-surface focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary';
    @endphp
    
    <div role="region" aria-label="Release notes" tabindex="0" class="{{ $box }}">
        <x-markas.scroll-progress target="parent" />
        <article class="space-y-3 p-5 text-sm text-muted">
            <h3 class="text-base font-semibold text-ink">Release notes 2.4</h3>
            <p>
                Marquee, number ticker, and typing text join the animation category.
                Every animation stops when the reader prefers reduced motion.
            </p>
            <p>
                Avatar group now spreads out on hover and shows each name in a small
                tooltip. Hidden members are listed on the plus chip.
            </p>
            <p>
                Scroll progress follows the page or the nearest scrolling container,
                so it works in modals, drawers, and long side panels.
            </p>
            <p>
                Spotlight card lights up its border where the pointer is, and keeps
                the glow centered when a keyboard user tabs into it.
            </p>
        </article>
    </div>
    import { ScrollProgress } from "@/components/markas/ScrollProgress";
    
    const box =
      "relative h-56 overflow-y-auto rounded-xl border border-line bg-surface focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
    
    export default function ScrollProgressExample() {
      return (
        <div role="region" aria-label="Release notes" tabIndex={0} className={box}>
          <ScrollProgress target="parent" />
          <article className="space-y-3 p-5 text-sm text-muted">
            <h3 className="text-base font-semibold text-ink">Release notes 2.4</h3>
            <p>
              Marquee, number ticker, and typing text join the animation category.
              Every animation stops when the reader prefers reduced motion.
            </p>
            <p>
              Avatar group now spreads out on hover and shows each name in a small
              tooltip. Hidden members are listed on the plus chip.
            </p>
            <p>
              Scroll progress follows the page or the nearest scrolling container,
              so it works in modals, drawers, and long side panels.
            </p>
            <p>
              Spotlight card lights up its border where the pointer is, and keeps
              the glow centered when a keyboard user tabs into it.
            </p>
          </article>
        </div>
      );
    }
    <script setup lang="ts">
    import ScrollProgress from "@/components/markas/ScrollProgress.vue";
    
    const box =
      "relative h-56 overflow-y-auto rounded-xl border border-line bg-surface focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
    </script>
    
    <template>
      <div role="region" aria-label="Release notes" tabindex="0" :class="box">
        <ScrollProgress target="parent" />
        <article class="space-y-3 p-5 text-sm text-muted">
          <h3 class="text-base font-semibold text-ink">Release notes 2.4</h3>
          <p>
            Marquee, number ticker, and typing text join the animation category.
            Every animation stops when the reader prefers reduced motion.
          </p>
          <p>
            Avatar group now spreads out on hover and shows each name in a small
            tooltip. Hidden members are listed on the plus chip.
          </p>
          <p>
            Scroll progress follows the page or the nearest scrolling container, so
            it works in modals, drawers, and long side panels.
          </p>
          <p>
            Spotlight card lights up its border where the pointer is, and keeps the
            glow centered when a keyboard user tabs into it.
          </p>
        </article>
      </div>
    </template>
    <script lang="ts">
      import ScrollProgress from "$lib/components/markas/ScrollProgress.svelte";
    
      const box =
        "relative h-56 overflow-y-auto rounded-xl border border-line bg-surface focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
    </script>
    
    <!-- svelte-ignore a11y_no_noninteractive_tabindex -->
    
    <div role="region" aria-label="Release notes" tabindex="0" class={box}>
      <ScrollProgress target="parent" />
      <article class="space-y-3 p-5 text-sm text-muted">
        <h3 class="text-base font-semibold text-ink">Release notes 2.4</h3>
        <p>
          Marquee, number ticker, and typing text join the animation category. Every
          animation stops when the reader prefers reduced motion.
        </p>
        <p>
          Avatar group now spreads out on hover and shows each name in a small
          tooltip. Hidden members are listed on the plus chip.
        </p>
        <p>
          Scroll progress follows the page or the nearest scrolling container, so it
          works in modals, drawers, and long side panels.
        </p>
        <p>
          Spotlight card lights up its border where the pointer is, and keeps the
          glow centered when a keyboard user tabs into it.
        </p>
      </article>
    </div>
    ---
    import ScrollProgress from "@/components/markas/ScrollProgress.astro";
    
    const box =
      "relative h-56 overflow-y-auto rounded-xl border border-line bg-surface focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
    ---
    
    <div role="region" aria-label="Release notes" tabindex="0" class={box}>
      <ScrollProgress target="parent" />
      <article class="space-y-3 p-5 text-sm text-muted">
        <h3 class="text-base font-semibold text-ink">Release notes 2.4</h3>
        <p>
          Marquee, number ticker, and typing text join the animation category.
          Every animation stops when the reader prefers reduced motion.
        </p>
        <p>
          Avatar group now spreads out on hover and shows each name in a small
          tooltip. Hidden members are listed on the plus chip.
        </p>
        <p>
          Scroll progress follows the page or the nearest scrolling container, so
          it works in modals, drawers, and long side panels.
        </p>
        <p>
          Spotlight card lights up its border where the pointer is, and keeps the
          glow centered when a keyboard user tabs into it.
        </p>
      </article>
    </div>
    import { Component } from "@angular/core";
    import { ScrollProgress } from "./markas/scroll-progress.component";
    
    @Component({
      selector: "markas-example",
      imports: [ScrollProgress],
      template: `
        <div role="region" aria-label="Release notes" tabindex="0" [class]="box">
          <div markas-scroll-progress target="parent"></div>
          <article class="space-y-3 p-5 text-sm text-muted">
            <h3 class="text-base font-semibold text-ink">Release notes 2.4</h3>
            <p>
              Marquee, number ticker, and typing text join the animation category.
              Every animation stops when the reader prefers reduced motion.
            </p>
            <p>
              Avatar group now spreads out on hover and shows each name in a small
              tooltip. Hidden members are listed on the plus chip.
            </p>
            <p>
              Scroll progress follows the page or the nearest scrolling container,
              so it works in modals, drawers, and long side panels.
            </p>
            <p>
              Spotlight card lights up its border where the pointer is, and keeps
              the glow centered when a keyboard user tabs into it.
            </p>
          </article>
        </div>
      `,
    })
    export default class ScrollProgressExample {
      protected readonly box =
        "relative h-56 overflow-y-auto rounded-xl border border-line bg-surface focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
    }

    Examples

    Chat log

    • Hi, the invoice for October is ready.
    • Thanks. Can you add the design hours too?
    • Sure, I added 12 hours for the dashboard work.
    • Perfect. Please send it to finance by Friday.
    • Sent. They confirmed it this morning.
    • Great, closing this thread then.
    • Hi, the invoice for October is ready.
    • Thanks. Can you add the design hours too?
    • Sure, I added 12 hours for the dashboard work.
    • Perfect. Please send it to finance by Friday.
    • Sent. They confirmed it this morning.
    • Great, closing this thread then.
    • Hi, the invoice for October is ready.
    • Thanks. Can you add the design hours too?
    • Sure, I added 12 hours for the dashboard work.
    • Perfect. Please send it to finance by Friday.
    • Sent. They confirmed it this morning.
    • Great, closing this thread then.
    • Hi, the invoice for October is ready.
    • Thanks. Can you add the design hours too?
    • Sure, I added 12 hours for the dashboard work.
    • Perfect. Please send it to finance by Friday.
    • Sent. They confirmed it this morning.
    • Great, closing this thread then.
    • Hi, the invoice for October is ready.
    • Thanks. Can you add the design hours too?
    • Sure, I added 12 hours for the dashboard work.
    • Perfect. Please send it to finance by Friday.
    • Sent. They confirmed it this morning.
    • Great, closing this thread then.

    Colors

    Draft

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    In review

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    Blocked

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    Draft

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    In review

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    Blocked

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    Draft

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    In review

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    Blocked

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    Draft

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    In review

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    Blocked

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    Draft

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    In review

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    Blocked

    Scroll this panel to fill the bar above it.

    The bar color follows the status of the list.

    Set size for a thicker bar.

    Page reading progress

    5 min read

    Designing tokens that survive dark mode

    Without a target, the bar is fixed to the top of the window and fills as the reader scrolls through the whole page.

    5 min read

    Designing tokens that survive dark mode

    Without a target, the bar is fixed to the top of the window and fills as the reader scrolls through the whole page.

    5 min read

    Designing tokens that survive dark mode

    Without a target, the bar is fixed to the top of the window and fills as the reader scrolls through the whole page.

    5 min read

    Designing tokens that survive dark mode

    Without a target, the bar is fixed to the top of the window and fills as the reader scrolls through the whole page.

    5 min read

    Designing tokens that survive dark mode

    Without a target, the bar is fixed to the top of the window and fills as the reader scrolls through the whole page.

    Installation

    npx markasui@latest add scroll-progress

    Usage

    {{-- Reading progress for the whole page --}}
    <x-markas.scroll-progress />
    
    {{-- Inside a scrolling container --}}
    <div role="region" aria-label="Release notes" tabindex="0" class="relative h-64 overflow-y-auto">
        <x-markas.scroll-progress target="parent" color="success" size="md" />
        ...
    </div>
    import { ScrollProgress } from "@/components/markas/ScrollProgress";
    
    <ScrollProgress />
    
    <div role="region" aria-label="Release notes" tabIndex={0} className="relative h-64 overflow-y-auto">
      <ScrollProgress target="parent" color="success" size="md" />
      ...
    </div>
    <template>
      <ScrollProgress />
    
      <div
        role="region"
        aria-label="Release notes"
        tabindex="0"
        class="relative h-64 overflow-y-auto"
      >
        <ScrollProgress target="parent" color="success" size="md" />
        ...
      </div>
    </template>
    <script lang="ts">
      import ScrollProgress from "$lib/components/markas/ScrollProgress.svelte";
    </script>
    
    <ScrollProgress />
    
    <div
      role="region"
      aria-label="Release notes"
      tabindex="0"
      class="relative h-64 overflow-y-auto"
    >
      <ScrollProgress target="parent" color="success" size="md" />
      ...
    </div>
    ---
    import ScrollProgress from "@/components/markas/ScrollProgress.astro";
    ---
    
    <ScrollProgress />
    
    <div
      role="region"
      aria-label="Release notes"
      tabindex="0"
      class="relative h-64 overflow-y-auto"
    >
      <ScrollProgress target="parent" color="success" size="md" />
      ...
    </div>
    import { Component } from "@angular/core";
    import { ScrollProgress } from "./markas/scroll-progress.component";
    
    @Component({
      selector: "app-release-notes",
      imports: [ScrollProgress],
      template: `
        <div
          role="region"
          aria-label="Release notes"
          tabindex="0"
          class="relative h-64 overflow-y-auto"
        >
          <div
            markas-scroll-progress
            target="parent"
            color="success"
            size="md"
          ></div>
          ...
        </div>
      `,
    })
    export class ReleaseNotes {}
    • target="page" is fixed to the top of the window. target="parent" is sticky inside its parent and must be its first child.
    • Updates are batched with requestAnimationFrame and only run while scrolling. The Blade version needs Alpine.js.
    • The bar is decorative (aria-hidden). Make the scrolling container focusable and named so keyboard users can scroll it.

    Props

    NameTypeDefaultDescription
    target'page' | 'parent'pagepage fixes the bar to the top of the window and follows the page scroll. parent makes it sticky inside its parent element and follows that element's scroll.
    color'primary' | 'success' | 'warning' | 'danger'primaryBar color.
    size'sm' | 'md' | 'lg'smBar thickness of 2, 4, or 6 pixels.

    Accessibility

    • The bar is decorative and aria-hidden; the scroll position is already available to assistive technology.
    • A scrolling container used with target parent should be focusable (tabindex 0) and named, so keyboard users can scroll it.
    • The bar follows the scroll position directly, without animation, so reduced motion needs no special handling.

    Related components

    More animations components with the same classes in every framework.