---
title: "Main"
description: "Основной элемент содержимого, который растягивается на всю высоту окна просмотра."
canonical_url: "https://b24-ui.bx-shef.by/docs/components/main"
---
# Main

> Основной элемент содержимого, который растягивается на всю высоту окна просмотра.

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

Компонент Main отрисовывает элемент `<main>`, который вместе с компонентом [Header](https://b24-ui.bx-shef.by/raw/docs/components/header.md) образует раскладку на всю доступную высоту окна просмотра.

> [!TIP]
> See: /docs/getting-started/theme/css-variables/#header
> Компонент Main использует CSS-переменную `--b24ui-header-height`, чтобы расположиться точно под `Header`.

## Примеры

### В `app.vue`

Используйте Main в `app.vue` или в раскладке:

```vue [app.vue]
<template>
  <B24App>
    <B24Header />

    <B24Main>
      <NuxtLayout>
        <NuxtPage />
      </NuxtLayout>
    </B24Main>

    <B24Footer />
  </B24App>
</template>
```

## API

### Пропсы

```ts
/**
 * Props for the Main component
 */
interface MainProps {
  /**
   * The element or component this component should render as.
   * @default 'main'
   */
  as?: any;
  b24ui?: { base?: any; } | undefined;
}
```

### Слоты

```ts
/**
 * Slots for the Main component
 */
interface MainSlots {
  default(): any;
}
```

## Тема

```ts [app.config.ts]
export default defineAppConfig({
  b24ui: {
    main: {
      base: 'min-h-[calc(100vh-var(--b24ui-header-height))]'
    }
  }
})
```

## Sitemap

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