Skip to content
Onycx-ui
ESC

Sticky Scrollytelling

Keep a photo in view while alternating text cards tell the story alongside it.

Dependencies
No extra packages
Size
132 lines
Controls
5 controls

Installation

CLI · shadcn registry

npx shadcn@latest add https://ui.onycx.dev/r/sticky-scrollytelling.json

1 · Dependencies

None beyond React and Tailwind.

2 · Copy the source

components/onycx/sticky-scrollytelling.tsx

Requires React 19 and Tailwind CSS v4. Copy the source from the sticky-scrollytelling.tsx tab after tweaking: your values are baked in as the new defaults. Exported image examples use portable sample artwork. Replace it with your own media as needed.

Props

PropTypeDefaultDescription
blocksStoryBlock[]—{ title, body, image? } per block; an image swaps the background while that block is mid-screen.
imagestring"/media/ceramics-scenes/kiln-firing.webp"Sticky background photograph (decorative). Replace with your own.
imageOpacitynumber0.3Opacity of the background photograph.
blockHeightnumber120Height of each story block in vh.
background / ink / mutedstring"#0c0a09" / "#f7f3ed" / "#d9ccb5"Section colour (also the top and bottom fades), title and body colours.