Skip to content

    Browse components

    Snap Slides

    A draggable, snapping carousel whose off-center slides tilt away in 3D, with dots, autoplay and arrow-key support.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/snap-slides

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/snap-slides.json

    Usage

    import { SnapSlides } from "@/components/ui/snap-slides";
    
    <SnapSlides
      items={[
        { image: "/a.jpg", title: "Mountains", description: "Thin air, big views." },
        { image: "/b.jpg", title: "Coast", description: "Salt and wind." },
      ]}
    />

    Props

    PropTypeDefaultDescription
    itemsReactNode—Array of { image, title, description? }.
    itemWidthnumber300Slide width in px.
    itemHeightnumber340Slide height in px.
    gapnumber24Px between slides.
    tiltnumber38Max tilt of side slides in degrees.
    autoplaybooleanfalseAdvance automatically (pauses on hover).
    autoplayDelaynumber3000Ms between autoplay steps.
    loopbooleantrueWrap around at the ends.
    startIndexnumber0Slide centered on mount.
    classNamestring—Extra classes for the root element.