Horizontal strip
Scroll a single row of items sideways. A horizontal scrollbar is added explicitly and the named region can be scrolled with the keyboard. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.
"use client"
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"
const tags = [
"Design",
"Research",
"Engineering",
"Marketing",
"Support",
"Finance",
"Operations",
"Legal",
"Sales",
"Recruiting",
]
export function ScrollAreaHorizontalStrip() {
return (
<div className="flex w-full max-w-md flex-col gap-10">
<ScrollArea role="region" aria-label="Filter by team" className="w-full max-w-xs rounded-12 border border-soft-200">
<ul className="flex w-max gap-2 p-3">
{tags.map((tag) => (
<li
key={tag}
className="rounded-full border border-soft-200 px-3 py-1 text-label-sm whitespace-nowrap text-strong-950"
>
{tag}
</li>
))}
</ul>
<ScrollBar orientation="horizontal" />
</ScrollArea>
</div>
)
}