GitHub

Hero

Block
Hero section with animated title reveals

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { Hero } from "@corew500/ui/blocks/hero"

<Hero>Content</Hero>

API Reference

Props

PropTypeDefaultDescription
title*stringHero title text (required)
subtitlestringSubtitle or description text
actionHeroActionPrimary call-to-action button
secondaryActionHeroActionSecondary call-to-action button
mediaHeroMediaFeatured media (image) below the content
titleEffectHeroTitleEffectText effect to apply to specific title words. Words are identified by 0-indexed position after splitting on spaces.
contentWidthenum4xlMaximum width of the content area
decorativeenumfalseShow decorative border accents
animatedenumtrueEnable entrance animations (default true)
renderCta(action: HeroAction, isPrimary: boolean) => ReactNodeCustom render function for CTA buttons
heightenumauto
alignenumcenter

Accessibility

Screen Readers

  • Title is an `<h1>` heading for SEO and screen readers
  • Media images require alt text for screen readers

Additional

  • - Renders as a `<section>` element for proper document structure
  • Animations respect `prefers-reduced-motion` system setting
  • CTA buttons have proper accessible names from labels

Localization

Translatable Content

  • - All text props (title, subtitle, action labels) should be pre-translated

Additional

  • Component does not contain internal i18n logic
  • Use `renderCta` for localized link components (e.g., next-intl Link)

Related

Related Components