Menu classic — Storefront block
Prostorefront-menu-classic · for home, menu, landing pages
Menu classic
A written menu for a table that reads: sections in two columns, each dish with its price at the end of a dotted line
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/storefront-menu-classicUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontMenuClassic from '@/components/trame/blocks/storefront/storefront-menu-classic.vue'
const props = {
title: "The fall menu",
intro: "Seasonal cooking, a short menu made every day with our growers’ produce.",
sections: [
{
id: "entrees",
name: "Starters",
note: "To begin, to share or not",
dishes: [
{
id: "veloute",
name: "Creamy kabocha squash soup, toasted hazelnuts",
description: "Autumn cream, roasted hazelnut oil.",
price: 950,
tags: [
"Vegetarian"
],
allergens: [
"milk",
"tree nuts"
]
},
{
id: "burrata",
name: "Burrata, ham croquettes and pesto",
description: "Served warm with herb oil and a mild chili.",
price: 1400,
image: "https://images.unsplash.com/photo-1712746784068-703c0c915611?w=1600&q=80",
alt: "A shallow bowl with burrata, two golden croquettes and a green oil",
allergens: [
"milk",
"gluten"
],
badge: "Signature"
}
]
},
{
id: "plats",
name: "Mains",
note: "Served at lunch and dinner",
dishes: [
{
id: "dos",
name: "Cod loin, green asparagus and candied tomatoes",
description: "Cooked skin side down, lemon pan jus.",
price: 2400,
image: "https://images.unsplash.com/photo-1625862692743-3f57873bb37c?w=1600&q=80",
alt: "A fish fillet on green asparagus and cherry tomatoes, in a shallow bowl",
allergens: [
"fish"
]
},
{
id: "lieu",
name: "Pollock, sauce vierge and seasonal vegetables",
description: "Plated to order, sauce poured at the table.",
price: 2300,
image: "https://images.unsplash.com/photo-1676471926534-d5c9771909fa?w=1600&q=80",
alt: "A fish with herbs on a white plate, sauce poured over it",
allergens: [
"fish",
"milk"
]
}
]
}
],
options: {
eyebrow: "Lunch and dinner",
legend: "Prices include service. The allergens shown are the ones we declare: tell us about your allergies before ordering."
}
}
</script>
<template>
<StorefrontMenuClassic v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe menu’s heading ("The autumn menu") |
| intro | string | Wordswhat the kitchen says about this menu, one or two sentences |
| sections* | Section[] | the sections shown, in order |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Section sections[] · 4 props
| Prop | Type | Description |
|---|---|---|
| id* | string | Designthe key of the record |
| name* | string | Wordsthe section’s name ("Starters", "Desserts") |
| note | string | Wordsone line under the name ("Served until 9:30 pm") |
| dishes* | Dishe[] | the section’s dishes |
Dishe sections[].dishes[] · 11 props
| Prop | Type | Description |
|---|---|---|
| id* | string | Designthe key of the record |
| name* | string | Wordsthe dish’s name, as the menu says it ("Squash soup, hazelnut crumbs") |
| description | string | Wordswhat is on the plate, one or two lines |
| price | number | the price in cents; absent when the dish has no fixed price |
| priceLabel | string | Wordsreplaces the price when it is not a fixed amount ("depending on arrivals", "2 people") |
| tags | string[] | Wordsa dietary mention the merchant gives ("Vegetarian", "Gluten-free") |
| allergens | string[] | Wordsan allergen the dish contains, as the merchant declares it ("gluten", "milk") |
| badge | string | Wordsa short mention the merchant chooses ("Signature", "In season") |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the picture shows |
| unavailable | boolean | the dish is not served today: it stays on the menu, struck out |
Options options · 5 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa small line above the heading |
| indexLabel | string | Wordsthe accessible name of the section index ("The menu’s sections") |
| containsLabel | string | Wordswhat comes before a dish’s allergens ("Contains") |
| legend | string | Wordswhat the merchant says about allergens and prices ("Net prices, service included. Tell us your allergies.") |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| money | formats a price, given in cents |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
A storefront section, for home, menu, landing pages; it uses @lucide/vue, clsx, motion, tailwind-merge.
More storefront blocks
- Membership ledger: the offer and its price on one side, a ruled list of perks with their yearly value on the other: a membership.
- Membership plan beside: the plan card held beside every perk with its fine print: a programme whose perks need reading before joining.
- Membership plan card: sell the membership: the plan with its price, its main perks and one button.
- Membership worked example: convince a doubter: a worked example with the programme’s real rules and where it pays for itself.
- Mini cart compact: a short cart on a page of its own, or a mini-cart panel: small rows in one bordered card, the total and the way to pay held in its footer.
- Mini cart receipt: a short cart with character, for a shop with a crafted or retro voice: a narrow till-receipt ticket, each line running to its price along a dotted leader, the total under a double rule.
- Offer popup code: A centered selectable code with its terms in the host's dialog; the merchant's own offer only.
- Offer popup slide in: A compact nonblocking card positioned by the host; the merchant's own offer only.