Tally UI

FilterChipGroup

Horizontally scrollable group of toggle chips for category filtering

Import

import { FilterChip, FilterChipGroup } from '@tallyui/components';

Usage

const [chips, setChips] = React.useState([
  { label: 'All', active: true },
  { label: 'Equipment', active: false },
  { label: 'Accessories', active: false },
]);

<FilterChipGroup
  chips={chips}
  onChipPress={(index) =>
    setChips((prev) => prev.map((c, i) => ({ ...c, active: i === index })))
  }
/>

Standalone FilterChip

<FilterChip label="Equipment" active={isActive} onPress={toggle} />

Props

FilterChipGroup

PropTypeDefaultDescription
chipsChipItem[]requiredArray of chip data
onChipPress(index: number) => voidrequiredCalled with chip index on press
classNamestringOverride scroll content styles

ChipItem

interface ChipItem {
  label: string;
  active: boolean;
}

FilterChip

PropTypeDefaultDescription
labelstringrequiredChip label text
activebooleanrequiredWhether chip is selected
onPress() => voidrequiredCalled on press
classNamestringOverride chip styles

Active classes: bg-primary with text-primary-foreground Inactive classes: bg-surface-alt with text-muted

Live demo

On this page