Hero 04
flx/hero-04FreeBlock
A two-column editorial hero with a soft background wash and a layered collage of two overlapping images.
Install it
npx shadcn@latest add https://ui.flexnative.com/r/hero-04.jsonSource
1'use client'23import * as React from 'react'4import { motion, useReducedMotion, type Variants } from 'motion/react'5import Balancer from 'react-wrap-balancer'67import { cn } from '@/lib/utils'89import { Cta, type CtaProps } from '../../shared/cta'10import { ArtCollage } from './art-collage'1112export interface Hero04Props {13 title: string14 washImage?: string15 titleLine2?: string16 description: string17 primaryImage: string18 secondaryImage: string19 primaryAlt?: string20 secondaryAlt?: string21 animation?: 'none' | 'subtle'22 primaryCTA: CtaProps23 secondaryCTA?: CtaProps24 variant?: 'standard' | 'compact'25}2627const variantStyles = {28 standard: {29 section: 'py-20 sm:py-28',30 title: 'text-3xl sm:text-4xl md:text-5xl',31 description: 'max-w-md text-sm sm:text-base',32 header: 'gap-5',33 grid: 'gap-12 lg:gap-16',34 },35 compact: {36 section: 'py-14 sm:py-20',37 title: 'text-2xl sm:text-3xl md:text-4xl',38 description: 'max-w-sm text-sm',39 header: 'gap-4',40 grid: 'gap-10 lg:gap-12',41 },42} as const4344const container: Variants = {45 hidden: {},46 visible: { transition: { staggerChildren: 0.1, delayChildren: 0.05 } },47}4849const item: Variants = {50 hidden: { opacity: 0, y: 12, filter: 'blur(6px)' },51 visible: {52 opacity: 1,53 y: 0,54 filter: 'blur(0px)',55 transition: { duration: 0.5, ease: [0.22, 1, 0.36, 1] },56 },57}5859const mediaItem: Variants = {60 hidden: { opacity: 0, y: 24, filter: 'blur(8px)' },61 visible: {62 opacity: 1,63 y: 0,64 filter: 'blur(0px)',65 transition: { duration: 0.6, ease: [0.22, 1, 0.36, 1] },66 },67}6869function Reveal({70 active,71 variants,72 className,73 children,74}: Readonly<{75 active: boolean76 variants?: Variants77 className?: string78 children: React.ReactNode79}>) {80 if (!active) return <div className={className}>{children}</div>8182 return (83 <motion.div variants={variants ?? item} className={className}>84 {children}85 </motion.div>86 )87}8889export function Hero04({90 title,91 titleLine2,92 description,93 washImage,94 primaryImage,95 secondaryImage,96 primaryAlt = '',97 secondaryAlt = '',98 animation = 'none',99 primaryCTA,100 secondaryCTA,101 variant = 'standard',102}: Readonly<Hero04Props>) {103 const reduce = useReducedMotion()104 const animate = animation === 'subtle' && !reduce105 const vs = variantStyles[variant]106107 const backgroundElement = washImage && (108 <div109 aria-hidden110// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from flx
All 446 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Basicaccordion-01 | flx | Blocks | Free | no deps | |
| Multipleaccordion-02 | flx | Blocks | Free | no deps | |
| With iconsaccordion-03 | flx | Blocks | Free | no deps | |
| FAQaccordion-04 | flx | Blocks | Free | no deps | |
| Separated cardsaccordion-05 | flx | Blocks | Free | no deps | |
| Plus / minus iconaccordion-06 | flx | Blocks | Free | 1 dep | |
| Left chevronaccordion-07 | flx | Blocks | Free | 1 dep | |
| Rich contentaccordion-09 | flx | Blocks | Free | no deps |
