MagicScrollOptions
Defaults for an application or overrides for one magicScroll region.
Properties
Section titled “Properties”activationThreshold?
Section titled “activationThreshold?”
optionalactivationThreshold?:number
Relative activation threshold (0.0 to 1.0) defining the trigger line within the visible reading area.
anchorPrefixes?
Section titled “anchorPrefixes?”
optionalanchorPrefixes?: readonlystring[] |string[]
Allowed anchor ID prefixes. Descendant elements matching any prefix participate.
Explicit scrollAnchor markers also participate.
Passing an empty array [] disables prefix matching so only explicit markers participate.
anchorSelection?
Section titled “anchorSelection?”
optionalanchorSelection?:AnchorSelectionMode
Selection strategy for anchor discovery.
'all': Selects elements matching prefixes or explicit markers (default).'explicit': Selects only elements with explicitscrollAnchormarkers.
behavior?
Section titled “behavior?”
optionalbehavior?:object
Restoration and deliberate user navigation have separate defaults.
interaction?
Section titled “interaction?”
optionalinteraction?:ScrollBehavior
restoration?
Section titled “restoration?”
optionalrestoration?:ScrollBehavior
bottomOffset?
Section titled “bottomOffset?”
optionalbottomOffset?:number
Bottom offset in pixels to adjust the active reading boundary from the bottom.
debounceTime?
Section titled “debounceTime?”
optionaldebounceTime?:number
headerOffset?
Section titled “headerOffset?”
optionalheaderOffset?:number
Gap below the header, or the complete top offset when no header is selected.
headerSelector?
Section titled “headerSelector?”
optionalheaderSelector?:string
Selector for a fixed/sticky header whose height is measured automatically.
ignoreWhenInView?
Section titled “ignoreWhenInView?”
optionalignoreWhenInView?:"none"|"top"|"full"|"always"
preserveOnLayoutChange?
Section titled “preserveOnLayoutChange?”
optionalpreserveOnLayoutChange?:boolean
Preserve anchor-relative reading position when region content reflows (e.g. image loads, form expansions, accordion toggles) without changing scrollSource. Defaults to false (explicit opt-in).
preserveOnResize?
Section titled “preserveOnResize?”
optionalpreserveOnResize?:boolean
Preserve the current anchor on window resize and measured header-height changes.
restoreOnDataChange?
Section titled “restoreOnDataChange?”
optionalrestoreOnDataChange?:boolean
Keep the current anchor visible after later data updates. Defaults to true.
