Hero
Compose flexible hero sections with consistent spacing and layout patterns. Perfect for landing pages, product launches, and marketing content where first impressions matter.
Built with compound components for maximum flexibility—mix and match Meta, Title, Description, Actions, and Media to create any hero layout.
Installation
shellUsage
tsxAnatomy
Hero is a compound component with these parts:
tsxProps
Hero.Root
Layout container for hero content. Extends Kookie UI's Flex component.
Responsive Layout Type:
tsxAll other Flex props from Kookie UI are supported.
Hero.Meta
Container for logos, badges, and metadata above the title.
All other Flex props from Kookie UI are supported.
Hero.Title
Main heading. Extends Kookie UI's Heading component.
All other Heading props from Kookie UI are supported.
Hero.Description
Supporting text. Extends Kookie UI's Text component.
All other Text props from Kookie UI are supported.
Hero.Actions
Container for buttons and CTAs.
All other Flex props from Kookie UI are supported.
Hero.Media
Container for images and media content.
All other Flex props from Kookie UI are supported.
Examples
Basic Hero
Simple centered hero with title and description:
tsxMarketing Hero
Full marketing hero with all components:
tsxLeft-Aligned Hero
Align content to the start for editorial layouts:
tsxSplit Layout Hero
Horizontal layout with content and media side-by-side:
tsxWith Custom Spacing
Fine-tune spacing for your design:
tsxWith Badge Metadata
Add badges or status indicators above the title:
tsxIn Section and Container
Combine with Kookie UI layout components:
tsxResponsive Layout
Adapt layout based on screen size—stacked on mobile, split on desktop:
tsxLayout Patterns
Hero supports two primary layout modes:
Stacked (Default)
Vertical layout where all content flows top-to-bottom:
- Meta
- Title
- Description
- Actions
- Media (if
position="below")
Best for: Landing pages, centered marketing content, mobile-first designs
Split
Horizontal layout with content and media side-by-side:
- Left: Title, Description, Actions
- Right: Media (if
position="right")
Best for: Product pages, feature showcases, desktop-optimized layouts
Accessibility
Hero provides semantic HTML structure for screen readers and SEO:
Semantic HTML
Hero.Titleuses<h1>by default (customizable withasprop)- Proper heading hierarchy preserved
- Semantic Flex container structure
Keyboard Navigation
- All interactive children (buttons, links) are keyboard accessible
- Standard tab navigation applies
Screen Readers
- Title announces as heading with appropriate level
- Logical reading order maintained by flex layout
- Description provides context for main heading
Changelog
Changed
- Complete rewrite with compound component architecture
- Added
Hero.Meta,Hero.Description,Hero.Actions,Hero.Mediacomponents - Added
layoutprop withstackedandsplitmodes - Updated default styles for all sub-components
- Removed variant aliases (Variant1, One) in favor of clear compound API
Added
- Flexible composition patterns for any hero layout
- Built-in sensible defaults while maintaining full customization
- Support for left, center, right alignment
- Media positioning system