Section

带有可选标题的区块容器。

安装

命令

npx shadcn@latest add @pdfcn/takumi/section

手动

安装以下依赖:

npm install takumi-pdf @takumi-rs/helpers

将以下代码复制粘贴到你的项目中。

  • components/pdf/section/section.tsx

  • components/pdf/theme-provider.tsx

  • lib/resolve-color.ts

  • lib/pdf-primitives.tsx

  • lib/pdf-svg.tsx

  • lib/pdf-themes/professional.ts

  • lib/pdf-themes/primitives.ts

  • types/pdf-themes.ts

  • types/pdf-components.ts

更新导入路径以匹配你的项目配置。

用法

import { Section } from "@/components/pdf/section";
import { Text } from "@/components/pdf/text";
<Section>
  <Text>Section body</Text>
</Section>

API 参考

Section

属性 类型 默认值
spacing 'none' | 'sm' | 'md' | 'lg' | 'xl' 'md'
padding 'none' | 'sm' | 'md' | 'lg' -
background string -
border boolean false
variant 'default' | 'callout' | 'highlight' | 'card' 'default'
accentColor string -
noWrap boolean false