Skip to content
New

Hero, photo

beta

Where and what, a warm headline, two actions and three short facts beside a large photo of the place or a dish.

npx rasengan-ui add hero-photo

Cameroonian kitchen · Akwa, Douala

Home cooking, the way Douala likes it

Ndolé on Fridays, grilled fish every evening, and plantains fried to order. Eat in on the terrace or take it home.

  • Open every day
  • Delivery in Akwa and Bonapriso
  • Since 2009
A plate of beef stew with vegetables, on a wooden table, seen from above.
Use it
Opening the site of a restaurant, a salon or a shop, where a photo says more than a slogan.
Avoid it
No good photo yet: use hero-centered with text alone.

Installation

Terminal
npx rasengan-ui add hero-photo

It installs into components/blocks/hero-photo/, with what it uses (Button, Text reveal) and lib/blocks.ts.

Usage

Without content, the block shows its example. Pass your own, typed by the block's schema, from a content file (here, the example with one field changed):

app/_routes/index.page.tsx
import { HeroPhoto } from "@/components/blocks/hero-photo";
import { home } from "@/content/home";
 
export default function Home() {
  return <HeroPhoto content={home.hero} />;
}
content/home.ts
import { example, type HeroPhotoContent } from "@/components/blocks/hero-photo";
 
export const home = {
  hero: {
    ...example,
    headline: "Your welcome in a few words",
  } satisfies HeroPhotoContent,
};

The photo loads eagerly, as it is above the fold. Use a real photo of the place or its best dish, landscape (about 4:3).

Content

FieldTypeLimitsGuidance
eyebrowoptionalstring≤ 48 charsWhat and where, briefly: 'Cameroonian kitchen · Akwa, Douala'.
headlinestring6–60 charsThe place's promise, warm and concrete: 'Home cooking, the way Douala likes it'.
sublinestring20–180 charsWhat people come for, in one or two sentences.
primaryobjectThe main action: 'See the menu', 'Book a table', 'Order on WhatsApp'.
primary.labelstring1–32 charsA verb first, two to four words: 'Start free', 'Book a table'.
primary.hrefstringA path ('/pricing'), an anchor ('#menu'), or a full URL.
secondaryoptionalobject
secondary.labelstring1–32 charsA verb first, two to four words: 'Start free', 'Book a table'.
secondary.hrefstringA path ('/pricing'), an anchor ('#menu'), or a full URL.
highlightsoptionalstring[]≤ 3 itemsShort facts under the actions: 'Open every day', 'Delivery in Akwa and Bonapriso'.
imageobjectA photo of the place or its best dish, landscape (4:3). Its alt says what it shows.
image.srcstringA local path ('/images/terrace.jpg') or the project's asset URL.
image.altstring≤ 140 charsWhat the image shows, for people who cannot see it. Empty only if purely decorative.
image.widthinteger
image.heightinteger

Props

PropNotes
contentHeroPhotoContent; the example when left out
idthe section's id, for anchor links; "hero" by default
headingLevel1, 2 or 3: the heading's tag; 1 by default
classNameon the <section>, for spacing

Accessibility

  • A <section> named by its headline, the page's h1 by default.
  • The photo's alt says what it shows; the highlights are a list.