Tally UI

CategoryNav

Horizontal or vertical list of category pill buttons for filtering products

Import

import { CategoryNav } from '@tallyui/components';

Usage

<CategoryNav
  categories={[
    { id: 'all', name: 'All' },
    { id: 'equipment', name: 'Equipment' },
  ]}
  selectedId="all"
  onSelect={(id) => setSelectedCategory(id)}
/>

A row of pill-shaped buttons for category filtering. The active category is visually highlighted. Supports horizontal scrolling (default) or vertical stacking.

Props

PropTypeDefaultDescription
categoriesCategoryItem[]requiredArray of category objects
selectedIdstringrequiredID of the currently active category
onSelect(id: string) => voidrequiredCallback when a category is tapped
orientation'horizontal' | 'vertical''horizontal'Layout direction
classNamestringOverride container styles

CategoryItem

interface CategoryItem {
  id: string;
  name: string;
}

Live demo

On this page