ScrollPremium

Slide In

Six full-width blocks that slide 60 px while fading in as they enter a 280 px frame. The side has nothing to do with rank: the block's class decides, .sb-slidein-left comes from the left, .sb-slidein-right from the right. animation-timeline: view(), slide completed at mid-entry (39 px), zero JavaScript.

CSSSlideScroll

Updated

This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Scroll has 74 effects, including 12 free. Explore the category →

3 usage examples

Conversation with the vet on duty — a veterinary clinic's messaging — Slide In example 1

① Conversation with the vet on duty — a veterinary clinic's messaging

WhenMessaging of a veterinary clinic on a duty night: the animal's record on the left of the screen, on the right the conversation thread that the owner scrolls back through before setting off.
WhyThe vet's messages come from the left, the owner's from the right: the side of the slide repeats who is speaking. She writes two messages in a row, both from the left — impossible with rank-based alternation, natural with one class per bubble.
SettingsThe code's animation untouched (±60 px, range entry entry 50%). A 374 × 264 px area, ten bubbles capped at 78% of the width (50 to 85 px tall, so 25 to 42 px of sliding), aligned left or right with align-self. In the capture a timer in the scene scrolls the thread at 46 px/s.
Arguments for and against a cycle lane — a public consultation page — Slide In example 2

② Arguments for and against a cycle lane — a public consultation page

WhenPage of a public consultation on a cycle lane project: the question at the top, then two columns of arguments posted by residents, “for” on the left and “against” on the right, with their number of supporters.
WhyEach argument enters from the edge of its column and the two meet in the middle: the face-to-face layout becomes a motion. The class follows the argument's camp, not its place in the list — one column can be longer than the other without breaking anything.
SettingsThe code's animation untouched. A 540 × 244 px area, the tray turned into a two-column grid (10 and 12 px gaps), ten cards 246 px wide and 92 to 108 px tall: the slide lasts 46 to 54 px. Green edge on the left for “for”, red on the right for “against”. Capture scrolling: 48 px/s, by timer.
Today's ins and outs — stock log of a neighbourhood food bank — Slide In example 3

③ Today's ins and outs — stock log of a neighbourhood food bank

WhenStoreroom dashboard of a food bank: the day's totals and the week's chart on the left, and on the right a narrow “Movements” panel where the day's lines scroll by, hour by hour.
WhyIn a 235 px panel there is no room for a “type” column. Donations enter from the left, distributions from the right: the volunteer scrolling sees the direction of each movement before reading the figure, and the sign (+ or −) confirms it.
SettingsThe code's animation untouched. A 235 × 276 px panel, twelve lines 189 px wide (88% of the panel) and 47 to 61 px tall, pinned left or right: slide completed in 24 to 30 px. In a panel this narrow, ±60 px is a quarter of the width. Capture scrolling: 40 px/s, by timer.

How it works

Two classes, one mechanism. .sb-slidein-left and .sb-slidein-right share the same dressing (20 px padding, 14 px corners, white background at 4%) and the same scroll-linked animation; the second only replaces the starting state translateX(-60px) with translateX(60px). The two keyframes, fx0537SlideLeft and fx0537SlideRight, are identical: they lead back to translateX(0) and opacity: 1. The direction of the slide therefore comes entirely from the starting position written in the class.

Because the side is carried by the block and not by its rank in the list, you assign it by what the block means: received or sent, for or against, in or out. Two blocks in a row can come from the same side, and an inserted line does not flip its neighbours. That is the difference with an alternation by :nth-child(2n). The shipped demo alternates left, right, left… because its HTML is written that way, not because the CSS requires it.

The entry entry 50% range completes the trip while the first half of the block crosses the bottom edge: 39 px of scrolling for a 79 px block. On load, blocks 1 and 2 are in place and the 3rd, 14 px in, measures 35% opacity and is still 39 px off to the left. A block waiting at +60 px sticks out of the frame on the right: the area is set to overflow-x: hidden, otherwise it gained 40 px of sideways scrolling and, in WebKit, a 17 px bar at the bottom. The tray stops on the last block (434 px of travel) with no empty stretch behind it.

Accessibility

  • Reduced motion: the sideways slide is removed for anyone who asked for less animation. The prefers-reduced-motion rule sets transform: none on both classes and plugs in the fx0537Fade keyframe, opacity only: the block appears where it sits (measured: block 3 at 35% opacity, no translation). The left/right direction is then no longer visible: do not let it carry information alone.
  • Meaning carried by the side: if left means “received” and right means “sent”, say it another way too — alignment, colour, a label, or text hidden for screen readers. The slide lasts 39 px of scrolling, after which nothing tells the two classes apart in the sold code (same background, same border).
  • Keyboard: one press of Tab moves focus to the area (it carries tabindex="0" and a 2 px outline), the arrow keys scroll it. Recorded in all three engines; before the attribute was added, WebKit left focus on the page. The area is announced as a region with its aria-label, to be rewritten for your content.
  • Touch and contrast: a finger scrolls the area like any list (150 px drag recorded with touch emulation). The white heading over the block background exceeds 18:1, the secondary line at 50% opacity sits around 5.3:1; during the 39 px of the trip the block is partly transparent, hence lower in contrast.

Browser compatibility

Three building blocks: animation-timeline: view(), animation-range and @supports. The first two exist since Chrome 115, Edge 115, Safari 26 and, per MDN, Firefox 159. Matching readings in Chromium 149 and WebKit 26.5: block 4 at 78% opacity and 13 px from its place after 120 px of scrolling. Firefox 151 answers no to @supports and shows the six blocks aligned and still. Firefox 159 and later: announced as compatible, not tried here.

Chrome 115+✓ Full (measured in Chromium 149)
Edge 115+✓ Not verified (same engine as Chrome)
Safari 26+✓ Full in the WebKit 26.5 test build; real Safari not verified
Firefox 159+✓ Not verified (support announced by MDN)
Firefox up to 158✓ Blocks in place, no slide (measured in Firefox 151)
iOS 26+ / Android Chrome 115+✓ Not verified on a device

The ±60 px offsets and the zero opacity are only set under @supports (animation-timeline: view()). Elsewhere the two classes are just two names for the same block: the list shows complete, aligned, and scrolls. No hidden content, no fallback script to write.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0537-root">
  <div class="sdc-scroll-container" tabindex="0" role="region" aria-label="…">
    <div class="sb-slidein-content">
      <div class="sb-slidein-left">
        <h4>…</h4>
        <p>…</p>
      </div>
      <div class="sb-slidein-right">
        <h4>…</h4>
        <p>…</p>
      </div>
      … ×3 pairs
    </div>
  </div>
  <span class="sdc-scroll-hint" aria-hidden="true">…</span>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Side of a block (HTML — class sb-slidein-left or sb-slidein-right) alternating in the demo Change the class, not the CSS. All blocks on -left give a list entering from one side; mix according to what each line means. No rule depends on rank.
Distance (CSS — translateX(-60px) and translateX(60px) under @supports) ±60 px ±24 px for a shiver in a narrow panel, ±120 px for a bold arrival on a large screen. Keep the two values opposite, and the area on overflow-x: hidden.
Range (CSS — animation-range: entry entry 50%) first half of the entry (39 px for 79 px) entry alone spreads the trip over the whole entry. For a long slide that carries on inside the frame, that is the setting of Slide In CSS Native (entry cover 40%).
Dressing per side (CSS — to add on each class) identical for both Nothing tells the two classes apart once the block is in place. Add align-self, a maximum width, an edge stripe or a colour per class so the side stays readable at rest.
Tray layout (CSS — .sb-slidein-content) column, 24 px gap, 60 px padding top and bottom A two-column grid puts the -left blocks on the left and the -right blocks on the right, face to face. Reduce the 60 px padding if the area starts under a header.
Scrolling area (CSS — .sdc-scroll-container { height: 280px }) 280 px With no height and no overflow-y, the blocks follow the page scroll. In that case put overflow-x: clip on the parent so the blocks waiting on the right do not widen the page.

FAQ

In how the side is chosen. Slide In Cards alternates by itself with :nth-child(2n): handy for a generated list where you only want a left-right rhythm. Here each block carries its class, so the side can mean something and two neighbouring blocks can arrive from the same edge. The blocks are also plainer (text only, full width, no icon badge) and the trip a little longer, 50% of the entry instead of 40%.
Yes, that is the simplest case: give them all the sb-slidein-left class (or -right). You can then delete the other class's rule and its keyframe. No selector counts the blocks, so the list can be any length.
A right-hand block that has not entered yet is shifted 60 px outside the frame. Without the clipping the area becomes scrollable sideways: a horizontal wheel moved it by 40 px (measured in Chromium and WebKit) and WebKit showed a bar at the bottom. The clipping changes nothing in the picture: whatever stuck out on the right was already outside the frame.