Skip to content

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.

PropTypeDefaultDescription
filestring—Currently uploaded file data URL
fileNamestring—Name of the uploaded file
videoUrlstring—External video URL (YouTube, Vimeo, etc.)
thumbnailSrcstring | null—Poster frame shown for `videoUrl`. Defaults to the inline placeholder; pass `null` to render the "linked, no poster" fallback.
videoThumbnailstring | null—Undocumented — add TSDoc to the prop in the library.
resolveThumbnailResolveThumbnaildefaultResolveThumbnailInjected poster resolver. Must not perform network I/O.
acceptstring"video/mp4File accept string
uploadLabelstring"Choose a video or drag & drop it here"Upload copy
fileTypesLabelstring".mp4File types copy
initialUrlDraftstring""Seeds the URL box so "half-typed a link" is a static story rather than a keystroke path.
urlDraftstring—Fully controlled URL box. Pair with `onUrlDraftChange`.
onUrlDraftChange(value: string) => void—Undocumented — add TSDoc to the prop in the library.
errorstring | null—Validation message under the URL box. Overrides the built-in message.
uploadProgressnumber | null—0–100 while a file is uploading; `null`/omitted when idle.
uploadingFileNamestring—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.
classNamestring—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.