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

    Scroll Area

    A region that scrolls inside its box, with thin bars that appear when you hover and fade away after. Use it for long lists in a fixed panel, and for galleries that run past the edge. Built on Radix, with shadcn's API.

    Install

    npx shadcn@latest add @nelumbo/scroll-area

    Vertical list

    A fixed-height box with a list inside. The bar appears on hover, or while you scroll with the wheel or keys. Tab to the list to scroll it from the keyboard: arrow keys, Page Up and Page Down, Home and End.

    • Linen
    • Oat
    • Sage
    • Clay
    • Ink
    • Dune
    • Moss
    • Pebble
    • Salt
    • Birch
    • Fern
    • Dusk
    • Coral
    • Slate
    • Sand
    • Plum
    • Frost
    • Ember
    • Willow
    • Cedar

    Make the content wide and give the area a horizontal bar: add <ScrollBar orientation="horizontal" />. Leave a little room at the bottom so the bar does not sit on the cards.

    Morning light
    Coastal walk
    Old town
    Night market
    Harbour
    Hill path
    Forest edge

    Both directions

    Content that is wide and tall gets both bars, with a small corner where they meet. Scrolling works with the wheel, trackpad, the bars or the keyboard.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60

    Fade edges

    The fade prop softens the edge where content continues. An edge fades only while there is more content past it, so the first and last items are never dimmed. Scroll to the middle to see both edges.

    • Linen
    • Oat
    • Sage
    • Clay
    • Ink
    • Dune
    • Moss
    • Pebble
    • Salt
    • Birch
    • Fern
    • Dusk
    • Coral
    • Slate
    • Sand
    • Plum
    • Frost
    • Ember
    • Willow
    • Cedar
    Morning light
    Coastal walk
    Old town
    Night market
    Harbour
    Hill path
    Forest edge

    Usage

    import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"​// shadcn's API<ScrollArea className="h-72 w-48 rounded-md border">  <div className="p-4">…</div></ScrollArea>​// Horizontal gallery<ScrollArea className="w-96">  <div className="flex w-max gap-4 p-4">…</div>  <ScrollBar orientation="horizontal" /></ScrollArea>​// Nelumbo: soft edge fades that show only where there is more to see<ScrollArea fade aria-label="Tags" className="h-72">…</ScrollArea>

    Props

    PropTypeDefaultRadix's own props (type, scrollHideDelay, dir) work as is
    ScrollArea fadebooleanfalseSoft fades at the edges that have more content past them
    ScrollArea type"auto" | "always" | "scroll" | "hover""hover"Nelumbo default: bars show on hover and fade out. Use always to keep them
    ScrollArea scrollHideDelaynumber600Milliseconds before the bars fade after the pointer leaves
    ScrollArea aria-labelstringNames the scrollable region (the viewport gets role region)
    ScrollBar orientation"vertical" | "horizontal""vertical"A vertical bar is always there unless you pass one yourself