Skip to content

PageLayout

Combines PageHeader with AsyncContent for consistent page structure.

Props

PageLayoutProps<T>

PropTypeRequiredDescription
titlestring | ReactNodeNoPage title
subtitlestring | ReactNodeNoPage subtitle
backButtonBackButtonConfigNoBack button configuration
actionsReactNodeNoHeader action buttons
isLoadingbooleanNoLoading state
errorError | nullNoError object
dataT | nullNoData for async content
isEmptybooleanNoOverride empty detection
childrenReactNode | (data: T) => ReactNodeYesPage content
onRetry() => voidNoRetry callback
loadingComponentReactNodeNoCustom loading UI
errorComponentReactNodeNoCustom error UI
emptyComponentReactNodeNoCustom empty UI
classNamestringNoContainer class
headerClassNamestringNoHeader class
contentClassNamestringNoContent class

BackButtonConfig

PropertyTypeDescription
tostringNavigation URL
labelstringButton label
onClick() => voidCustom click handler

Example

tsx
<PageLayout
  title="Users"
  subtitle="Manage user accounts"
  backButton={{ to: '/dashboard' }}
  actions={<Button>Add User</Button>}
  isLoading={isLoading}
  error={error}
  data={users}
  onRetry={refetch}
>
  {(users) => <UserTable users={users} />}
</PageLayout>

See also