Skip to Content

Hero

Hero section components for landing pages: a full-height hero container, background layer for images, scenes or gradients, centered or split layouts, and slots for headline, subtitle, CTA buttons and media.

pnpm dlx shadcn add @01orbital/hero

The example also uses button, heading and text. Install them too:

pnpm dlx shadcn add @01orbital/button @01orbital/heading @01orbital/text

Usage

import { Heading } from "@/components/heading/heading"
import {
  Hero,
  HeroActions,
  HeroContainer,
  HeroContent,
} from "@/components/hero/hero"
import { Text } from "@/components/text/text"
import { buttonVariants } from "@/components/ui/button"

// The copy: change text here, not in the markup.
const COPY = {
  title: "Pages that start finished.",
  description:
    "Heroes, pricing, features and footers built on the same parts, so the first draft already looks like the last.",
  primary: "Browse the blocks",
  secondary: "Read the docs",
} as const

/** Hero in its stacked form: headline, description and two actions. */
export default function HeroDemo() {
  return (
    <Hero className="min-h-0 w-full py-16">
      <HeroContainer>
        <HeroContent>
          <Heading>{COPY.title}</Heading>
          <Text size="lg">{COPY.description}</Text>
          <HeroActions>
            <a href="#" className={buttonVariants({ size: "lg" })}>
              {COPY.primary}
            </a>
            <a
              href="#"
              className={buttonVariants({ variant: "outline", size: "lg" })}
            >
              {COPY.secondary}
            </a>
          </HeroActions>
        </HeroContent>
      </HeroContainer>
    </Hero>
  )
}

Examples

New

hero-festival-lineup

hero-festival-lineup

Festival Lineup

Event hero example showing Hero for a music festival, with a pill link down to the Friday set times.

pnpm dlx shadcn add @01orbital/hero-festival-lineup

Anatomy

Hero is built from 6 parts. In the example they nest like this:

Hero
└─ HeroContainer
   └─ HeroContent
      └─ HeroActions

API reference

Hero

It accepts the HTML attributes of the element it renders.

HeroContainer

Prop

Type

It also accepts the HTML attributes of the element it renders.

HeroContent

Prop

Type

It also accepts the HTML attributes of the element it renders.

HeroActions

Prop

Type

It also accepts the HTML attributes of the element it renders.

HeroBackground

It accepts the HTML attributes of the element it renders.

HeroMedia

It accepts the HTML attributes of the element it renders.

Dependencies

npm: class-variance-authority, cn. The CLI installs them for you.

No other registry pieces.