Effects JS behaviour

Scroll progress

A hairline reading-progress bar across the top, or a ring that is the back-to-top button; CSS scroll-driven animations with a JavaScript fallback for one article or a scrolling box.

Real scenarios

The component as it is used in a product — not a specimen grid.

Blog post in a reading pane

The page has its own bar at the very top of the window. This box scrolls on its own: its bar sticks to the top of the box, and the ring at the bottom fills as you read — press it to jump back up.

What a spring cleaning taught our product

6 min read

For us, Nowruz is not only the start of a year; it is a chance to look again at everything that piled up during it. This note is about that review — of the product, the team and the way we work.

Three months ago we decided to judge every panel page by one simple question: does a user understand what this page is for within five seconds? For half of the pages the answer was no.

The first change was removal. Filters nobody used, columns that were there only for completeness, buttons repeated three times.

The second change was motion. We put motion only where it explains something: a panel that opens out of its button, a list that closes the gap a deleted item leaves.

And the third change was language. We read everything once in Persian and once in English to make sure the layout sits right in both directions.

The result? Time to first useful action went from 40 seconds to 12. More importantly, “where is that button?” tickets nearly vanished.

For us, Nowruz is not only the start of a year; it is a chance to look again at everything that piled up during it. This note is about that review — of the product, the team and the way we work.

Three months ago we decided to judge every panel page by one simple question: does a user understand what this page is for within five seconds? For half of the pages the answer was no.

The first change was removal. Filters nobody used, columns that were there only for completeness, buttons repeated three times.

The second change was motion. We put motion only where it explains something: a panel that opens out of its button, a list that closes the gap a deleted item leaves.

And the third change was language. We read everything once in Persian and once in English to make sure the layout sits right in both directions.

The result? Time to first useful action went from 40 seconds to 12. More importantly, “where is that button?” tickets nearly vanished.

Important props

Important props
Prop Type Default What it does
variant string 'bar' bar, or circle (a back-to-top button whose ring fills).
target string null Selector of the article whose own reading progress is measured.
container string null Selector of a scrolling box; pair with position="sticky".
position string 'fixed' fixed · sticky · static.
label string 'Reading progress' Accessible name of the bar, or of the circle button.

Snippet

<x-nx::scroll-progress label="پیشرفت مطالعه" />
<x-nx::scroll-progress variant="circle" label="بازگشت به بالا" />

<article id="post">…</article>
<x-nx::scroll-progress target="#post" />