ISticky

interface
Layout & Sizing

Return shape of the useSticky composable. Exposes the root element ref, a reactive flag indicating whether the component is currently stuck, and the computed CSS styles for the layout item slot.

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

rootEl
required
Ref<HTMLElement | undefined>
Template ref to the sticky component root element, used to measure its dimensions for the layout item slot.
isSticky
required
Ref<boolean>
True when the component has passed its scroll threshold and is currently in its sticky (fixed) position.
layoutItemStyles
required
Ref<CSSProperties>
Reactive CSS properties object (height, top, etc.) provided to the Nuxt/layout slot to preserve the space the sticky component occupies in the normal flow.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Consuming ISticky from useSticky

typescript