Main New

A main content element that expands to fill the full viewport height.

Usage

The Main component renders a <main> element that works together with the Header component to create a full-height layout that extends to the viewport's available height.

The Main component uses the --b24ui-header-height CSS variable to position itself correctly below the Header.

Examples

Within app.vue

Use the Main component in your app.vue or in a layout:

app.vue
<template>
  <B24App>
    <B24Header />

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

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

API

Props

Prop Default Type
as'main'any

The element or component this component should render as.

b24ui { base?: any; }

Slots

Slot Type
default{}

Theme

app.config.ts
export default defineAppConfig({
  b24ui: {
    main: {
      base: 'min-h-[calc(100vh-var(--b24ui-header-height))]'
    }
  }
})
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import bitrix24UIPluginVite from '@bitrix24/b24ui-nuxt/vite'

export default defineConfig({
  plugins: [
    vue(),
    bitrix24UIPluginVite({
      b24ui: {
        main: {
          base: 'min-h-[calc(100vh-var(--b24ui-header-height))]'
        }
      }
    })
  ]
})
Releases
Published under MIT License.

Copyright © 2024-present Bitrix24