Veil UI
Components

Image Card

A card pairing a cover image with a title, description and footer.

Installation

$ npx veil-ui@latest add image-card

Usage

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

<ImageCard
  src="/cover.jpg"
  alt="Cover"
  title="Designing with landscape textures"
  description="How natural palettes shape calm interfaces."
/>;

Examples

Basic

Mountains at sunrise
Designing with landscape textures
How natural palettes shape calm interfaces.
6 min read

With content

A team collaborating around a table
Running effective design reviews
A short checklist for sharper feedback.

Bring one decision per review and leave with a clear owner.

API reference

The package exports image-card along with its composable parts. It forwards standard attributes to its root element; see the examples above for the component-specific props.

Accessibility

  • Content uses semantic HTML — lists are lists, tables are tables and metadata uses a definition list.
  • Interactive elements are real buttons or links with visible focus states.
  • Images require meaningful alt text; icons used decoratively are aria-hidden.

Vue and plain HTML

This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add image-card --framework vue or switch the framework in components.json.

<script setup lang="ts">
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card";
import { cn } from "@/lib/utils";

const props = defineProps<{
  src: string;
  alt: string;
  title: string;
  description?: string;
  imageClassName?: string;
  class?: string;
}>();
</script>

<template>
  <Card
    data-slot="image-card"
    :class="cn('overflow-hidden py-0', props.class)"
  >
    <img
      :src="src"
      :alt="alt"
      loading="lazy"
      :class="cn('aspect-video w-full object-cover', imageClassName)"
    />
    <CardHeader class="pt-5">
      <CardTitle>
        <slot name="title">{{ title }}</slot>
      </CardTitle>
      <CardDescription v-if="description || $slots.description">
        <slot name="description">{{ description }}</slot>
      </CardDescription>
    </CardHeader>
    <CardContent v-if="$slots.default">
      <slot />
    </CardContent>
    <div
      v-if="$slots.footer"
      class="flex items-center border-t px-5 py-3 text-sm text-muted-foreground"
    >
      <slot name="footer" />
    </div>
  </Card>
</template>

On this page