# Document Upload (/docs/components/document-upload)



<ComponentPreview name="document-upload" />

## Installation [#installation]

<Tabs items="[&#x22;Command&#x22;, &#x22;Manual&#x22;]">
  <Tab value="Command">
    <CodeBlockTabs defaultValue="npm">
      <CodeBlockTabsList>
        <CodeBlockTabsTrigger value="npm">
          npm
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="pnpm">
          pnpm
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="yarn">
          yarn
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="bun">
          bun
        </CodeBlockTabsTrigger>
      </CodeBlockTabsList>

      <CodeBlockTab value="npm">
        ```bash
        npx shadcn@latest add @uploadcn/document-upload
        ```
      </CodeBlockTab>

      <CodeBlockTab value="pnpm">
        ```bash
        pnpm dlx shadcn@latest add @uploadcn/document-upload
        ```
      </CodeBlockTab>

      <CodeBlockTab value="yarn">
        ```bash
        yarn dlx shadcn@latest add @uploadcn/document-upload
        ```
      </CodeBlockTab>

      <CodeBlockTab value="bun">
        ```bash
        bun x shadcn@latest add @uploadcn/document-upload
        ```
      </CodeBlockTab>
    </CodeBlockTabs>
  </Tab>

  <Tab value="Manual">
    Install [Upload](/docs/components/upload) first, then copy:

    <ComponentSource name="document-upload" />
  </Tab>
</Tabs>

## Usage [#usage]

```tsx
import { DocumentUpload } from "@/components/document-upload"
```

```tsx
<DocumentUpload variant="resume" name="resume" />
```

## Props [#props]

<TypeTable
  type="{
  adapter: {
    type: &#x22;UploadAdapter&#x22;,
    default: 's3Adapter({ endpoint: &#x22;/api/upload&#x22; })',
    description: &#x22;Where files go.&#x22;,
  },
  variant: {
    type: '&#x22;documents&#x22; | &#x22;pdf&#x22; | &#x22;resume&#x22;',
    default: '&#x22;documents&#x22;',
    description:
      &#x22;Preset for accepted types, limits and copy. `resume` is a single PDF/Word file.&#x22;,
  },
  maxFiles: { type: &#x22;number&#x22; },
  maxSize: { type: &#x22;number&#x22; },
  name: { type: &#x22;string&#x22;, description: &#x22;Form field name.&#x22; },
  onSuccess: { type: &#x22;(item) => void&#x22; },
}"
/>

## Examples [#examples]

### PDF [#pdf]

<ComponentPreview name="pdf-upload" />
