The Hero component creates a full-width banner section with video or image backgrounds, overlay text content, and call-to-action buttons. It supports customizable styling through display settings for alignment, height, opacity, and text positioning.
The Hero component is typically used as the primary focal point at the top of landing pages, featuring compelling visuals and key messaging to engage visitors.
- Video: Optional background video (takes priority over image)
- Image: Background image (used when no video is provided)
- Heading: Large primary title text
- SubHeading: Secondary descriptive text
- Body: Rich text content (HTML)
- Links: Collection of call-to-action buttons
- Hero Height: Small (18rem), Medium (28rem), Large (38rem), X-Large (48rem)
- Text Placement: Right, Center, Left
- Text Color: White, Black
- Background Tint Level: 0-100 (opacity overlay)
[Placeholder for Hero component screenshot showing background video/image with overlay content]
Hero.astro- Main component implementationhero.graphql- GraphQL fragment for component dataHeroStyling.ts- Style configuration utilitiesDefaultHero.opti-style.json- CMS style configuration
- Video backgrounds auto-play, loop, and are muted for browser compatibility
- Uses
playsinlineattribute for mobile video support - Graceful fallback from video to image background
- Responsive typography scaling (5xl to 6xl on larger screens)
- Dark overlay ensures text readability over any background
- Buttons include hover states and smooth transitions
- Content is properly layered with z-index for visibility
- Supports rich HTML content in body section