Skip to main content

CategoryTabs

Need storefront configuration?

Use the public API origin, merchant slug, and location ID. Storefront components never receive a Crave API key; register each exact browser origin before making requests.
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