Skip to content

Hero

Opening sections for a landing page, from a centered headline to a terminal demo or a pointer-reactive motion panel.

Installation & usage

npx @youj/cli add marketing-hero-centered

Also installs aurora, badge, button, icon-arrow-right, stagger, youj-presets, youj-ui-core.

The CLI copies the block to blocks/marketing/hero-centered.tsx with every component it uses, so it’s yours to edit.

Every prop is optional and falls back to the demo, so it renders as you see it until you pass your own. Give it your data, rewrite or translate its strings through copy, and connect its actions:

heroCentered-view.tsx
'use client'

import Link from 'next/link'
import { HeroCentered, type HeroCenteredProps } from '@/blocks/marketing/hero-centered'

export function HeroCenteredView({ primaryCta }: Pick<HeroCenteredProps, 'primaryCta'>) {
  return (
    <HeroCentered
      primaryCta={primaryCta}
      copy={{ badge: 'New' }}
      linkComponent={Link}
    />
  )
}

Reference

Props8 props, 1 types

Props

HeroCentered props
PropType
headlinestring

The headline. Same as copy.headline, which wins.

–
descriptionstring

The sentence under the headline. Same as copy.description, which wins.

–
copyPartial<HeroCenteredCopy>

Any of the block's strings, to rewrite or translate.

–
announcementHeroCenteredCta | null

The announcement pill above the headline; null hides it.

default the demo's launch note

the demo's launch note
primaryCtaHeroCenteredCta

The main call to action.

default "Start deploying" to `#signup`

"Start deploying" to `#signup`
secondaryCtaHeroCenteredCta | null

The second call to action; null hides it.

default "Talk to sales" to `#sales`

"Talk to sales" to `#sales`
linkComponentElementType

Renders every link: pass your router's Link.

default 'a'

'a'
headingLevel1 | 2 | 3

The headline's level.

default 1

1

HeroCenteredCta

HeroCenteredCta props
PropType
labelRequiredstring–
hrefRequiredstring–
onClickMouseEventHandler<HTMLAnchorElement>

Runs on click; the link still follows href unless you call event.preventDefault().

–
Strings4 keys for copy

Strings

copy takes any of these keys; the rest keep their defaults. A key whose text holds a value (a count, a name) takes a function.

badgeheadlinedescriptionnote
Built from4 components

Built from

Accessibilitylandmarks, headings, motion, keyboard

Accessibility

Each hero is a <section> named by its own heading (aria-labelledby). The heading is an h1 by default and an h2 when you set embedded; set headingLevel to 1, 2 or 3 where the page around it needs another.

The product shots, browser frames, terminal sessions and Terminal’s landed site in Split, Product and Terminal are decorative: they are inert (Split’s demo screen and Product also aria-hidden), so the headline and copy have to carry the meaning; a media you pass to Split is read as you give it, so give an image its alt. Split’s points are a named list of buttons, with aria-current on the one on show; its tour has a Play and Pause button in the window’s title bar and holds while keyboard focus is on the points. Motion’s control panel uses labelled controls (a select and switches) under its own headings.

The animated heroes (Split, Terminal, Product, Motion) check the reduced-motion setting and hold a still frame when it is on: Split shows its whole window, with no tour and no camera. The buttons and links are real a and button elements with the kit’s focus ring.