We use cookies to ensure you get the best experience on our website. Read our privacy policy

Skip to main content

Directory

Hero Section

The Hero section component creates visually striking page headers with support for background images, breadcrumb navigation, and flexible content layouts. Perfect for landing pages, article headers, and key content sections.

Hero sections are designed to be:

  • Impactful: Full-width design with optional background images
  • Flexible: Supports various content types and layouts
  • Responsive: Adapts seamlessly across all device sizes
  • Accessible: Built with semantic HTML and proper image handling
<Hero>
Welcome to Our Site
<Fragment slot="subtitle"> Discover amazing content and features </Fragment>
</Hero>

Add visual impact with optimized background images:

<Hero
image={{
file: import('@/assets/images/hero.jpg'),
alt: 'Mountain landscape',
quality: 'high',
class: 'bg-gradient-to-b from-primary/20',
}}
>
Featured Content
</Hero>

Enable contextual navigation with built-in breadcrumbs:

<Hero
pathname="/docs/components/hero"
breadcrumb={{
show: true,
showHome: true,
removePaths: ['docs'],
}}
>
Documentation
</Hero>

Display timestamps for content:

<Hero date={new Date('2024-03-01')}> Latest Updates </Hero>
Prop Type Default Description
image { file: ImageMetadata, alt: string, quality?: 'low' | 'max' | 'mid' | 'high', class?: string } undefined Background image configuration
pathname string undefined Current page path for breadcrumbs
date Date undefined Publication date to display
breadcrumb { show: boolean, removePaths?: string[], showHome?: boolean } { show: true, showHome: true } Breadcrumb navigation options
Slot Description
default Main heading content
subtitle Secondary text below the heading

The Hero component automatically handles image optimization with:

  • Responsive image sizes
  • Lazy loading
  • Multiple width variants
  • Quality presets
  • Priority loading for above-the-fold content
  1. Content Guidelines

    • Keep headings concise and impactful
    • Use subtitles to provide context
    • Ensure text remains readable over background images
    • Maintain consistent tone across hero sections
  2. Image Usage

    • Optimize images for web performance
    • Choose images that don’t interfere with text readability
    • Consider mobile viewing experience
    • Use appropriate quality settings for your needs
  3. Layout Considerations

    • Maintain adequate spacing around content
    • Ensure proper contrast for text
    • Consider viewport heights on different devices
    • Test breadcrumb visibility with different backgrounds
  • Landing page headers
  • Article introductions
  • Section breaks
  • Feature showcases
  • Product presentations
  • Category headers
  • Portfolio items
  • Blog post headers

The Hero section automatically adjusts:

  • Font sizes across breakpoints
  • Padding and margins
  • Image scaling and cropping
  • Content layout and spacing
  • Banner - For announcements and notifications
  • Header - For site-wide navigation
  • Card - For featured content blocks
  • Image - For standalone image display

Limited Time Launch Sale

Create stunning page headers with our pre-built Hero component. Get the AstroJS starter template now and make your content stand out.

GET 60% OFF!
North Star Themes Logo

Subscribe to our newsletter

Get the latest AstroJS tips and tricks right to your inbox

Email: [email protected]

© 2025 North Star Themes

Web Kit Provided By North Star Themes