Overview
Shape Hero is a sophisticated hero section component featuring floating geometric shapes with glass-morphism effects, animated entrances, and beautiful gradient typography. Perfect for landing pages and hero sections.Installation
- Tab Title
- Tab Title
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title1 | string | "Elevate Your" | First line of the hero title |
title2 | string | "Digital Vision" | Second line of the hero title (with gradient) |
Usage
Basic Usage
Custom Titles
Full Page Example
Features
- 8 Floating Shapes: Strategically positioned geometric rectangles
- Glass-Morphism: Subtle backdrop blur and translucent effects
- Staggered Animations: Each shape animates in with unique timing and rotation
- Floating Motion: Continuous subtle vertical floating animation
- Gradient Typography: Beautiful gradient text effects for the second title
- Dark Mode Support: Optimized colors for both light and dark themes
- Custom Font: Uses Pacifico font for elegant script typography
- Responsive Design: Adapts to all screen sizes
Shape Configuration
Each shape is created using theElegantShape component with these props:
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Positioning classes (absolute positioning) |
delay | number | 0 | Animation entrance delay in seconds |
width | number | 400 | Shape width in pixels |
height | number | 100 | Shape height in pixels |
rotate | number | 0 | Rotation angle in degrees |
gradient | string | "from-white/[0.08]" | Gradient color (Tailwind class) |
borderRadius | number | 16 | Corner radius in pixels |
Included Shapes
The component includes 8 pre-configured shapes:- Tall Rectangle (top-left): Indigo, 300x500px, -8° rotation
- Wide Rectangle (bottom-right): Rose, 600x200px, 15° rotation
- Square (middle-left): Violet, 300x300px, 24° rotation
- Small Rectangle (top-right): Amber, 250x100px, -20° rotation
- Medium Rectangle (center-right): Emerald, 400x150px, 35° rotation
- Small Square (bottom-left): Blue, 200x200px, -25° rotation
- Tiny Rectangle (top-center): Purple, 150x80px, 45° rotation
- Wide Rectangle (middle): Teal, 450x120px, -12° rotation
Customization
Adding More Shapes
Changing Colors
Modify the gradient prop to use different Tailwind colors:Adjusting Animation Timing
Edit thefadeUpVariants in the component:
Animation Details
Entrance Animation
- Shapes start above the viewport and rotated
- Fade in and drop down with easing
- 2.4 second duration with custom cubic-bezier easing
- Staggered delays for cascade effect
Floating Animation
- Continuous vertical motion (0 → 15px → 0)
- 12 second duration
- Infinite loop with easeInOut
- Creates organic, breathing effect
Dependencies
motion(Framer Motion) - For all animationsnext/font/google- For Pacifico font loadingreact- Core React featurescnutility - For className merging (from shadcn/ui)
Typography
The component uses two different text styles:- Title 1: Bold sans-serif with black→black/80 gradient
- Title 2: Pacifico script font with indigo→white→rose gradient
- Responsive sizing (4xl → 6xl → 8xl)
- Gradient text via
bg-clip-text - Tight tracking for modern look
- Fade-up entrance animation
Accessibility
- Semantic HTML with proper heading hierarchy
- Decorative shapes don’t interfere with screen readers
- Sufficient text contrast ratios
- Supports prefers-reduced-motion (via Framer Motion defaults)
Performance Notes
- Shapes use CSS transforms for GPU acceleration
- Framer Motion optimizes animations automatically
- Google Fonts loaded with
next/fontfor optimal performance - Absolute positioning prevents layout shifts
Browser Support
Works in all modern browsers that support:- CSS backdrop-filter
- CSS clip-path for text gradients
- CSS transforms and animations
- Framer Motion requirements