All blocks
Centered Hero
Centered marketing hero pairing an eyebrow badge, balanced display headline, supporting copy, dual call-to-action buttons, and a wide 16:9 architectural showcase frame.
Atelier Solis · Monograph 04
Spaces shaped by daylight
Quiet concrete pavilions, timber courtyards, and coastal studios designed to frame shifting sun and horizon lines.

Install
1npx stylexblocks add centered-heroSource
components/blocks/ui-sdk/centered-hero.tsx
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186import * as stylex from "@stylexjs/stylex";import { useCallback, useMemo } from "react";import { AspectRatio } from "#components/ui/ui-sdk/aspect-ratio.tsx";import { Badge } from "#components/ui/ui-sdk/badge.tsx";import { Button } from "#components/ui/ui-sdk/button.tsx";import { Heading } from "#components/ui/ui-sdk/heading.tsx";import { Icon } from "#components/ui/ui-sdk/icon.tsx";import { Section } from "#components/ui/ui-sdk/section.tsx";import { HStack, VStack } from "#components/ui/ui-sdk/stack.tsx";import { Text } from "#components/ui/ui-sdk/text.tsx";import { Toast, Toaster } from "#components/ui/ui-sdk/toast.tsx";import { semanticColors } from "@stylexblocks/ui/semantic-tokens/colors.stylex.ts";import { semanticRadii } from "@stylexblocks/ui/semantic-tokens/radii.stylex.ts";import { semanticShadows } from "@stylexblocks/ui/semantic-tokens/shadows.stylex.ts";import { accentPalette } from "@stylexblocks/ui/themes/palettes.ts";import { fonts } from "@stylexblocks/ui/tokens/fonts.stylex.ts";import { spacing } from "@stylexblocks/ui/tokens/spacing.stylex.ts";import type { StyleOverrideProps } from "#lib/recipe-props.ts";
const styles = stylex.create({ root: { backgroundColor: semanticColors.bg, color: semanticColors.fg, fontFamily: fonts.body, minHeight: "100%", paddingBlock: { default: spacing._12, "@media (max-width: 640px)": spacing._8, }, paddingInline: spacing._6, width: "100%", }, content: { marginBlock: "auto", maxWidth: "75rem", width: "100%", }, header: { textAlign: "center", }, headline: { marginBlock: 0, maxWidth: "18ch", textAlign: "center", textWrap: "balance", }, description: { maxWidth: "54ch", textWrap: "balance", }, mediaSection: { width: "100%", }, heroFrame: { backgroundColor: semanticColors.bgMuted, borderColor: semanticColors.border, borderRadius: semanticRadii.panelLg, borderStyle: "solid", borderWidth: "1px", boxShadow: semanticShadows.lg, marginInline: "auto", maxWidth: "75rem", }, heroImage: { display: "block", height: "100%", objectFit: "cover", width: "100%", },});
export interface CenteredHeroProps extends StyleOverrideProps { /** Optional eyebrow pill displayed above the display headline. */ eyebrow?: string; /** Primary display headline. */ title?: string; /** Supporting subheadline copy. */ description?: string; /** Label for the primary call-to-action button. */ primaryLabel?: string; /** Label for the secondary call-to-action button. */ secondaryLabel?: string; /** Artwork source URL or data URI rendered inside the 16:9 media stage. */ imageSrc?: string; /** Accessible description for the hero artwork. */ imageAlt?: string; /** Called when the primary CTA button is activated. */ onPrimaryAction?: () => void; /** Called when the secondary CTA button is activated. */ onSecondaryAction?: () => void;}
/** * CenteredHero — marketing hero section pairing a centered display headline, * supporting copy, dual call-to-action buttons, and a wide 16:9 full-bleed * architectural media stage below the fold line. */export function CenteredHero({ eyebrow = "Atelier Solis · Monograph 04", title = "Spaces shaped by daylight", description = "Quiet concrete pavilions, timber courtyards, and coastal studios designed to frame shifting sun and horizon lines.", primaryLabel = "Explore projects", secondaryLabel = "Book a studio visit", imageSrc = "/images/blocks/centered-hero/travertine-pavilion.webp", imageAlt = "Sunlit travertine architectural pavilion with three coastal arches and a calm reflecting pool at golden hour", onPrimaryAction, onSecondaryAction, palette, style,}: CenteredHeroProps) { const queue = useMemo(() => Toast.createToaster(), []);
const handlePrimary = useCallback(() => { onPrimaryAction?.(); queue.info("Opening the Monograph 04 project archive…", { description: "18 built pavilions and coastal commissions ready to browse.", }); }, [onPrimaryAction, queue]);
const handleSecondary = useCallback(() => { onSecondaryAction?.(); queue.info("Studio visit calendar opened", { description: "Private walkthroughs available in Copenhagen and Lisbon.", }); }, [onSecondaryAction, queue]);
return ( <VStack align="center" gap="0" palette={palette} style={[styles.root, style]}> <VStack render={<main />} gap="10" style={styles.content}> <VStack render={<header />} align="center" gap="6" style={styles.header}> <VStack align="center" gap="3"> {eyebrow ? ( <Badge variant="subtle" size="md"> {eyebrow} </Badge> ) : null} <Heading render={<h1 />} size="6xl" style={styles.headline}> {title} </Heading> <Text variant="muted" size="lg" align="center" style={styles.description}> {description} </Text> </VStack>
<HStack wrap="wrap" justify="center" gap="3"> <Button variant="solid" size="lg" palette={accentPalette} onClick={handlePrimary} > {primaryLabel} <Icon size="sm" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" > <path d="M4.5 10h11" /> <path d="M11 5.5 15.5 10 11 14.5" /> </Icon> </Button> <Button variant="surface" size="lg" onClick={handleSecondary}> {secondaryLabel} </Button> </HStack> </VStack>
<Section.Root aria-label="Featured architectural showcase" style={styles.mediaSection}> <Section.Body> <AspectRatio ratio="wide" rounded="lg" style={styles.heroFrame}> <img src={imageSrc} alt={imageAlt} {...stylex.props(styles.heroImage)} /> </AspectRatio> </Section.Body> </Section.Root> </VStack>
<Toaster toaster={queue} /> </VStack> );}
Inspired by the Centered Hero template from Astryx (MIT License · Copyright (c) 2026 Meta Platforms, Inc.).