SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

scrollShadow

Gives a sticky header a scroll-driven shadow, so it reads as elevated only once content has scrolled beneath it.

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

Usage

Gives a sticky header a scroll-driven shadow, so it reads as elevated only once content has scrolled beneath it. Reduced motion pins the shadow on; engines without scroll timelines leave the header flat.

Signature

typescript
scrollShadow(options?: ScrollShadow.Options): CSSMixinDescriptor

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

Parameters

ParameterTypeDefaultRequiredDescription
optionsScrollShadow.Options—NoTuning for how quickly the shadow settles in.

Examples

tsx
mix={scrollShadow({ distance: "80px" })}

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

Interface

ScrollShadow.Options

Options controlling how far a sticky element's own scroll container must scroll before its shadow fully settles in.

MemberTypeDefaultRequiredDescription
distancestring—NoCSS length the shadow ramps in over, measured from the top of the tracked scroll container. Defaults to "120px".
@sdxc/ui

Can’t find it? Contact us