ScrollGallery
One snap-aligned horizontal scroll row with thin scrollbar, edge fade, and focused items scrolled into view.
- Who is it for?
- Developers showing a row of peers (identity chips, filter pills, thumbnail strips) that must stay on one line on phones.
- When should I use it?
- More items than fit at once; keyboard tabs or links inside the row.
- When should I pick something else?
- Primary navigation that should wrap — use a vertical stack.
Install or copy
This ships on npm only; there is no copy-source brick for it.
- You get
- Every component from one import, with the theme tokens included. Updates arrive with your package manager.
- You need
- React 19 and Tailwind CSS 4, for example a Next.js app created with the Tailwind option.
Install
Terminal pnpm add @zedtech/zedkit-uiLoad the styles
Tailwind does not scan node_modules, so the @source line points it at the kit's class names. The path is relative to this file.
src/app/globals.cssReplace the contents@import "tailwindcss"; @import "@zedtech/zedkit-ui/styles.css"; @source "../../node_modules/@zedtech/zedkit-ui/src/**/*.{ts,tsx}";Import and render
src/app/page.tsxReplace the contentsimport { ScrollGallery, Tabs, TabsList, TabsTrigger } from "@zedtech/zedkit-ui"; export default function Page() { return ( <main className="p-8"> <Tabs value="a"> <ScrollGallery className="w-full"> <TabsList className="inline-flex w-max flex-nowrap"> <TabsTrigger value="a">One</TabsTrigger> <TabsTrigger value="b">Two</TabsTrigger> </TabsList> </ScrollGallery> </Tabs> </main> ); }
Package version 1.6.2.
Usage and states
import { ScrollGallery, Tabs, TabsList, TabsTrigger } from "@zedtech/zedkit-ui";
<Tabs value="a">
<ScrollGallery className="w-full">
<TabsList className="inline-flex w-max flex-nowrap">
<TabsTrigger value="a">One</TabsTrigger>
<TabsTrigger value="b">Two</TabsTrigger>
</TabsList>
</ScrollGallery>
</Tabs>Filter chips
import { ScrollGallery } from "@zedtech/zedkit-ui";
<ScrollGallery className="max-w-sm">
<div className="flex w-max gap-2">
<a className="shrink-0 snap-start rounded-md border px-3 py-2" href="#a">
Alpha
</a>
<a className="shrink-0 snap-start rounded-md border px-3 py-2" href="#b">
Beta
</a>
</div>
</ScrollGallery>Wraps: none (layout + focus scroll)
Props
No props of its own. It accepts the native attributes below.
Show inherited HTML attributes
Standard attributes from the underlying element. See MDN.
Prop
Type
Accessibility
Keep real controls inside the track (tabs, links, buttons); focused items scroll into view. Edge fades are decorative only.
Troubleshooting
Items wrap to two lines — the track child should be `inline-flex flex-nowrap` (for example `TabsList`). Nothing scrolls — confirm the row is wider than the viewport and `overflow-x-auto` is not blocked by a parent `overflow: hidden`.