# Hero

- Page: <https://kznlabs.github.io/labsUI/components/hero>

## Hero (`hero`, block)

Server-safe opening section: title, text, actions and media, side by side or centered. Follows the width of its container, labels itself with its title and adds no entrance motion, so the headline paints at once.

- Install: `npx @kznlabs/labsui add hero`
- Docs: <https://kznlabs.github.io/labsUI/components/hero>
- Brings: utils
- npm: clsx@^2.1.1, tailwind-merge@^3.7.0

### API

- `<Hero>` (+ <section> props): Opening section of a page: title, text, actions and media.
  - `title: ReactNode`: The headline.
  - `actions?: ReactNode`: Links or buttons under the text, e.g. anchors styled with `buttonVariants()`.
  - `align?: "start" | "center"` = `"start"`: Text alignment. `center` always keeps `media` below the text.
  - `as?: "h1" | "h2"` = `"h1"`: Heading level of the title. Keep one `h1` per page.
  - `description?: ReactNode`: Supporting text under the title.
  - `eyebrow?: ReactNode`: Short line above the title, e.g. a Badge.
  - `media?: ReactNode`: Image, video or a live composition. Beside the text when wide, below it otherwise.

### Usage

```tsx
<Hero title="Ship clips faster" description="Record, trim and share." actions={<a className={buttonVariants()} href="/start">Get started</a>} />
```

### Example: landing.tsx

```tsx
import { Hero } from "@/components/blocks/hero";
import { buttonVariants } from "@/components/ui/button-variants";

export function Landing() {
  return (
    <Hero
      title="Every clip your server remembers"
      description="Record, trim and share highlights without leaving the match."
      actions={
        <a className={buttonVariants()} href="/start">
          Start recording
        </a>
      }
      media={<img src="/clips.png" alt="A wall of match highlights" />}
    />
  );
}
```
