Menu, cards
betaSignature dishes as cards: a photo, tags, a line and the price, each with an order link that opens WhatsApp with the dish written.
npx rasengan-ui add menu-cards
Our signature dishes
The plates people cross the city for, cooked every day from the morning market.
Ndolé with prawns
house favouriteBitter leaves, peanuts and prawns, with fried plantain.
FCFA 4,500Order
- Use it
- A restaurant, a bakery or a café showing its best plates, with good photos of them.
- Avoid it
- The whole menu: use menu-categories or menu-list, and link to it from here.
- Pairs with
- Menu, categoriesOrder, banner
Installation
It installs into components/blocks/menu-cards/, with what it uses (Badge, Button) 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):
Each card's order link opens order.channel (WhatsApp, a text or an email) with order.message and the dish's name written. Leave order out for cards without a link. Three, six or nine dishes fill the grid evenly.
Content
| Field | Type | Limits | Guidance |
|---|---|---|---|
title | string | 2–48 chars | 'Our signature dishes', 'Popular this week'. |
sublineoptional | string | ≤ 160 chars | Why these: the house favourites, what's in season. |
dishes | object[] | 2–9 items | Three, six or nine read best: the grid has up to three columns. |
dishes[].name | string | 1–48 chars | |
dishes[].descriptionoptional | string | ≤ 140 chars | |
dishes[].price | object | ||
dishes[].price.amount | number | ≥ 0 | |
dishes[].price.currency | string | 3–3 chars | An ISO 4217 code: 'EUR', 'USD', 'XAF'. |
dishes[].tagsoptional | string[] | ≤ 3 items | Short labels: 'spicy', 'vegetarian', 'new'. |
dishes[].image | object | The dish, landscape (4:3). Its alt says what is on the plate. | |
dishes[].image.src | string | A local path ('/images/terrace.jpg') or the project's asset URL. | |
dishes[].image.alt | string | ≤ 140 chars | What the image shows, for people who cannot see it. Empty only if purely decorative. |
dishes[].image.width | integer | ||
dishes[].image.height | integer | ||
orderoptional | object | An order link on each card, opening WhatsApp, a text or an email with the dish written. | |
order.channel | object | ||
order.channel.kind | "whatsapp" | "sms" | "email" | Where the visitor's message opens: their WhatsApp, their texts, or their mail app. | |
order.channel.to | string | 1–120 chars | The business's number in international form, or its email address. |
order.label | string | 1–20 chars | On each card: 'Order', 'Order this'. |
order.message | string | 1–120 chars | The message opens with this, then the dish's name: 'Hello, I would like to order:'. |
ctaoptional | object | Under the grid: 'See the whole menu'. | |
cta.label | string | 1–32 chars | A verb first, two to four words: 'Start free', 'Book a table'. |
cta.href | string | A path ('/pricing'), an anchor ('#menu'), or a full URL. | |
localeoptional | string | A BCP 47 locale for prices ('en-CM'); the page's language when left out. |
Props
| Prop | Notes |
|---|---|
content | MenuCardsContent; the example when left out |
id | the section's id, for anchor links; "dishes" by default |
headingLevel | 1, 2 or 3: the heading's tag; 2 by default |
className | on the <section>, for spacing |
Accessibility
- Each order link is named with its dish ("Order Ndolé with prawns"), not only "Order".
- Photos have their own
alt; tags are text, not colour alone.