Components
Page Shell
A page frame with header, constrained content and footer.
Installation
$ npx veil-ui@latest add page-shellUsage
import { PageShell } from "@/components/ui/page-shell";
<PageShell header={<SiteHeader />} footer={<SiteFooter />} size="md">
<h1>Page title</h1>
</PageShell>;Examples
Basic
Site header
Page title
Content is centered and constrained by the shell.
Narrow
Docs
A narrow reading measure for documentation.
Full width
App
A full-width shell for dashboards and data tables.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| header | React.ReactNode | — | Content of the top bar. |
| footer | React.ReactNode | — | Content of the bottom bar. |
| size | "sm" | "md" | "lg" | "full" | "lg" | Max content width: 3xl, 5xl, 7xl or none. |
| ...props | React.ComponentProps<"div"> | — | All native div attributes. |
Accessibility
- The content region is a single
mainlandmark; header and footer are complementary regions supplied by you. - Keep a single
h1and a logical heading order inside the page. - Add
skiplinks in the header when the navigation is long.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add page-shell --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { computed } from "vue";
import { cn } from "@/lib/utils";
const sizes = {
sm: "max-w-3xl",
md: "max-w-5xl",
lg: "max-w-7xl",
full: "max-w-none",
} as const;
const props = withDefaults(
defineProps<{
size?: keyof typeof sizes;
class?: string;
}>(),
{ size: "lg" },
);
const gutter = "mx-auto w-full px-4 sm:px-6";
const contentClasses = computed(() => cn(gutter, sizes[props.size]));
</script>
<template>
<div
data-slot="page-shell"
:class="cn('flex min-h-dvh flex-col', props.class)"
>
<header v-if="$slots.header" data-slot="page-shell-header" class="border-b">
<div :class="contentClasses">
<slot name="header" />
</div>
</header>
<main data-slot="page-shell-main" class="flex-1">
<div :class="cn(contentClasses, 'py-8')">
<slot />
</div>
</main>
<footer v-if="$slots.footer" data-slot="page-shell-footer" class="border-t">
<div :class="cn(contentClasses, 'py-6')">
<slot name="footer" />
</div>
</footer>
</div>
</template>