N
Nyxis
Multimodal

VisionInput

Vision-input dropzone — drag-and-drop, file picker, paste, optional camera capture.

Preview

Installation

pnpm add nyxis-ui

Usage

import { VisionInput } from 'nyxis-ui';

const [file, setFile] = useState<File | null>(null);

<VisionInput value={file} onChange={setFile} maxBytes={5 * 1024 * 1024} />;

Input methods

MethodBehaviour
Drag-and-dropHighlights the dropzone in primary tone.
File pickerClick anywhere on the empty dropzone.
Paste (Cmd/Ctrl+V)Document-level handler; ignored when an <input> has focus.
Camera captureTap the “Use camera” button. Mobile devices launch the rear camera (capture="environment").

Validation

  • Pass maxBytes to enforce a size cap. Oversize files surface a destructive inline error.
  • Non-image MIME types are rejected.
  • Already-selected files can be removed via the X button on the preview.