---
title: "PageHero"
description: "Первый экран страницы: крупный заголовок, описание и кнопки действий."
canonical_url: "https://b24-ui.bx-shef.by/docs/components/page-hero"
---
# PageHero

> Первый экран страницы: крупный заголовок, описание и кнопки действий.

## Использование

Компонент PageHero открывает страницу: оборачивает содержимое в [Container](https://b24-ui.bx-shef.by/raw/docs/components/container.md) и при этом остаётся во всю ширину, поэтому под ним легко положить фон, изображение или узор. Иллюстрацию передайте в слот по умолчанию.

По умолчанию ориентация вертикальная: заголовок, описание и кнопки стоят по центру, а на узком экране кнопки переносятся на следующую строку.

```vue
<script setup lang="ts">
import type { ButtonProps } from '@bxshefby/b24ui-nuxt'

const links = ref<ButtonProps[]>([
  {
    label: "Начать",
    to: "/docs/getting-started/",
    color: "air-primary"
  },
  {
    label: "Компоненты",
    to: "/docs/components/",
    color: "air-secondary-accent-2"
  }
])
</script>

<template>
  <B24PageHero title="Bitrix24. Ваше рабочее пространство." description="Единая платформа для команды и продаж: задачи, CRM и общение в одном окне." :links="links" />
</template>
```

### Заголовок

Пропс `title` задаёт заголовок первого экрана.

```vue
<template>
  <B24PageHero title="Bitrix24. Ваше рабочее пространство." />
</template>
```

> [!TIP]
> Заголовок по умолчанию отрисовывается как `h1`. Чтобы изменить тег, передайте в пропс `as` объект, например `:as="{ title: 'h2' }"`. Корневой элемент задаётся так же: `:as="{ root: 'section', title: 'h2' }"`.

### Описание

Пропс `description` задаёт описание под заголовком.

```vue
<template>
  <B24PageHero title="Bitrix24. Ваше рабочее пространство." description="Единая платформа для команды и продаж: задачи, CRM и общение в одном окне." />
</template>
```

### Надзаголовок

Пропс `headline` задаёт строку над заголовком.

```vue
<template>
  <B24PageHero title="Bitrix24. Ваше рабочее пространство." description="Единая платформа для команды и продаж: задачи, CRM и общение в одном окне." headline="Новый выпуск" />
</template>
```

### Ссылки

Пропс `links` показывает под описанием список кнопок [Button](https://b24-ui.bx-shef.by/raw/docs/components/button.md). Размер кнопок по умолчанию — `xl`.

```vue
<script setup lang="ts">
import type { ButtonProps } from '@bxshefby/b24ui-nuxt'

const links = ref<ButtonProps[]>([
  {
    label: "Начать",
    icon: "i-bx24-main-play-circle",
    to: "/docs/getting-started/",
    color: "air-primary"
  },
  {
    label: "Компоненты",
    trailingIcon: "i-bx24-actions-arrow-to-the-right",
    to: "/docs/components/",
    color: "air-secondary-accent-2"
  }
])
</script>

<template>
  <B24PageHero title="Bitrix24. Ваше рабочее пространство." description="Единая платформа для команды и продаж: задачи, CRM и общение в одном окне." :links="links" />
</template>
```

### Ориентация

Пропс `orientation` ставит текст и слот по умолчанию рядом (`horizontal`) или друг под другом (`vertical`). По умолчанию `vertical`.

```vue
<script setup lang="ts">
import type { ButtonProps } from '@bxshefby/b24ui-nuxt'

const links = ref<ButtonProps[]>([
  {
    label: "Начать",
    icon: "i-bx24-main-play-circle",
    to: "/docs/getting-started/",
    color: "air-primary"
  },
  {
    label: "Компоненты",
    trailingIcon: "i-bx24-actions-arrow-to-the-right",
    to: "/docs/components/",
    color: "air-secondary-accent-2"
  }
])
</script>

<template>
  <B24PageHero title="Bitrix24. Ваше рабочее пространство." description="Единая платформа для команды и продаж: задачи, CRM и общение в одном окне." headline="Новый выпуск" orientation="horizontal" :links="links">
    <img src="/b24ui/assets/demo/communications-main.png.webp" width="352" height="647" alt="Иллюстрация" class="w-full rounded-lg" loading="lazy" />
  </B24PageHero>
</template>
```

### Обратный порядок

Пропс `reverse` меняет порядок слота по умолчанию на обратный.

```vue
<script setup lang="ts">
import type { ButtonProps } from '@bxshefby/b24ui-nuxt'

const links = ref<ButtonProps[]>([
  {
    label: "Начать",
    icon: "i-bx24-main-play-circle",
    to: "/docs/getting-started/",
    color: "air-primary"
  },
  {
    label: "Компоненты",
    trailingIcon: "i-bx24-actions-arrow-to-the-right",
    to: "/docs/components/",
    color: "air-secondary-accent-2"
  }
])
</script>

<template>
  <B24PageHero title="Bitrix24. Ваше рабочее пространство." description="Единая платформа для команды и продаж: задачи, CRM и общение в одном окне." headline="Новый выпуск" orientation="horizontal" reverse :links="links">
    <img src="/b24ui/assets/demo/communications-main.png.webp" width="352" height="647" alt="Иллюстрация" class="w-full rounded-lg" loading="lazy" />
  </B24PageHero>
</template>
```

## API

### Пропсы

```ts
/**
 * Props for the PageHero component
 */
interface PageHeroProps {
  /**
   * The element or component this component should render as.
   * @default 'div'
   */
  as?: any;
  /**
   * The headline displayed above the title.
   */
  headline?: string | undefined;
  title?: string | undefined;
  description?: string | undefined;
  /**
   * Display a list of Button under the description.
   * `{ size: 'xl' }`
   */
  links?: ButtonProps[] | undefined;
  /**
   * The orientation of the page hero.
   * @default 'vertical'
   */
  orientation?: "horizontal" | "vertical" | undefined;
  /**
   * Reverse the order of the default slot.
   * @default false
   */
  reverse?: boolean | undefined;
  b24ui?: { root?: SlotClass; container?: SlotClass; wrapper?: SlotClass; header?: SlotClass; headline?: SlotClass; title?: SlotClass; description?: SlotClass; body?: SlotClass; footer?: SlotClass; links?: SlotClass; } | undefined;
}
```

### Слоты

```ts
/**
 * Slots for the PageHero component
 */
interface PageHeroSlots {
  top(): any;
  header(): any;
  headline(): any;
  title(): any;
  description(): any;
  body(): any;
  footer(): any;
  links(): any;
  default(): any;
  bottom(): any;
}
```

## Тема

```ts [app.config.ts]
export default defineAppConfig({
  b24ui: {
    pageHero: {
      slots: {
        root: 'relative isolate',
        container: 'flex flex-col lg:grid py-24 sm:py-32 lg:py-40 gap-16 sm:gap-y-24',
        wrapper: '',
        header: '',
        headline: 'mb-4',
        title: 'text-7xl sm:text-9xl text-pretty tracking-tight font-(--ui-font-weight-bold) text-label',
        description: 'text-(length:--ui-font-size-2xl) sm:text-(length:--ui-font-size-3xl)/8 text-description',
        body: 'mt-10',
        footer: 'mt-10',
        links: 'flex flex-wrap gap-x-6 gap-y-3'
      },
      variants: {
        orientation: {
          horizontal: {
            container: 'lg:grid-cols-2 lg:items-center',
            description: 'text-pretty'
          },
          vertical: {
            container: '',
            headline: 'justify-center',
            wrapper: 'text-center',
            description: 'text-balance',
            links: 'justify-center'
          }
        },
        reverse: {
          true: {
            wrapper: 'order-last'
          }
        },
        headline: {
          true: {
            headline: 'font-(--ui-font-weight-semi-bold) text-(--ui-color-accent-main-primary) flex items-center gap-1.5'
          }
        },
        title: {
          true: {
            description: 'mt-6'
          }
        }
      }
    }
  }
})
```

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
