scrollable.svelte.ts

Declarations
#

2 declarations

view source

Scrollable
#

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

readonly

constructor

type new (params?: ScrollableParameters | undefined): Scrollable

params?
type ScrollableParameters | undefined
optional

container

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

ScrollableParameters
#

scrollable.svelte.ts view source

ScrollableParameters

target_class

CSS class to apply to the target element when scrolled. Defaults to 'scrolled'.

type string

threshold

Threshold in pixels before considering the element scrolled. Defaults to 0.

type number

Imported by
#