# Section

Section wrapper with optional title.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).



<ComponentPreview base="forme" name="section" />

## Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

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

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @pdfcn/forme/section
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Install the following dependencies:
      </Step>

      ```bash
      npm install @formepdf/react @formepdf/core
      ```

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

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

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

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

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

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

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

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

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

## Usage [#usage]

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

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

## API Reference [#api-reference]

### Section [#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     |
