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.
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



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-motionrule setstransform: noneon both classes and plugs in thefx0537Fadekeyframe, 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 itsaria-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.
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):
<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 / property | Default | Effect |
|---|---|---|
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
: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%.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.