Skip to main content

MenuSwitcher

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 dropdown selector that allows customers to switch between multiple menus (e.g., Breakfast, Lunch, Dinner). Displays availability status based on operating hours.

Preview

Import

Usage

Props

Menu[]
required
Array of available menus for the location.
string
required
The ID of the currently selected menu.
(menuId: string) => void
required
Callback fired when a different menu is selected.

Behavior

  • Shows “Available now” or “Available at 11:00 AM” based on daypart logic
  • Grays out menus outside their operating hours
  • Auto-selects the first available menu on mount