Presenting Sillybits Pro - Beautifully crafted templates to create stunning landing pages in no time.
Docs
Snap Scroll

Snap Scroll

PreviousNext

A reusable scroll container component that enables smooth snap scrolling vertically or horizontally.

Scroll vertically
1
2
3
4

Installation

Examples

Horizontal

Scroll horizontally
1
2
3
4

Vertical

Scroll vertically
1
2
3
4

With Images

Scroll vertically
Image 1
Image 2
Image 3
Image 4
Image 5

Usage

import { SnapScroll } from "@/components/sillybitsui/snap-scroll";
<SnapScroll
  items={Array.from({ length: 5 }, (_, i) => (
    <div className="h-full bg-red-500 flex items-center justify-center text-white text-5xl font-black">
      {i}
    </div>
  ))}
  direction="x"
/>

Props

PropTypeDefaultDescription
itemsReact.ReactNode[]-Array of React elements (e.g. <div>, <img>, custom components) to display inside the scroll container.
direction"x" | "y""y"Scroll direction — "x" for horizontal or "y" for vertical scrolling.
containerHeightstring"400px"Height of the scroll container (used for vertical scroll).
containerWidthstring"auto"Width of the scroll container (used for horizontal scroll).
itemClassNamestring""Additional Tailwind or custom classes applied to each scroll item.