Skip to content
New

Menu, list

beta

The whole menu as a printed card: every category at once in two columns, each dish with a dotted leader to its price.

npx rasengan-ui add menu-list
Use it
A menu of up to forty dishes read in one go, for a restaurant that wants the printed-menu feel.
Avoid it
A long menu: menu-categories puts it in tabs. Dishes that need photos: menu-cards.
Built with
Badge

Installation

Terminal
npx rasengan-ui add menu-list

It installs into components/blocks/menu-list/, with what it uses (Badge) and lib/blocks.ts.

Usage

Without content, the block shows its example. Pass your own, typed by the block's schema, from a content file (here, the example with one field changed):

app/_routes/index.page.tsx
import { MenuList } from "@/components/blocks/menu-list";
import { home } from "@/content/home";
 
export default function Home() {
  return <MenuList content={home.menu} />;
}
content/home.ts
import { example, type MenuListContent } from "@/components/blocks/menu-list";
 
export const home = {
  menu: { ...example, title: "À la carte" } satisfies MenuListContent,
};

Every category is shown: they flow into two columns on a wide screen and never break across them. For a long menu, menu-categories puts each category in a tab.

Content

FieldTypeLimitsGuidance
eyebrowoptionalstring≤ 32 charsAbove the title: 'Served from noon to eleven'.
titlestring2–48 chars'The menu', 'À la carte'.
sublineoptionalstring≤ 160 chars
categoriesobject[]1–8 itemsIn the order of a meal. They flow into two columns on a wide screen.
categories[].namestring2–24 chars'Starters', 'Grills', 'Drinks'.
categories[].itemsobject[]1–14 items
categories[].items[].namestring1–48 chars
categories[].items[].descriptionoptionalstring≤ 140 chars
categories[].items[].priceobject
categories[].items[].price.amountnumber≥ 0
categories[].items[].price.currencystring3–3 charsAn ISO 4217 code: 'EUR', 'USD', 'XAF'.
categories[].items[].tagsoptionalstring[]≤ 3 itemsShort labels: 'spicy', 'vegetarian', 'new'.
localeoptionalstringA BCP 47 locale for prices ('en-CM'); the page's language when left out.
noteoptionalstring≤ 140 charsUnder the menu: allergens, service, prices including taxes.

Props

PropNotes
contentMenuListContent; the example when left out
idthe section's id, for anchor links; "menu" by default
headingLevel1, 2 or 3: the heading's tag; 2 by default
classNameon the <section>, for spacing

Accessibility

  • Category names are headings one level below the title.
  • The dotted leaders are hidden from screen readers: a dish is read as its name, then its price.