Page
A flexible container component for building structured page layouts with optional sidebars.
Overview
The Page component serves as the main container for your page layout, providing a flexible three-column structure with optional left and right sidebars. It's designed to be used as the root component for your page layouts.
Usage
Basic Usage
Main content
<template>
<MPage>
<MPageBody>
Main content
</MPageBody>
</MPage>
</template>
With Sidebars
Left Sidebar
Right Sidebar
Main content
<template>
<MPage left="bg-gray-100 p-4" right="bg-gray-100 p-4">
<template #left>
Left Sidebar
</template>
<MPageBody>
Main content
</MPageBody>
<template #right>
Right Sidebar
</template>
</MPage>
</template>
Custom Styling
Content with custom spacing and background
<template>
<MPage class="bg-gray-50 p-4" wrapper="gap-8">
<MPageBody>
Content with custom spacing and background
</MPageBody>
</MPage>
</template>
Props
wrapper
string
Class for the outer wrapper element that contains all three columns.
class
string
Class for the main content area.
left
string
Class for the left sidebar column.
right
string
Class for the right sidebar column.
Slots
default
any
Main content area, typically contains a PageBody component.
left
any
Left sidebar content.
right
any
Right sidebar content.
Best Practices
- Layout Structure:
- Use the Page component as the root container for your layouts
- Keep sidebars optional and use them only when necessary
- Consider the mobile experience when using sidebars
- Responsive Design:
- Test your layout across different screen sizes
- Use appropriate classes for responsive behavior
- Consider collapsing or hiding sidebars on smaller screens
- Content Organization:
- Use the main content area for primary content
- Place secondary navigation or filters in sidebars
- Maintain consistent spacing between columns
- Accessibility:
- Ensure proper content order in the DOM
- Use semantic HTML within slots
- Consider keyboard navigation between columns