Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/hours-and-contact-info.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/food/food28.tsx instead.
Usage
The file also exports food28Demo, 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 { Food28, food28Demo } from "@/components/blocks/food/food28"; export default function Page() { return <Food28 {...food28Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | ReactNode | "Hours & Contact" | Section heading. |
| description | string | undefined | Section intro text. |
| hours | DayHours[] | none | One row per day, in display order. |
| todayIndex | number | 2 | Static index into `hours` to visually mark as "Today" (a badge plus a tinted row). Caller-supplied, never derived from the real clock, so static rendering and every repeated card-thumbnail render stay identical. |
| holidayNotice | { title: string; description: string } | undefined | Optional callout above the table; omitted entirely when unset. |
| phone | string | none | Display phone number, also used to build the default `tel:` href. |
| phoneHref | string | `tel:${phone}` | Override for the call button's href. |
| string | none | Display email address, also used to build the default `mailto:` href. | |
| emailHref | string | `mailto:${email}` | Override for the email button's href. |
| chatLabel | string | "Start live chat" | Label for the decorative live-chat button. |
| className | string | none | Extra classes for the outer section element. |
Types
type DayHours = { day: string; open: string; close: string; closed?: boolean; };
Behavior notes
- "Today" is entirely prop-driven via todayIndex; there is no `new Date()`/`Date.now()` in the render path, since this block is statically rendered once at build time and re-rendered live in every card thumbnail - a real clock read would make it inconsistent across those renders.
- The live-chat button is decorative only: a plain `type="button"` element with no click handler and no real chat widget behind it, same as this repo's other inert CTA buttons.
- The call and email buttons are real links (`tel:`/`mailto:` hrefs via `render={<a />}`), not just decorative.
- The holiday notice is a hand-rolled callout (icon + title + description) using semantic tokens, not the shared `Alert` primitive, since `alert` isn't one of the block system's installable dependency names.
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.