Staaarter

Tabbed Menu Browser

Interactive menu with category tabs, an accompanying image, and item listings with prices. Perfect for restaurants with multiple menu sections.

By Staaarter Team
Food
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, media-slot dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/tabbed-menu-browser.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/food/food10.tsx instead.

Usage

The file also exports food10Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Food10, food10Demo } from "@/components/blocks/food/food10";

export default function Page() {
  return <Food10 {...food10Demo} />;
}

Props

PropTypeDefaultDescription
badgestringundefinedSmall pill above the heading; only rendered when set.
headingReactNodenoneSection heading.
descriptionstringundefinedShort intro line under the heading.
tabsMenuTab[]noneMenu categories; the first tab is active by default.
classNamestringnoneExtra classes for the outer section element.

Types

interface MenuItem {
  name: string;
  description?: string;
  price: string;
}

interface MenuTab {
  label: string;
  image?: { src: string; alt: string };
  items: MenuItem[];
}

Behavior notes

  • Real tab-switching state: clicking a tab swaps both the image and the item list to that category's data, implemented with useState and a role="tablist"/role="tab"/role="tabpanel" accessible pattern (no shared Tabs primitive used).
  • The first tab (index 0) is active on mount; there is no URL or prop to control the initial tab.
  • When a tab's image is omitted, MediaSlot renders its own placeholder rather than leaving the layout column empty.
  • Item rows have no click behavior of their own; only the tab buttons are interactive.