HextaUI

Scroll area: Both axes

scrollbars="both" shows both scrollbars and a corner where they meet, and fades all four edges.

import { ScrollArea } from "@/components/ui/scroll-area"

export function ScrollAreaBoth() {
  return (
    <ScrollArea
      scrollbars="both"
      className="h-64 w-full max-w-md rounded-lg border"
    >
      <div className="grid w-max grid-cols-[repeat(10,6rem)] gap-2 p-3">
        {Array.from({ length: 100 }, (_, index) => (
          <div
            key={index}
            className="grid aspect-square place-items-center rounded-md bg-muted text-sm"
          >
            {index + 1}
          </div>
        ))}
      </div>
    </ScrollArea>
  )
}

This adds the example as components/examples/scroll-area/both.tsx, together with the Scroll area component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/scroll-area-both.json

To add only the component, follow the Scroll area installation.

Props in this example

The Scroll area props this example sets, from the API reference.

PropTypeDefault
scrollbars
"vertical" | "horizontal" | "both""vertical"
className
string | (state) => string–

Every prop is in the Scroll area API reference.

See them all, with keyboard support and accessibility notes, on the Scroll area page.