SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

scrollFade

Fades a scroll container's own edges through a mask on the scrolling element itself.

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

Usage

Fades a scroll container's own edges through a mask on the scrolling element itself: each edge reads opaque once scroll reaches it and feathers while content lies beyond. Without scroll timelines both edges stay faded.

Signature

typescript
scrollFade<node extends Element = Element>(options?: ScrollFade.Options): UtilityMixin<node>

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

Parameters

ParameterTypeDefaultRequiredDescription
optionsScrollFade.Options—NoSelects the scroll axis the fade tracks and how wide each faded band reads.

Examples

tsx
<MessageScroller.Viewport mix={scrollFade({ axis: "block" })}>
	{messages}
</MessageScroller.Viewport>
tsx
<Attachment.Group mix={scrollFade({ axis: "inline", size: "2rem" })}>
	{attachments}
</Attachment.Group>

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

Interface

ScrollFade.Options

Options tuning which edges a scroll container's own mask-driven fade tracks and how wide each faded band reads.

MemberTypeDefaultRequiredDescription
axis"block" | "inline"—NoScroll axis the fade's timeline attaches to: "block" fades the top and bottom edges of a vertically scrolling list, "inline" the start and end edges of a horizontally scrolling row. Defaults to "block".
sizestring—NoCSS length each faded band extends inward from its edge. Defaults to "3rem".
@sdxc/ui

Can’t find it? Contact us