Hero Section
Features Section
CTA Section
© 2024 Company
Scaffold is a comprehensive layout component that provides the foundation for your application. It manages the positioning of AppBar, Sidebar, Footer, and BottomNav to create professional, responsive layouts. It should only be used in layout files (+layout.svelte).
Hero Section
Features Section
CTA Section
© 2024 Company
The Scaffold component should only be used in layout files (+layout.svelte). It provides the structural foundation for your entire page and coordinates fixed elements like AppBar, Sidebar, and BottomNav. Using it in regular page components will cause layout conflicts.
Layout Patterns
mainClass="vh-16 mt-16"startClass="invisible lg:visible lg:w-56"mainClass="mt-16 pb-16"Key Concepts
When using an AppBar, add top margin to bodyClass to prevent content from being
hidden:
h-16, use bodyClass="mt-16"h-20, use bodyClass="mt-20"Set the width of sidebars using startClass and endClass:
startClass="w-56" - Fixed width sidebarstartClass="invisible lg:visible lg:w-56" - Responsive sidebarApply vh-* utilities to Sidebar components for proper height:
vh-16 = calc(100vh - 4rem) - With AppBar h-16vh-32 = calc(100vh - 8rem) - With AppBar + BottomNavUse mainClass to style the main content area:
mainClass="p-4" - Add paddingmainClass="lg:p-4 pb-16" - Responsive padding with BottomNav spacemainClass="vh-16 mt-16" - Full height content (landing pages)Real-World Examples
Props
Prop | Type | Default |
|---|