---
title: File Field
description: A file input to upload multiple files, with ability to drag and drop files.

link:
  doc: https://kobalte.dev/docs/core/components/file-field
  api: https://kobalte.dev/docs/core/components/file-field#api-reference
---

<ComponentPreview name="file-field-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/file-field-demo.tsx

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

<StepItem>Copy and paste the following code into your project:</StepItem>

  <ComponentSourceTabs>

    ```tsx title="components/ui/file-field" file=<rootDir>/apps/docs/src/registry/ui/file-field.tsx

    ```

    ```tsx title="components/ui/file-field" file=<rootDir>/apps/unocss-playground/src/registry/ui/file-field.tsx

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

## Usage

```tsx
import {
  FileField,
  FileFieldDropzone,
  FileFieldHiddenInput,
  FileFieldItem,
  FileFieldItemDeleteTrigger,
  FileFieldItemList,
  FileFieldItemName,
  FileFieldItemPreviewImage,
  FileFieldItemSize,
  FileFieldLabel,
  FileFieldTrigger,
} from "@components/ui/file-field"
```

```tsx
<FileField>
  <FileFieldDropzone>
    <FileFieldLabel />
    <FileFieldTrigger />
  </FileFieldDropzone>
  <FileFieldHiddenInput />
  <FileFieldItemList>
    {() => (
      <FileFieldItem>
        <FileFieldItemPreviewImage />
        <FileFieldItemName />
        <FileFieldItemSize />
        <FileFieldItemDeleteTrigger />
      </FileFieldItem>
    )}
  </FileFieldItemList>
</FileField>
```
