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/happy-hour-deals.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/food/food21.tsx instead.
Usage
The file also exports food21Demo, 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 { Food21, food21Demo } from "@/components/blocks/food/food21"; export default function Page() { return <Food21 {...food21Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | none | Section heading. |
| description | string | none | Section intro text below the heading. |
| image | { src: string; alt: string } | none | Photo in the left column; falls back to a placeholder when omitted. |
| schedule | string[] | [] | Badges above the heading describing when the deal runs, e.g. days and hours. |
| deals | HappyHourDeal[] | none | Itemized deal list, each showing an original and discounted price. |
| ctaLabel | string | none | Label for the CTA button; the button only renders when this is set. |
| className | string | none | Extra classes for the outer section element. |
Types
type HappyHourDeal = { name: string; originalPrice: string; dealPrice: string; };
Behavior notes
- The schedule badge row, heading, description, and CTA button each only render when their respective prop is set/non-empty.
- Each deal always shows both originalPrice (struck through) and dealPrice; there is no toggle to hide the original price.
- The CTA button is decorative and inert: there is no real link or navigation wired up.
- The image stacks above the content on mobile and sits side-by-side with it from the lg breakpoint up.
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.