Skip to content

ImageCard

A polaroid-style image display card: the image area locks its geometry with a fixed aspect ratio, while the label footer renders as a solid theme-colored band separated by a thick black rule. The whole card lifts on hover with a hard, blur-free shadow, following the library's unified interaction language.

Preview

Preview

基础拍立得相框

基础拍立得相框示例
Field Record 001

悬浮时整卡上浮,投影保持硬边无模糊。

宽高比与底栏色族

4:3 宽高比示例
Aspect 4:3
16:9 视频宽高比示例
Aspect Video
1:1 方形宽高比示例
Aspect Square

自定义底栏插槽

自定义底栏插槽示例
Archive / 1998[ CONFIDENTIAL ]

Installation

pnpm dlx brutx-vue@latest add image-card

Usage

Basic Usage

vue
<script setup>
import { ImageCard } from 'brutx-ui-vue'
</script>

<template>
    <ImageCard
        class="max-w-xs"
        src="/images/field-record.jpg"
        alt="Field record photo"
        title="Field Record 001"
        description="The whole card lifts on hover with a hard shadow."
    />
</template>

aspect locks the image geometry; accent picks the footer color family.

vue
<template>
    <ImageCard
        src="/images/archive.jpg"
        alt="Archived material"
        aspect="square"
        accent="destructive"
        title="Aspect Square"
    />
</template>

The default slot replaces the title/description structure for free-form footer content.

vue
<template>
    <ImageCard src="/images/archive.jpg" alt="Archived material">
        <div class="flex items-center justify-between font-mono text-xs font-bold uppercase">
            <span>Archive / 1998</span>
            <span>[ CONFIDENTIAL ]</span>
        </div>
    </ImageCard>
</template>

Props

PropTypeDefaultDescription
srcstring(required)Image source URL
altstring''Alternative text; an empty string marks the image as decorative
aspect'4/3' | 'video' | 'square'undefinedImage area aspect ratio; video is 16:9
accent'primary' | 'secondary' | 'accent' | 'destructive' | 'success' | 'info' | 'muted'undefinedFooter color family
titlestringundefinedFooter title in monospace uppercase
descriptionstringundefinedFooter description text
classClassValueundefinedCustom CSS class name

Slots

SlotDescription
defaultReplaces the footer's default title/description structure

Frameless-footer mode

When neither title nor description is provided and no default slot content exists, <figcaption> is skipped and the component degrades to a pure framed image.

Accessibility

  • Alternative text: informative images must provide alt; pass an empty string for purely decorative images so screen readers skip them.
  • Semantic structure: the root is a <figure> and the footer a <figcaption>, preserving native image/caption semantics.
  • Motion degradation: the hover lift transition is the only animation and follows the global reduced-motion policy.

Brute force builds.