Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/gift-card-shop.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/food/food2.tsx instead.
Usage
The file also exports food2Demo, 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 { Food2, food2Demo } from "@/components/blocks/food/food2"; export default function Page() { return <Food2 {...food2Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Send a gift card" | Section heading. |
| description | string | "Pick an amount, choose how it's delivered, and preview it before you send." | Section intro text. |
| presetAmounts | number[] | [25, 50, 75, 100] | Preset dollar amounts shown as selectable tiles. |
| defaultAmount | number | 50 | Which preset amount is selected on mount. |
| className | string | none | Extra classes for the outer section element. |
Behavior notes
- Real client-side state: selecting a preset amount clears any typed custom amount, and typing a custom amount clears the preset selection, so exactly one source of truth drives the displayed total at a time.
- The delivery method toggle (digital vs. physical) is a real native radio group, styled as cards, not just a decorative pair of buttons.
- The preview panel on the right is derived directly from the current amount and delivery method state, so it updates live as either changes.
- The "Add to cart" button is decorative; it has no click handler since there is no real cart/checkout backend behind this block.
More Food Blocks
View all →Loyalty Rewards Program
Four-tier rewards program with points earning steps, benefit lists, and app store download buttons.
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.
Set Menu Pricing Cards
Three-tier pricing cards for group dining with included items, minimum guests, and booking buttons.