PageShell

A page layout component with header, body, and optional wrapper sections. Supports back navigation and sticky header.

Note: For new projects, consider using AppPageShell which provides a more modern API.

Import

import { PageShell } from '@tidbcloud/uikit/biz'

Basic Usage

import { PageShell } from '@tidbcloud/uikit/biz'
 
function Demo() {
  return (
    <PageShell title="Page Title">
      <p>Page content goes here</p>
    </PageShell>
  )
}

With Back Button

import { PageShell } from '@tidbcloud/uikit/biz'
 
function Demo() {
  return (
    <PageShell title="Details Page" showBack onBack={() => window.history.back()}>
      <p>Detail content</p>
    </PageShell>
  )
}
import { PageShell } from '@tidbcloud/uikit/biz'
 
function Demo() {
  return (
    <PageShell title="Long Page" stickyHeader>
      {/* Long scrollable content */}
    </PageShell>
  )
}

With Right Section

import { PageShell } from '@tidbcloud/uikit/biz'
import { Button, Group } from '@tidbcloud/uikit'
 
function Demo() {
  return (
    <PageShell
      title="Settings"
      rightSection={
        <Group>
          <Button variant="default">Cancel</Button>
          <Button>Save</Button>
        </Group>
      }
    >
      <p>Settings form here</p>
    </PageShell>
  )
}

With Wrapper

import { PageShell } from '@tidbcloud/uikit/biz'
 
function Demo() {
  return (
    <PageShell title="Wrapped Page" withWrapper wrapperProps={{ maw: 800, mx: 'auto' }}>
      <p>Centered content with max width</p>
    </PageShell>
  )
}

Props

PropTypeDefaultDescription
titleReactNode-Page title
childrenReactNode-Page content
withWrapperbooleanfalseWrap content in div container
wrapperPropsBoxProps-Wrapper element props
stickyHeaderbooleanfalseMake header sticky
rightSectionReactNode-Right section content
showBackboolean-Show back button
onBack() => void-Back click handler
bodyPropsBoxProps-Body element props

PageShellBase

A composable page shell system with individual components for building custom page layouts.

Import

import { PageShellBase } from '@tidbcloud/uikit/biz'

Basic Usage

import { PageShellBase } from '@tidbcloud/uikit/biz'
 
function Demo() {
  return (
    <PageShellBase.Root>
      <PageShellBase.Header>
        <PageShellBase.Title>Custom Page</PageShellBase.Title>
      </PageShellBase.Header>
      <PageShellBase.Body>
        <p>Content here</p>
      </PageShellBase.Body>
    </PageShellBase.Root>
  )
}

With Back Button

import { PageShellBase } from '@tidbcloud/uikit/biz'
 
function Demo() {
  return (
    <PageShellBase.Root>
      <PageShellBase.Header leftSection={<PageShellBase.BackButton />}>
        <PageShellBase.Title>Details</PageShellBase.Title>
      </PageShellBase.Header>
      <PageShellBase.Body>
        <p>Content</p>
      </PageShellBase.Body>
    </PageShellBase.Root>
  )
}

Sub-components

ComponentDescription
PageShellBase.RootRoot container
PageShellBase.HeaderHeader section
PageShellBase.TitleTitle component
PageShellBase.BodyBody content area
PageShellBase.BackButtonBack navigation button

PageShellBase.Header Props

PropTypeDefaultDescription
stickybooleanfalseSticky positioning
leftSectionReactNode-Left section content
rightSectionReactNode-Right section content