Veil UI
Components

Full Screen Layout

A viewport-height layout with optional header, footer and centering.

Installation

$ npx veil-ui@latest add full-screen-layout

Usage

import { FullScreenLayout } from "@/components/ui/full-screen-layout";

<FullScreenLayout centered>
  <LoginCard />
</FullScreenLayout>;

Examples

Centered

Sign in

Use the centered variant for auth screens.

Application frame

Workspace
Main area fills the remaining height.
Status: online

Padded

Padding is applied to the main region.

API reference

PropTypeDefaultDescription
headerReact.ReactNode—Optional top bar.
footerReact.ReactNode—Optional bottom bar.
centeredbooleanfalseCenter the main content on both axes.
paddedbooleanfalseApply responsive padding to the main region.
...propsReact.ComponentProps<"div">—All native div attributes.

Accessibility

  • The main region is a main landmark.
  • Centering is visual only; keep the DOM order logical.
  • Avoid trapping scroll inside the layout; it grows with its content.

Vue and plain HTML

This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add full-screen-layout --framework vue or switch the framework in components.json.

<script setup lang="ts">
import { cn } from "@/lib/utils";

const props = withDefaults(
  defineProps<{
    centered?: boolean;
    padded?: boolean;
    class?: string;
  }>(),
  {
    centered: false,
    padded: false,
  },
);
</script>

<template>
  <div
    data-slot="full-screen-layout"
    :class="cn('flex min-h-dvh flex-col bg-background', props.class)"
  >
    <header
      v-if="$slots.header"
      data-slot="full-screen-layout-header"
      class="border-b"
    >
      <div class="px-4 py-3 sm:px-6">
        <slot name="header" />
      </div>
    </header>
    <main
      data-slot="full-screen-layout-main"
      :class="
        cn(
          'flex flex-1 flex-col',
          props.centered && 'items-center justify-center',
          props.padded && 'p-4 sm:p-6',
        )
      "
    >
      <slot />
    </main>
    <footer
      v-if="$slots.footer"
      data-slot="full-screen-layout-footer"
      class="border-t"
    >
      <div class="px-4 py-3 sm:px-6">
        <slot name="footer" />
      </div>
    </footer>
  </div>
</template>

On this page