p-scroll-area-5

PreviousNext

Horizontal scroll area with scrollbar gutter

Docs
cossblock

Preview

Loading preview…
registry/default/particles/p-scroll-area-5.tsx
import { ScrollArea } from "@/registry/default/ui/scroll-area";

export default function Particle() {
  return (
    <ScrollArea className="max-w-96 rounded-lg border" scrollbarGutter>
      <div className="flex w-max gap-4 p-4">
        {Array.from({ length: 20 }).map((_, i) => (
          <div
            className="flex h-20 w-32 shrink-0 items-center justify-center rounded-md bg-muted"
            key={String(i)}
          >
            <span className="font-medium text-sm">Item {i + 1}</span>
          </div>
        ))}
      </div>
    </ScrollArea>
  );
}

Installation

npx shadcn@latest add @coss/p-scroll-area-5

Usage

import { PScrollArea5 } from "@/components/p-scroll-area-5"
<PScrollArea5 />