Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge, media-slot dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/dish-detail-page.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/food/food17.tsx instead.
Usage
The file also exports food17Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Food17, food17Demo } from "@/components/blocks/food/food17"; export default function Page() { return <Food17 {...food17Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| dishName | string | none | Dish name, rendered as the page heading. |
| description | string | none | Dish description paragraph. |
| image | { src: string; alt: string } | none | Large dish photo; falls back to a placeholder when omitted. |
| price | string | none | Formatted price, e.g. "$22.00". |
| rating | number | none | Average rating out of 5, rounded to the nearest whole star for display. |
| reviewCount | number | none | Number of reviews shown next to the star rating. |
| prepTime | string | none | Preparation time text, e.g. "18-22 min". |
| calories | number | none | Calorie count, rendered as "{calories} cal". |
| dietary | string[] | [] | Dietary badges shown above the dish name, e.g. "Vegetarian". |
| className | string | none | Extra classes for the outer section element. |
Behavior notes
- The quantity selector is real client state (useState), clamped between 1 and 10; the minus button disables at 1 and the plus button disables at 10.
- The star rating display rounds `rating` to the nearest whole star; it is a pure display computation from the prop, not independently editable.
- "Add to cart" is a decorative, inert button with no click handler: there is no real cart or checkout backend wired up, matching every other ordering CTA in this category.
- The dietary badge row only renders when the dietary array has entries.
More Food Blocks
View all →Loyalty Rewards Program
Four-tier rewards program with points earning steps, benefit lists, and app store download buttons.
Gift Card Shop
Gift card purchase interface with preset amounts, custom input, digital/physical delivery options, and live preview.
Online Ordering Hub
Delivery platform cards with logos, fees, and delivery times alongside pickup info with address and phone.
Expandable Menu Accordion
Collapsible menu items revealing full images, calorie counts, protein info, and allergen badges.
Daily Specials Chalkboard
Dark-themed chalkboard-style menu with decorative corners, day labels, and timestamp.
Dietary Filter Menu
Interactive menu with dietary filter buttons (vegetarian, vegan, gluten-free) and allergen warnings.