Preview Updated 2026-05-10

PageHeader

All-in-one page header with title + description + breadcrumb + actions + toolbar + tabs.

Basic usage

PageHeader is a composition container that arranges the common page-header pieces (breadcrumb, title, description, actions) in a fixed layout. title / description are convenience props; for richer content, override the same-named slots.

项目设置

管理项目成员、权限以及通知偏好。

<CfPageHeader
title="Project settings"
description="Manage members, permissions, and notification preferences."
>
<template #breadcrumb>
  <CfBreadcrumb :items="[
    { label: 'Workbench', href: '#' },
    { label: 'Projects', href: '#' },
    { label: 'Settings' },
  ]" />
</template>
<template #actions>
  <CfButton variant="tertiary">Cancel</CfButton>
  <CfButton variant="primary">Save</CfButton>
</template>
</CfPageHeader>
<CfPageHeader
title="Project settings"
description="Manage members, permissions, and notification preferences."
breadcrumb={
  <CfBreadcrumb items={[
    { label: 'Workbench', href: '#' },
    { label: 'Projects', href: '#' },
    { label: 'Settings' },
  ]} />
}
actions={
  <>
    <CfButton variant="tertiary">Cancel</CfButton>
    <CfButton variant="primary">Save</CfButton>
  </>
}
/>

Tabs + rich title

Embed Tabs directly in the tabs slot / prop and they will sit flush with the header (a negative margin pins them to the bottom edge).

chufix v0.0.1

Vue 3 + React 双框架同源的基础组件库

<CfPageHeader>
<template #title>
  chufix
  <CfTag tone="primary" variant="solid" size="sm">v0.0.1</CfTag>
</template>
<template #description>Single-source Vue 3 + React component library</template>
<template #actions>
  <CfButton variant="tertiary" size="sm">Share</CfButton>
  <CfButton variant="primary" size="sm">Deploy</CfButton>
</template>
<template #tabs>
  <CfTabs v-model="tab" :items="items" />
</template>
</CfPageHeader>
<CfPageHeader
title={<>chufix <CfTag tone="primary" variant="solid" size="sm">v0.0.1</CfTag></>}
description="Single-source Vue 3 + React component library"
actions={<><CfButton size="sm" variant="tertiary">Share</CfButton><CfButton size="sm" variant="primary">Deploy</CfButton></>}
tabs={<CfTabs value={tab} items={items} onChange={setTab} />}
/>

Three sizes

size controls padding and font size — sm (sub-pages / inside modals) / md (default) / lg (landing-page emphasis).

size = sm

紧凑头部,适合详情子页或弹窗内

size = md

默认尺寸

size = lg

落地页或主页强调

<CfPageHeader title="size = sm" description="Compact header" size="sm" />
<CfPageHeader title="size = md" description="Default size" size="md" />
<CfPageHeader title="size = lg" description="Landing-page emphasis" size="lg" />
<CfPageHeader title="size = sm" description="Compact header" size="sm" />
<CfPageHeader title="size = md" description="Default size" size="md" />
<CfPageHeader title="size = lg" description="Landing-page emphasis" size="lg" />

No bottom border

bordered={false} removes the default bottom divider so the header sits flush against the page background or the next card.

无底边的页头

bordered=false 把底部分隔线去掉,紧贴页面背景

<CfPageHeader
title="Header without bottom border"
description="bordered=false drops the bottom divider"
:bordered="false"
/>
<CfPageHeader
title="Header without bottom border"
description="bordered=false drops the bottom divider"
bordered={false}
/>

API

PropTypeDefaultDescription
titlestring | ReactNodeMain title (h1); pick this or the #title slot
descriptionstring | ReactNodeSubtitle / description
size'sm' | 'md' | 'lg''md'Overall padding and font size
borderedbooleantrueBottom border

Vue slots: breadcrumb / back / title / description / actions / toolbar / tabs. React uses same-named props receiving ReactNode.

反馈与讨论

PageHeader · Discussion

0
0 / 600
一键发送
正在加载评论...