Menu classic — Storefront block

Pro

storefront-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-classic

Usage

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.

PropTypeDescription
title*stringWordsthe menu’s heading ("The autumn menu")
introstringWordswhat the kitchen says about this menu, one or two sentences
sections*Section[]the sections shown, in order
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Section sections[] · 4 props
PropTypeDescription
id*stringDesignthe key of the record
name*stringWordsthe section’s name ("Starters", "Desserts")
notestringWordsone line under the name ("Served until 9:30 pm")
dishes*Dishe[]the section’s dishes
Dishe sections[].dishes[] · 11 props
PropTypeDescription
id*stringDesignthe key of the record
name*stringWordsthe dish’s name, as the menu says it ("Squash soup, hazelnut crumbs")
descriptionstringWordswhat is on the plate, one or two lines
pricenumberthe price in cents; absent when the dish has no fixed price
priceLabelstringWordsreplaces the price when it is not a fixed amount ("depending on arrivals", "2 people")
tagsstring[]Wordsa dietary mention the merchant gives ("Vegetarian", "Gluten-free")
allergensstring[]Wordsan allergen the dish contains, as the merchant declares it ("gluten", "milk")
badgestringWordsa short mention the merchant chooses ("Signature", "In season")
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the picture shows
unavailablebooleanthe dish is not served today: it stays on the menu, struck out
Options options · 5 props
PropTypeDescription
eyebrowstringWordsa small line above the heading
indexLabelstringWordsthe accessible name of the section index ("The menu’s sections")
containsLabelstringWordswhat comes before a dish’s allergens ("Contains")
legendstringWordswhat the merchant says about allergens and prices ("Net prices, service included. Tell us your allergies.")
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa 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).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
moneyformats a price, given in cents
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour 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:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo 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.

All 409 storefront blocks