SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

scrollProgress

Grows a fill element in lockstep with its scrollable ancestor's scroll position, from the inline-start edge so it reads correctly in both writing directions.

tsx
import { scrollProgress } from "@sdxc/ui/animations";

Usage

Grows a fill element in lockstep with its scrollable ancestor's scroll position, from the inline-start edge so it reads correctly in both writing directions. Nest it in a fixed-size track; reduced motion ramps opacity.

Signature

typescript
scrollProgress(options?: ScrollProgress.Options): CSSMixinDescriptor

Returns a style mixin, applicable through a host element's mix prop.

Parameters

ParameterTypeDefaultRequiredDescription
optionsScrollProgress.Options—NoSelects the scroll axis the indicator tracks.

Examples

tsx
mix={scrollProgress({ axis: "inline" })}

The events, constants and types its module publishes, each imported from @sdxc/ui/animations too.

Interface

ScrollProgress.Options

Options selecting which scroll axis a progress indicator tracks.

MemberTypeDefaultRequiredDescription
axis"block" | "inline"—NoScroll axis the indicator's timeline attaches to: "block" tracks vertical scroll (a reading-progress bar), "inline" horizontal scroll (a Carousel viewport). Defaults to "block".
@sdxc/ui

Can’t find it? Contact us