Skip to documentation

Design system / Molecules

Molecule / Submission showcase

ShowcaseImageItem

ShowcaseImageItem displays an uncropped image in a shared Card. Info/Download sit at the media frame's bottom-right, independently of the centered, 300px-capped description.

Live example

Live preview

Current component with fictional data. Example changes are not persisted.

Loading image…

Campaign landscape.svg

A fictional landscape image. The whole image stays visible.

Responsibility

A submissions-owned molecule composes the shared Card-based ShowcaseAssetFrame and native image. It owns image-specific loading/error feedback, not carousel navigation.

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.

Maintained component API notes; current source is authoritative
Prop / partTypeRequirementResponsibility
assetSubmissionAttachmentRequiredAuthorized URL or null, filename, MIME type, size, category and description.
framed / showDetailsbooleanOptionalBoth default true. The showcase supplies its own Card or dialog surface and footer, passing false to suppress nested surfaces and duplicate details.
fitnatural | content | fillOptionalDefaults to natural for the existing inline aspect-video frame, or fill for expanded. content follows the image's intrinsic aspect ratio so featured media determines row height without cropping. fill follows an allocated owner height. Neither changes detail sizes.
presentationinline | expandedOptionalDefaults to inline: aspect-video preview, text-xs description and icon-xs actions. Expanded preview uses its owner's remaining height with object-contain; shared footer uses text-sm, icon-sm actions and a wider complete description in a keyboard-scrollable region capped at 20dvh. Expanded portaled disclosures use the scoped dark theme.

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 holds local native loading/ready/error state keyed by URL. The image ref recognizes events that completed before hydration. A changed URL starts a new preview; no refresh request is made. Internal client actions use Radix-owned tooltip/popover disclosure; no new application state or effects are added.

Dependencies

  • ShowcaseAssetFrame / ShowcaseAssetActions (internal)
  • Card / CardContent / Text / Button
  • Tooltip / Popover
  • useShowcasePreview
  • Native img

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
Fill the aspect-video preview without cropping or distorting the image.
Card / CardContent
Existing shared surface, spacing, border and elevation contracts.
Text supporting + text-xs / loose rhythm
Description uses the existing fluid extra-small scale at its owner, retaining complete whitespace and loose reading rhythm.
max-w-75 / --spacing
Only the centered description caps at 75 units of the existing 4px spacing scale (300px by default). It does not determine action placement.
showcase-media / space-y-2 / justify-end
Info and Download share the media frame's bottom-right action row, outside figcaption. The row follows the preview rather than overlaying its contents, so native video controls stay unobstructed. No dimensions are measured.
Button ghost / icon-xs; Info / Download
Two adjacent 24px controls with shared 12px icons. Metadata is behind info, not printed in the caption. Tooltip and Popover retain their existing semantic colors.

Boundaries and limitations

  • Receives no storage key or permission policy. Missing URLs never render an image or open link; file information remains available.
  • Hover or focus info for filename, MIME type, size and category. Click/tap or press Enter/Space to open the same information in a dismissible Popover. Escape closes the panel and restores focus.
  • Open/download is an icon-only link with a tooltip and filename-specific accessible name. It opens the supplied original in a new tab, not a forced download or a new transport operation.
  • Preview failure retains the complete description, information control and any original-access icon. Captions are not clipped into a fixed-height viewport.

Where to make a change

Change image behavior here or common native-preview state in useShowcasePreview. Shared card/figure anatomy belongs to ShowcaseAssetFrame; slide behavior belongs to shadcn Carousel.

Selected real uses

SubmissionShowcase

Dispatches image MIME types while preserving supplied file order and identity.

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

<ShowcaseImageItem asset={authorizedImage} />

Illustrative consumer bindings, not a self-contained product workflow. Live examples supply only local state or explicit fictional props.

All molecules
Current components and theme tokens. Fictional example data. Source views refresh on deployment; authors maintain contract notes.