Skip to content
Component installs need the registry setup
VegaStack Design

Thumbnail

A small rounded, cover-fit record image — 32px in a list row, 48px in a card — with a fallback for records that have none.

Status
stable
Since
0.23.10
Accessibility pattern
alt text, or decorative beside its name

Last updated

Aurora Downlight

Install

Add Thumbnail from the VegaStack registry. The CLI verifies the item's integrity hash before writing it.

pnpm dlx shadcn@latest add @vegastack/thumbnail

Usage

import { Thumbnail } from "@/components/ui/thumbnail";

<Thumbnail src={family.imageUrl} alt="" fallback={<BrandMark />} size="sm" />;

Thumbnail shows a record's image, cropped to cover a rounded square. A record with no image — or one whose image fails to load — shows fallback: pass the app's brand mark so an empty record still looks like it belongs. DataList's thumbnail column and MediaCard render it for you.

Aurora Downlight

Examples

Sizes

sm is 32px, for a list row; default is 48px, for a card.

Fallback

With no fallback, a record with no image (or a broken one) shows an image icon on the muted surface.

API Reference

PropTypeDefaultDescription
alt*string—The image's text alternative. Pass "" when the name sits right next to it (a list row, a card title), so the image is decorative.
fallbackReact.ReactNode<ImageIcon />What shows when there is no image, or it fails to load — the app's brand mark, an icon.
size"default" | "sm""default"sm is 32px (a list row), default is 48px (a card).
srcstring—The image URL. Empty, missing or failing to load shows fallback instead.

Data attributes and CSS variables on Thumbnail

AttributeValues
data-fallback""
data-sizemirrors a prop or state value
data-slot"thumbnail" | "thumbnail-fallback"

Accessibility

  • Pass alt="" when the record's name sits right beside the image — a list row, a card title — so it is not read twice. Give it real alt text when it stands alone.
  • The fallback takes the same name: with an alt, it is an img named by it; with alt="" it is hidden from assistive technology.
ContractStates tested
Behaviourimage, fallback, error
Accessibilitylabeled, browser-accessibility-test
Visualdefault, hover

Do / Don't

Do
Pass the app's brand mark as the fallback, so a record without an image still reads as one of yours.
Don't
Use Thumbnail for a person — that is Avatar, with initials as its fallback.

On this page