Store editor
Video upload field
Video by upload or by URL, with a thumbnail resolver.
Available
Needs mock props
Examples
Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.
Video upload field
Rendered live from Storybook
Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.
Props
The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.
| Prop | Type | Default | Description |
|---|---|---|---|
file | string | — | Currently uploaded file data URL |
fileName | string | — | Name of the uploaded file |
videoUrl | string | — | External video URL (YouTube, Vimeo, etc.) |
thumbnailSrc | string | null | — | Poster frame shown for `videoUrl`. Defaults to the inline placeholder; pass `null` to render the "linked, no poster" fallback. |
videoThumbnail | string | null | — | Undocumented — add TSDoc to the prop in the library. |
resolveThumbnail | ResolveThumbnail | defaultResolveThumbnail | Injected poster resolver. Must not perform network I/O. |
accept | string | "video/mp4 | File accept string |
uploadLabel | string | "Choose a video or drag & drop it here" | Upload copy |
fileTypesLabel | string | ".mp4 | File types copy |
initialUrlDraft | string | "" | Seeds the URL box so "half-typed a link" is a static story rather than a keystroke path. |
urlDraft | string | — | Fully controlled URL box. Pair with `onUrlDraftChange`. |
onUrlDraftChange | (value: string) => void | — | Undocumented — add TSDoc to the prop in the library. |
error | string | null | — | Validation message under the URL box. Overrides the built-in message. |
uploadProgress | number | null | — | 0–100 while a file is uploading; `null`/omitted when idle. |
uploadingFileName | string | — | Name shown during upload. Falls back to `fileName`. |
onCancelUpload | () => void | — | Undocumented — add TSDoc to the prop in the library. |
onFileChange | (file: string, fileName: string) => void | — | Called when a file is uploaded |
onRemove | () => void | — | Called when file/video is removed |
onVideoUrlChange | (videoUrl: string, videoThumbnail?: string) => void | — | Called when a video URL + thumbnail is set |
onUrlError | (message: string) => void | — | Called when a pasted/entered URL fails validation. |
className | string | — | Undocumented — add TSDoc to the prop in the library. |
Reference
Transcribed from the component audit. If this disagrees with the source, the source is right.
- Source
src/components/store/editor/VideoUploadField.tsx- Portability
- Needs its app dependencies replaced by props before it renders in isolation.
- Notes
- The live Vimeo oEmbed lookup is replaced by an injected resolver — no network calls in the library.