Put the icon and the words in FileTrigger as children. onSelect gets the picked files; your app checks and sends them.
import-contacts.tsx
FileTrigger
<button>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| busy | boolean | false | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. |
| spinner | "center""start" | "start" | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. |
| glass | "clear""dark""light" | — | |
| rounded | "default""full" | — | |
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | — | |
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | — | |
| on | — | The picked files, after each pick (also the same file again). It does not run on a cancel. | |
| on | — | A pick that fails (a picker blocked in a cross-origin frame). Default: reportError. | |
| accept | string | — | The types the picker offers (accept of the file input): ".csv", "image/*", … |
| multiple | boolean | false | More than one file in one pick. Default false. |
| directory | boolean | false | The picker chooses a folder (webkitdirectory), and every file in it comes back. |
| capture | "environment" | "user" | boolean | — | The camera on a phone (capture): "user" (front) or "environment" (back). |
| actions | RefObject<{ open: () => void; } | null> | — | Gets open: the picker, called in a user press (a menu item, a shortcut). |
| render | — | Another element to press instead of the Button: render={<MenuItem />} makes a menu item that opens the picker (a source menu). It gets the press and data-popup-open only. | |
From Base UIButtonBase UI docs | |||
| focusable | boolean | false | Whether the button should be focusable when disabled. |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| native | boolean | true | Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>). |
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. |
| EnterorSpace | Opens the file picker. |
|---|
Built with
Installs with File Trigger
- Components
- Button







