Scroll Progress
A bar or ring that tracks how far a scroll container has been read.
Import
import { ScrollProgress } from "@cronus-ui/ui";
npx cronus-ui add scroll-progress
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component ScrollProgressDefault layout:inline style:scroll-progress {
value:40
aria-label:"Scroll progress"
label "Scroll progress"
}
page "/audit/scroll-progress/default" type:custom {
use ScrollProgressDefault
}
API Reference
Generated from the component's exported types.
ScrollProgressProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
variant | ScrollProgressVariant | "bar" | Render a thin horizontal bar or a circular ring. |
target | RefObject<HTMLElement | null> | — | The scroll container to track. When omitted, the window / document scrolling element is tracked instead. |
position | ScrollProgressPosition | "top" | Where to pin the bar variant (ignored for the circle). |
size | number | 40 | Diameter of the ring in px (circle variant only). |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |