---
title: "PageBody"
description: "Контейнер для основного содержимого страницы."
canonical_url: "https://b24-ui.bx-shef.by/docs/components/page-body"
---
# PageBody

> Контейнер для основного содержимого страницы.

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

Компонент PageBody оборачивает основное содержимое и добавляет отступы для единообразного ритма.

Используйте его в слоте по умолчанию компонента [Page](https://b24-ui.bx-shef.by/raw/docs/components/page.md) после компонента [PageHeader](https://b24-ui.bx-shef.by/raw/docs/components/page-header.md):

```vue
<template>
  <B24Page>
    <B24PageHeader />

    <B24PageBody />
  </B24Page>
</template>
```

## Примеры

> [!NOTE]
> В примерах используется [Nuxt Content](https://content.nuxt.com), но компоненты можно подключить к любой системе управления контентом.

### На странице

Используйте PageBody на странице, чтобы показать её содержимое:

```vue [pages/[...slug].vue]
<script setup lang="ts">
const route = useRoute()

definePageMeta({
  layout: 'docs'
})

const { data: page } = await useAsyncData(route.path, () => {
  return queryCollection('docs').path(route.path).first()
})

const { data: surround } = await useAsyncData(`${route.path}-surround`, () => {
  return queryCollectionItemSurroundings('content', route.path)
})
</script>

<template>
  <B24Page>
    <B24PageHeader :title="page.title" :description="page.description" />

    <B24PageBody>
      <ContentRenderer :value="page" />

      <B24Separator />

      <B24ContentSurround :surround="surround" />
    </B24PageBody>

    <template #right>
      <B24ContentToc :links="page.body.toc.links" />
    </template>
  </B24Page>
</template>
```

> [!NOTE]
> В этом примере содержимое страницы отрисовывает компонент [`ContentRenderer`](https://content.nuxt.com/docs/components/content-renderer) из `@nuxt/content`.

## API

### Пропсы

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

### Слоты

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

## Тема

```ts [app.config.ts]
export default defineAppConfig({
  b24ui: {
    pageBody: {
      base: 'mt-8 pb-24 space-y-12'
    }
  }
})
```

## Sitemap

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