Component guideEditable source

Image Card

A figure with an image, caption, border, and hard shadow.

On this page4 sectionsBack to top

Use Image Card when an image and its caption form one piece of content. It is a default export. The caption also supplies the image alternative text, so use a meaningful description rather than a filename.

Live preview
Loading preview...

#Installation

Complete the base setup, then install or copy the source:

npx shadcn@latest add https://neobrutal-ui.andongmin.com/r/image-card.json

#Usage

import ImageCard from "@/components/ui/image-card";

export default function WorkspaceImage() {
  return (
    <ImageCard
      imageUrl="/images/workspace.jpg"
      caption="The shared studio workspace"
      className="w-full max-w-sm"
    />
  );
}

Add your own /images/workspace.jpg asset. The component neither uploads nor optimizes images.

#API reference

PropPurposeDefault
imageUrlImage URL or application assetRequired
captionVisible caption and image alternative textRequired
classNameFigure width and layoutWidth 250px

#Accessibility

Choose a caption explaining the image. This component does not expose independent alt text or a decorative-image mode; adapt the copied source when those semantics are needed. The image fills a 4:3 area using object-cover, so verify that cropping preserves the important subject. Keep the original source asset accessible and provide a useful fallback in applications that load remote images.