Skip to content

Page

Layout component for creating consistent page structures.

The Page component provides a consistent layout structure with a title and content area.

  • Consistent page header styling
  • Flexible content area
  • Optional panel styling
  • Responsive layout
  • Tailwind CSS integration
import { Page } from '@cratis/components/Common';
function MyPage() {
return (
<Page title="My Page">
<div>Page content goes here</div>
</Page>
);
}

By default the title is not rendered. Pass showTitle to opt in:

<Page title="My Page" showTitle>
<div>Page content goes here</div>
</Page>
<Page title="Dashboard" panel>
<div>Content with panel background</div>
</Page>
  • title: Page title string (always required, used e.g. for accessibility or document title even when not visible)
  • showTitle: Render the title as a visible heading (default: false)
  • panel: Apply panel styling to content area (default: false)
  • children: Page content
  • All standard HTML div attributes (className, style, etc.)

The Page component uses Flexbox for layout:

  • Full height container
  • Large heading (h1) at the top
  • Flexible content area that fills remaining space
  • Overflow handling for scrollable content
<Page title="Users">
<UserList />
</Page>
<Page title="Dashboard" panel>
<div className="grid grid-cols-3 gap-4">
<StatCard title="Users" value={totalUsers} />
<StatCard title="Orders" value={totalOrders} />
<StatCard title="Revenue" value={totalRevenue} />
</div>
<div className="mt-4">
<RecentActivity />
</div>
</Page>
<Page
title="Reports"
className="custom-page"
style={{ backgroundColor: '#f5f5f5' }}
>
<ReportViewer />
</Page>

Works with:

  • Tailwind CSS for styling
  • React Router for navigation
  • Any content components