---
title: "PageAside"
description: "Липкая боковая навигация."
canonical_url: "https://b24-ui.bx-shef.by/docs/components/page-aside"
---
# PageAside

> Липкая боковая навигация.

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

Компонент PageAside — липкий элемент `<aside>`, который отображается только начиная с [контрольной точки `lg`](https://tailwindcss.com/docs/breakpoints).

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

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

```vue
<template>
  <B24Page>
    <template #left>
      <B24PageAside />
    </template>
  </B24Page>
</template>
```

## Примеры

### В раскладке

Используйте PageAside в раскладке, чтобы показать навигацию:

```vue [layouts/docs.vue]
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'

const navigation = inject<Ref<NavigationMenuItem[]>>('navigation')
</script>

<template>
  <B24Page>
    <template #left>
      <B24PageAside>
        <B24NavigationMenu
          :key="navigationKey"
          :items="navigation"
          orientation="vertical"
        />
      </B24PageAside>
    </template>

    <slot />
  </B24Page>
</template>
```

> [!NOTE]
> В этом примере навигацию, переданную в `app.vue`, показывает компонент [`NavigationMenu`](https://b24-ui.bx-shef.by/raw/docs/components/navigation-menu.md).

## API

### Пропсы

```ts
/**
 * Props for the PageAside component
 */
interface PageAsideProps {
  /**
   * The element or component this component should render as.
   * @default 'aside'
   */
  as?: any;
  b24ui?: { root?: SlotClass; container?: SlotClass; top?: SlotClass; topHeader?: SlotClass; topBody?: SlotClass; topFooter?: SlotClass; } | undefined;
}
```

### Слоты

```ts
/**
 * Slots for the PageAside component
 */
interface PageAsideSlots {
  top(): any;
  default(): any;
  bottom(): any;
}
```

## Тема

```ts [app.config.ts]
export default defineAppConfig({
  b24ui: {
    pageAside: {
      slots: {
        root: 'hidden overflow-y-auto lg:block lg:max-h-[calc(100vh-var(--b24ui-header-height))] lg:sticky lg:top-(--b24ui-header-height)',
        container: 'relative',
        top: 'sticky -top-8 -mt-8 pointer-events-none z-[1]',
        topHeader: 'h-8 bg-(--ui-color-bg-content-primary) -mx-4 px-4',
        topBody: 'bg-(--ui-color-bg-content-primary) relative pointer-events-auto flex flex-col -mx-4 px-4',
        topFooter: 'h-8 bg-gradient-to-b from-(--ui-color-bg-content-primary) -mx-4 px-4'
      }
    }
  }
})
```

## Sitemap

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