Logoshadcn-docs-template
DocsDemo
Sections
  • Get Started
Getting Started
  • Introduction
  • Installation
Customization
  • Customizing the Template
  • MDC Components
  • Composables
  • Writing Documentation
Components
  • DocTabs
  • Callout
  • ComponentPreview
  • CommandMenu
  • CopyButton
  • DocsSidebar
  • DocsTableOfContents
  • PageHeader
  • SiteHeader
  • CopyCodeButton
  • DocsCopyPage
  • CodeBlockCommand
  • CommandMenuItem
  • CommandMenuKbd
  • GitHubLink
  • LucideIcon
  • MainNav
  • MobileNav
  • ModeSwitcher
  • PageHeaderDescription
  • PageHeaderHeading
  • SiteBody
  • SiteConfig
  • SiteFooter
  • OgImage (Custom)

SiteBody

PreviousNext

A wrapper component that sets up global body styles and CSS variables.

The SiteBody component provides the root container for your site with global styles and CSS variables.

Usage

<script setup lang="ts">
import { SiteBody } from '@/components/SiteBody'
</script>

<template>
  <SiteBody>
    <!-- Your site content -->
  </SiteBody>
</template>

Features

CSS Variables

Sets up CSS variables for:

  • --header-height: Height of the header
  • --footer-height: Height of the footer

Global Styles

  • Prevents overscroll (overscroll-none)
  • Antialiasing for better text rendering
  • Responsive footer height (smaller on mobile, larger on desktop)

API Reference

SiteBody

No props. Uses slot for content.

CSS Variables

--header-height: calc(var(--spacing) * 14)
--footer-height: calc(var(--spacing) * 14) /* mobile */
--footer-height: calc(var(--spacing) * 24) /* xl screens */

Usage in Layout

Typically used as the root component in your app layout:

<template>
  <SiteBody>
    <SiteHeader />
    <main>
      <slot />
    </main>
    <SiteFooter />
  </SiteBody>
</template>
PageHeaderHeadingSiteConfig

On This Page

UsageFeaturesCSS VariablesGlobal StylesAPI ReferenceSiteBodyCSS VariablesUsage in Layout
© shadcn-vue.com