Scroll Progress
How far the reader got: a bar that fills or a ring that closes as the page or a container scrolls.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
for | string | — | The id of the scroll container to follow (a c2-scroll-area works). Without it: the page. |
variant | 'bar' | 'ring' | bar | A thin bar that fills, or a ring that closes. |
label | string | — | The accessible name. |
Slots
| Name | Description |
|---|---|
(default) | The centre of a ring (an icon, a "back to top" button). |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
track | The unfilled part. |
fill | The filled part. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-scroll-progress--thickness | pixel | 3px | The bar's height. |
--c2-scroll-progress--border-radius | border-radius | 0 | |
--c2-scroll-progress__track--color | color | #e4e4e7 | transparent hides the unfilled part. |
--c2-scroll-progress__fill--color | color | #0265dc | |
--c2-scroll-progress__ring--size | pixel | 40px | |
--c2-scroll-progress__ring--stroke-width | pixel | 3 | |
--c2-scroll-progress__ring__track--color | color | #e4e4e7 | |
Text and languages
The text the component shows, in English. It shows another language when the app adds one with addTranslations, under scroll-progress, and the nearest lang asks for it; any message not translated stays in English. {0}, {1}… stand for the values a message carries. Languages guide.
| Key | English | Values |
|---|---|---|
label | Reading progress | — |