Lewati ke konten
MarkasUI
Ketik untuk mencari

    Panduan

    MarkasUI

    Form

    Feedback

    Overlay

    Navigasi

    Data

    Section

    Animasi

    Latar

    Tombol

    Template

    Halaman

    Scroll Progress

    Bar tipis di atas halaman atau kontainer bergulir yang terisi seiring pembaca menggulir.

    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";
    }

    Contoh

    Log percakapan

    • 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.

    Warna

    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.

    Progres baca halaman

    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.

    Instalasi

    npx markasui@latest add scroll-progress

    Pemakaian

    {{-- Progres baca seluruh halaman --}}
    <x-markas.scroll-progress />
    
    {{-- Di dalam kontainer bergulir --}}
    <div role="region" aria-label="Catatan rilis" 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="Catatan rilis" tabIndex={0} className="relative h-64 overflow-y-auto">
      <ScrollProgress target="parent" color="success" size="md" />
      ...
    </div>
    <template>
      <ScrollProgress />
    
      <div
        role="region"
        aria-label="Catatan rilis"
        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" menempel di atas jendela. target="parent" sticky di dalam induknya dan harus menjadi anak pertama.
    • Pembaruan digabung dengan requestAnimationFrame dan hanya berjalan saat menggulir. Versi Blade butuh Alpine.js.
    • Bar bersifat dekoratif (aria-hidden). Buat kontainer bergulir bisa difokus dan punya nama agar pengguna keyboard bisa menggulirnya.

    Props

    NamaTipeDefaultKeterangan
    target'page' | 'parent'pagepage menempelkan bar di atas jendela dan mengikuti gulir halaman. parent membuatnya sticky di dalam elemen induk dan mengikuti gulir elemen itu.
    color'primary' | 'success' | 'warning' | 'danger'primaryWarna bar.
    size'sm' | 'md' | 'lg'smTebal bar 2, 4, atau 6 piksel.

    Aksesibilitas

    • Bar bersifat dekoratif dan memakai aria-hidden; posisi gulir sudah tersedia bagi teknologi bantu.
    • Kontainer bergulir untuk target parent sebaiknya bisa difokus (tabindex 0) dan punya nama, agar pengguna keyboard bisa menggulirnya.
    • Bar mengikuti posisi gulir secara langsung tanpa animasi, jadi reduced motion tidak butuh penanganan khusus.

    Komponen terkait

    Komponen animasi lain dengan class yang sama di setiap framework.