Skip to content

File trigger

Pro

Makes any library button open the file picker, or the camera on phones; useFileTrigger does it from a menu item. Not an M3 component (@windmorph/react-pro).

import { FileTrigger, useFileTrigger } from '@windmorph/react-pro';

Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.

Purpose

Makes a library button open the system file picker, or the camera on phones. Browsers open the picker only through a file input, so FileTrigger keeps one hidden and lets the button you wrap be the control, as DialogTrigger and MenuTrigger do for dialogs and menus. It is not an M3 component, so it comes from @windmorph/react-pro.

To frame a photo before upload, pass the chosen file to ImageCropDialog.

When not to use

For several photos that people drop, reorder and watch upload, a Media upload grid.

See also

  • Image crop: Frames a photo before upload: drag, pinch or zoom it behind a fixed frame, and get the crop in the original pixels. Not an M3 component (@windmorph/react-pro).
  • Button: Five variants and five sizes for text actions, with a toggle form and a press morph.
  • Icon button: A compact icon-only action; requires an accessible name.