Docs
Scroll Menu

Scroll Menu

A horizontally scrollable menu.

Installation

Usage

import { ScrollMenu } from "@/components/ui/scroll-menu";
<ScrollMenu
  scrollAmount={150}
  showScrollButtons={true}
  leftButtonLabel="Previous items"
  rightButtonLabel="More items"
>
  {/* Your scrollable menu items */}
  <Button variant="secondary" className="mx-1">
    Item 1
  </Button>
  <Button variant="secondary" className="mx-1">
    Item 2
  </Button>
  <Button variant="secondary" className="mx-1">
    Item 3
  </Button>
  {/* ...more items */}
</ScrollMenu>

Props

PropTypeDefaultDescription
classNamestring-The class name to apply to the component.
childrenReactNode-The content to display in the component.
leftButtonLabelstring"Scroll left"Accessible label for the left scroll button.
rightButtonLabelstring"Scroll right"Accessible label for the right scroll button.
scrollAmountnumber200Amount to scroll horizontally when buttons are clicked.
showScrollButtonsbooleantrueWhether to show the scroll buttons.