Skip to content

armgit / pdfcn

Public Imported from GitHub
0

Beautiful pdf components, built on Takumi and Forme. 100% Free, Zero config, one command setup.

2.7 KB
Raw Blame
---
title: "Section"
description: "Section wrapper with optional title."
---

<ComponentPreview base="takumi" name="section" hideCode />

## Installation

<CodeTabs>

<TabsList>
  <TabsTrigger value="cli">Command</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>

<TabsContent value="cli">

```bash
npx shadcn@latest add @pdfcn/takumi/section
```

</TabsContent>

<TabsContent value="manual">

<Steps>

<Step>Install the following dependencies:</Step>

```bash
npm install takumi-pdf @takumi-rs/helpers
```

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource
  src="registry/bases/takumi/components/section/section.tsx"
  base="takumi"
  title="components/pdf/section/section.tsx"
/>

<ComponentSource
  src="registry/bases/takumi/components/theme-provider.tsx"
  base="takumi"
  title="components/pdf/theme-provider.tsx"
/>

<ComponentSource
  src="registry/bases/takumi/lib/resolve-color.ts"
  base="takumi"
  title="lib/resolve-color.ts"
/>

<ComponentSource
  src="registry/bases/takumi/lib/pdf-primitives.tsx"
  base="takumi"
  title="lib/pdf-primitives.tsx"
/>

<ComponentSource
  src="registry/bases/takumi/lib/pdf-svg.tsx"
  base="takumi"
  title="lib/pdf-svg.tsx"
/>

<ComponentSource
  src="registry/themes/professional.ts"
  base="takumi"
  title="lib/pdf-themes/professional.ts"
/>

<ComponentSource
  src="registry/themes/primitives.ts"
  base="takumi"
  title="lib/pdf-themes/primitives.ts"
/>

<ComponentSource
  src="registry/types/pdf-themes.ts"
  base="takumi"
  title="types/pdf-themes.ts"
/>

<ComponentSource
  src="registry/types/pdf-components.ts"
  base="takumi"
  title="types/pdf-components.ts"
/>

<Step>Update the import paths to match your project setup.</Step>

</Steps>

</TabsContent>

</CodeTabs>

## Usage

```tsx
import { Section } from "@/components/pdf/section";
import { Text } from "@/components/pdf/text";
```

```tsx
<Section>
  <Text>Section body</Text>
</Section>
```

## API Reference

### Section

| Prop          | Type                                              | Default     |
| ------------- | ------------------------------------------------- | ----------- |
| `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`     |