scrollable.svelte.ts view source
Manages scroll state and provides attachments for scroll detection and styling.
target_class
CSS class name to apply when scrolled.
type string
threshold
Threshold in pixels before considering the element scrolled.
type number
scroll_y
The current scroll Y position.
type number
scrolled
Whether element is scrolled past threshold.
type boolean
constructor
type new (params?: ScrollableParameters | undefined): Scrollable
params?
ScrollableParameters | undefinedcontainer
Attachment for the scrollable container - detects scrolling and updates state.
type Attachment
target
Attachment for the element that should receive the scrolled class. Since attachments run in effects, the class updates will be reactive automatically.
type Attachment