Menu, list
betaThe 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
- Pairs with
- Menu, cardsBooking, form
Installation
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):
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
| Field | Type | Limits | Guidance |
|---|---|---|---|
eyebrowoptional | string | ≤ 32 chars | Above the title: 'Served from noon to eleven'. |
title | string | 2–48 chars | 'The menu', 'À la carte'. |
sublineoptional | string | ≤ 160 chars | |
categories | object[] | 1–8 items | In the order of a meal. They flow into two columns on a wide screen. |
categories[].name | string | 2–24 chars | 'Starters', 'Grills', 'Drinks'. |
categories[].items | object[] | 1–14 items | |
categories[].items[].name | string | 1–48 chars | |
categories[].items[].descriptionoptional | string | ≤ 140 chars | |
categories[].items[].price | object | ||
categories[].items[].price.amount | number | ≥ 0 | |
categories[].items[].price.currency | string | 3–3 chars | An ISO 4217 code: 'EUR', 'USD', 'XAF'. |
categories[].items[].tagsoptional | string[] | ≤ 3 items | Short labels: 'spicy', 'vegetarian', 'new'. |
localeoptional | string | A BCP 47 locale for prices ('en-CM'); the page's language when left out. | |
noteoptional | string | ≤ 140 chars | Under the menu: allergens, service, prices including taxes. |
Props
| Prop | Notes |
|---|---|
content | MenuListContent; the example when left out |
id | the section's id, for anchor links; "menu" by default |
headingLevel | 1, 2 or 3: the heading's tag; 2 by default |
className | on 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.