Scaffold

Scaffold is a layout component that provides a base structure for your application with support for AppBar, side Sidebars (start/end), and BottomBar.

Preview

Main Content

This is the main scrollable content.

Builder

vh Utility
Sections

The component accepts the following props:

Prop
Type
Default
Title

Description Error

No data

There are no records to display

⚠️ Important: Fixed Classes and vh Utilities Usage

Fixed Classes

The start and end components have fixed classes by default. Additionally, if you use AppBar or BottomBar, these also have fixed classes.

Margins Usage

To achieve a correct layout, you must use margins in mainClass, startClass, and endClass.

  • If you have a start sidebar with w-48, use ml-48 in mainClass
  • If you have an end sidebar with w-56, use mr-56 in mainClass
  • If you have an AppBar with h-16, use mt-16 in mainClass, startClass, and endClass

vh Utilities

The vh-* utilities calculate the viewport height by subtracting the specified value:

  • vh-16: Calculates calc(100vh - 4rem) - Ideal when there's only an AppBar with h-16
  • vh-32: Calculates calc(100vh - 8rem) - Ideal when there's both AppBar and BottomBar, each with h-16

These utilities are applied to mainClass, startClass, and endClass so that components have the correct height without causing scroll on the main page.

Complete Example

<Scaffold
  mainClass="lg:ml-48 xl:mr-56 vh-16 mt-16"
  startClass="vh-16 mt-16"
  endClass="vh-16 mt-16"
>
  {#snippet appBar()}
    <AppBar class="h-16">
      <!-- AppBar content -->
    </AppBar>
  {/snippet}

  {#snippet start()}
    <Sidebar class="w-48">
      <!-- Start sidebar content -->
    </Sidebar>
  {/snippet}

  <!-- Main content -->
  <div>Content</div>

  {#snippet end()}
    <div class="w-56">
      <!-- End sidebar content -->
    </div>
  {/snippet}
</Scaffold>

In this example:

  • vh-16 is used because there's an AppBar with h-16
  • mt-16 creates space for the fixed AppBar
  • ml-48 creates space for the start sidebar
  • mr-56 creates space for the end sidebar

💡 Tip: If you have both AppBar and BottomBar, each with h-16, you should use vh-32 instead of vh-16 to add both heights (16 + 16 = 32).

Available vh Utilities

vh-8

calc(100vh - 2rem)

vh-10

calc(100vh - 2.5rem)

vh-12

calc(100vh - 3rem)

vh-14

calc(100vh - 3.5rem)

vh-16

calc(100vh - 4rem)

vh-20

calc(100vh - 5rem)

vh-24

calc(100vh - 6rem)

vh-32

calc(100vh - 8rem)

vh-40

calc(100vh - 10rem)