# FileTrigger

A button or icon action that hands newly picked files to the application.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"use client";

import { FloodRoot, FileTrigger } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <FileTrigger label="Attach files" multiple onFilesSelect={(files) => appendAttachments(files)} />
    </FloodRoot>
  );
}
```

## Design notes

- Use for a host-owned attachment queue, import action or image picker. FileInput is the corresponding field for native FormData submission.
- Each nonempty pick sends a fresh File array. Cancel is quiet and repeated picks of the same file work. The hidden native input is cleared after each pick.
- Use trigger to compose a named Button or IconButton with the supplied props. accept and capture configure the browser chooser. The host checks the selected content and owns processing.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `label` | `string` | `Required` |
| `onFilesSelect` | `(files: File[]) => void` | `Required` |
| `trigger` | `(props: FileTriggerControlProps) => ReactNode` | `—` |
| `Native HTML props` | `Pick<InputHTMLAttributes<HTMLInputElement>, "accept" \| "capture" \| "multiple" \| "disabled">` | `Forwarded` |
