Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, media-slot dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/restaurant-image-carousel.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/food/food12.tsx instead.
Usage
The file also exports food12Demo, 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 { Food12, food12Demo } from "@/components/blocks/food/food12"; export default function Page() { return <Food12 {...food12Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | ReactNode | undefined | Optional section heading above the slideshow. |
| description | string | undefined | Optional intro line under the heading. |
| slides | Slide[] | none | Slides shown in order, looping back to the first after the last. |
| autoPlayMs | number | 4500 | Milliseconds between automatic slide advances. |
| className | string | none | Extra classes for the outer section element. |
Types
interface Slide { title: string; caption?: string; image?: { src: string; alt: string }; }
Behavior notes
- Real autoplay: a setInterval started inside useEffect from a fixed initial slide index (0) advances one slide every autoPlayMs, and is cleared on unmount; autoplay is skipped entirely when there's only one slide.
- Prev/next arrow buttons and the dot indicators both call the same goTo(index) handler used by autoplay, wrapping around at either end with modulo arithmetic - there is no separate 'pause on manual interaction' behavior, so autoplay keeps advancing after a manual click.
- Dots use aria-current to mark the active slide and each has a descriptive aria-label naming that slide's title, since they're icon-less controls.
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.