Scroll Effects
import { StickyScroll, HorizontalScroll, ScrollZoom, SmoothScroll } from "pleate/effects/scroll";Sticky steps
Four steps of a trip plan. The visual for the step in the middle of the screen stays pinned beside it.
Pick your dates
Choose the nights you are away. Fares and stays update for that window.June 20271213141516171814 to 17 June, 3 nights
Set the route
Add stops in order. Travel time between them is worked out for you.RouteLisbonstartPorto2 h 50 minDouro valley1 h 35 minBook the stays
One place per stop, with the nights already matched to the route.StaysCasa do Rio, Porto2 nights · €286Quinta Nova, Pinhão1 night · €174Share the plan
Send one link. Everyone sees the same dates, route and bookings.Trip total€1,840Travellers2Shared withmarta@ferreira.pt
14 to 17 June, 3 nights
Horizontal row
Scrolling down moves the destinations sideways. On phones it is a swipeable row.
Scroll zoom
The frame opens to full width and squares its corners as it reaches the middle.
Scroll down. The frame opens up as it reaches the middle of the screen.
Three nights, two stays, one river.
Smooth scrolling
Turn it on, then scroll this page with a mouse wheel.
Turn it on and scroll with a mouse wheel. Keyboard, touch screens, zoom and scrollable panels keep their native behaviour. It stays off with reduced motion.
Props
- StickyScroll
Steps on the left, the active step's visual pinned on the right. Below md each visual sits under its step.
steps: { id, title, body, visual }[], offset, className- HorizontalScroll
Pins the section and moves its items sideways. Its height comes from the width of the row.
children, gap (16), offset, label, className- ScrollZoom
Scales and unclips the media from a rounded frame to full width. The caption fades in at the end.
children, caption, className- SmoothScroll
Eases mouse-wheel scrolling of the window while it is mounted.
lerp (0.1), wheelMultiplier (1), children- offset
Height of a sticky header above, so pinned content sits below it.
number (px)
Accessibility
- The active step has aria-current="step". All step text stays in the reading order.
- HorizontalScroll is a named region. Focusing an item that is off to the side scrolls the page to it. The swipeable row can be focused and scrolled with the arrow keys.
- SmoothScroll handles only the mouse wheel. Keyboard, scrollbar dragging, zoom, touch and panels that can scroll themselves stay native.
- Reduced motion: SmoothScroll is off, the sticky visuals swap without movement, the row becomes a native scrolling row and ScrollZoom shows the media at full size.