import { createSignal, For } from "solid-js" import { Button } from "@opencode/ui/button" import { MenuScroll } from "./menu-scroll" const branches = [ "main", "dev", "release", "docs", "file-search", "settings", "theme-picker", "history", "keyboard", "mobile", "accessibility", "preview", ] const args = { rows: branches.length, height: 144, rtl: false } function Preview(props: typeof args) { const [branch, setBranch] = createSignal("main") return (
Switch branch
{(name) => ( )}
Current branch: {branch()}

Tab through branches or swipe the list on a touch device.

) } export default { title: "UI/MenuScroll", id: "ui-menu-scroll", component: Preview, args, argTypes: { rows: { control: { type: "range", min: 1, max: branches.length, step: 1 } }, height: { control: { type: "range", min: 80, max: 320, step: 8 } }, }, } export const Overflow = {} export const Fits = { args: { rows: 3 } } export const RightToLeft = { args: { rtl: true } }