Start here
  • InstallationAdd Nelumbo to a shadcn project
  • ThemingBrand accent, neutrals, dynamic color
  • Biology componentsSequences, maps, plates and trees
  • katalyx.bio

    Carousel

    A row of things to browse by swiping, dragging or pressing the arrows: photos, cards, featured content. Multi-browse and hero layouts, from Material 3, show one large item and let the rest shrink to a peek, so you can see there is more and still read what is in front of you.

    Install

    npx shadcn@latest add @nelumbo/carousel

    Multi-browse

    layout="multi-browse": one large item, a medium one and small ones at the edge. The large item shrinks as it scrolls off while the next one grows, following your finger. Drag, swipe, press the arrows or use the dots.

     

    Hero

    layout="hero": one large item and a small peek of the next.

    Uncontained

    layout="uncontained": equal items that run off the edge. Item width comes from a basis class on CarouselItem (basis-[40%] by default).

    Maya Kowalski

    Product design

    Kenji Watanabe

    Motion and prototyping

    Léa Martin

    Design systems

    Omar Haddad

    Frontend

    Sofía Ramírez

    Platform

    Tomás Novák

    Research

    Aisha Bello

    Content design

    Ravi Iyer

    Data

    Full and vertical

    The default layout is "full": one item at a time, like shadcn. Vertical carousels need a height on CarouselContent. Arrow keys follow the axis.

    Glacier lake

    Iceland

    Old town at dusk

    Lisbon

    Tea terraces

    Fujian

    Night market

    Taipei

    Salt flats

    Bolivia

    Harbour fog

    Maine

    Desert road

    Namibia

    Bamboo grove

    Kyoto

    Vertical multi-browse

    Multi-browse and hero work on the vertical axis too.

    Usage

    import { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, CarouselDots } from "@/components/ui/carousel"​// shadcn's API<Carousel className="w-full max-w-xs">  <CarouselContent>    <CarouselItem>…</CarouselItem>  </CarouselContent>  <CarouselPrevious />  <CarouselNext /></Carousel>​// Nelumbo: Material 3 layouts and a dot indicator<Carousel layout="multi-browse" aria-label="Photos">  <CarouselContent className="h-72">    <CarouselItem>      <Photo className="h-full w-full" />    </CarouselItem>  </CarouselContent>  <CarouselPrevious />  <CarouselNext />  <CarouselDots className="mt-3" /></Carousel>​// Fade a label in as the card grows<p className="truncate" style={{ opacity: "calc((var(--carousel-p) - 0.6) * 2.5)" }}>Glacier lake</p>

    Props

    PropTypeDefaultEmbla's own props (opts, plugins, setApi, orientation) work as in shadcn
    Carousel layout"full" | "uncontained" | "multi-browse" | "hero""full"How items are sized. Full is shadcn's behaviour
    Carousel orientation"horizontal" | "vertical""horizontal"Vertical needs a height on CarouselContent
    Carousel opts / plugins / setApiEmbla options / plugins / callbackPassed through; setApi hands you the Embla API
    CarouselContent classNamestringMulti-browse and hero use h-64 unless you set a height
    CarouselItem classNamestringUncontained: set the width with basis-*
    CarouselPrevious / NextIconButton propsTonal icon buttons over the edges; hidden at the ends. label overrides the accessible name
    CarouselDotsdiv propsOne dot per scroll position; the active dot stretches into a pill
    --carousel-pCSS variableSet on each multi-browse and hero card: 0 small to 1 large