AhaSlides Design
v0.52.0React · Vue · Lit

Components · Data Display

Image

A framed image with rounded corners, a hover preview mask, a loading placeholder and a broken-src fallback.

Examples

Preview
Radius
Source
Image · rounded frame · hover to preview · click to open
Preview

API

PropTypeDefaultNotes
srcstringImage source URL (empty/broken → the fallback state)
altstringAlternative text for the image
widthnumberFrame width in px
heightnumberFrame height in px
preview'true' | 'false'trueClick-to-zoom modal. `false` → a plain framed picture (no mask, no click, no dialog)
radius'xs'|'sm'|'default'|'lg'|'xl'|'pill'defaultFrame corner from the DS radius scale
placeholderbooleanoffShow a shimmer loading skeleton until the image loads
fallbackstringImage unavailableLabel shown in the broken-src error state (its presence never forces the state — a broken/empty src does)
(default slot)slotPreviewThe label shown in the hover mask

Install

# .npmrc — once: point the @ahaslides-product scope at GitHub Packages
@ahaslides-product:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}   # a GitHub token with read:packages

npm i @ahaslides-product/design
import '@ahaslides-product/design/tokens.css';   // once, at the app root
import '@ahaslides-product/design/aha-image';   // registers <aha-image>

Agent feed for this component (absolute, fetchable anywhere): image.agent.json · image.md · image.llms.txt

When to use

When to use
  • Image — a framed picture that invites a click to preview (a deck cover, an upload)
  • Avatar — a small round identity image
  • Card — a picture is one part of a larger grouped surface
Always set alt for accessibility. Keep the mask label short — 'Preview', 'View' — it is an invitation, not a caption.
Surfaces
editor dashboard audience

Spec

Frame radius 8px (radius attr xs 4·sm 6·default 8·lg 12·xl 16·pill) · bg #F7F7F7 · overflow hidden · role=button, keyboard-focusable · Image object-fit cover · scale 1.06 on hover, motion-slow ease-out · Mask overlay rgba(26,26,46,.7) · #FFFFFF 13/SemiBold · fade motion-mid · Preview click/Enter opens a modal dialog (role=dialog, aria-modal); Esc / close button / backdrop dismiss; focus moves in and is restored on close. preview="false" → plain picture, no mask/click/dialog · Placeholder shimmer skeleton (icon-muted on bg-secondary) shown while loading; fades on the image load, persistent node · Fallback broken/empty src → system-image-square glyph + label, text-tertiary on bg-secondary, role=img · Sizing width/height attributes drive the frame