Design system / Molecules
Molecule / Submission showcase
ShowcaseVideoItem
ShowcaseVideoItem retains native controls and metadata-only preload, with the same compact description and Info/Download actions as images. No automatic playback is added.
Live example
Responsibility
The submissions-owned video molecule shares item anatomy with images and other files while retaining a distinct native player and readiness/error behavior. It does not add a custom playback controller.
Public contract
The table describes supported inputs, exported parts and caller responsibilities. A callback supplies a command, such as saving a draft. These notes are maintained manually; check current source types before integration.
| Prop / part | Type | Requirement | Responsibility |
|---|---|---|---|
| asset | SubmissionAttachment | Required | Authorized URL or null and permitted file metadata. |
| framed / showDetails | boolean | Optional | Both default true. false lets a containing showcase supply the surface and footer without duplicates. |
| fit | natural | content | fill | Optional | natural preserves the inline aspect-video default; content follows intrinsic video dimensions; fill serves height-constrained expanded viewing. Native controls and inline detail sizes remain unchanged. |
| presentation | inline | expanded | Optional | Defaults to inline. Expanded uses available-height media and shared text-sm/icon-sm details with a bounded, wider scrollable description. Native controls remain separate from actions. The collection pauses its owned players on open/close, without autoplay or playback-position transfer. |
API notes are curated documentation, not generated types. The source linked above is the current implementation; update these notes alongside API changes.
State and behavior
Identify which values the caller controls and which behavior the component or underlying primitive owns. A local example does not supply persistence, authorization or a complete product lifecycle.
useShowcasePreview owns local loading/ready/error feedback. loadedmetadata completes loading; the ref recognizes readyState/error before hydration. Native controls own playback. No autoplay or loop is set. The internal shared actions delegate tooltip/popover disclosure to Radix.
Dependencies
- ShowcaseAssetFrame / ShowcaseAssetActions (internal)
- Card / CardContent / Text / Button
- Tooltip / Popover
- useShowcasePreview
- Native video
Token and styling contract
These notes identify theme roles, utilities and direct style values used by the source. Direct colors or timings are implementation exceptions, not recommendations to bypass the theme.
size-full / object-contain- Contain the player in the aspect-video preview area.
ShowcaseAssetFrame- Shared Card/CardContent and an independent centered description capped by max-w-75 (300px by default). Actions sit at the media frame's bottom-right, below the player and outside native controls, not inside the description.
ShowcaseAssetActions- Shared ghost/icon-xs Info and Download controls. Filename/MIME/size/category appear only on hover/focus or click/tap; original access has its own tooltip.
Boundaries and limitations
- preload=metadata and playsInline are supplied; the browser controls supported codecs and playback.
- Missing URLs and failed playback retain useful feedback and metadata. Failures keep any original access link.
- Scrolling away does not automatically pause playback in this first version. Carousel keys do not consume keys from the native player.
Where to make a change
Change video behavior in this molecule, not in ContentCarousel or its product adapter. Shared captions remain in ShowcaseAssetFrame.
Selected real uses
SubmissionShowcase
Dispatches video MIME types into independent cards or standard shadcn carousel slides.
Repository path: src/components/showcase/instances/submissionShowcase.tsx
These traces describe selected uses, not every dependency. Repository-only paths are shown as references; only approved files have public source views.
Usage contract
<ShowcaseVideoItem asset={authorizedVideo} />Illustrative consumer bindings, not a self-contained product workflow. Live examples supply only local state or explicit fictional props.