Skip to main content

CategoryTabs

Need an API key?

Get one from Crave Dashboard > Developers > API Development > Step 1 - API Keys. Copy the matching locationId from Step 2 - Location IDs on the same page.
A horizontal tab bar that displays menu categories with an active indicator. Sticks to the top of the viewport as the user scrolls through the menu.

Preview

Import

Usage

Props

Category[]
required
Array of menu categories to display as tabs.
string
required
The ID of the currently active/visible category.
(categoryId: string) => void
required
Callback fired when a tab is clicked — typically scrolls to the category section.

Behavior

  • Sticks to the top of the viewport below the header on scroll
  • Highlights the active category based on scroll position
  • Horizontally scrollable on mobile for long category lists
  • Smooth-scrolls the active tab into view automatically