AhaSlides Design
v0.52.0React · Vue · Lit

Patterns · Settings

Image dropzone

The full-width settings image field where the image IS the field — a dashed upload card with empty / loading / filled states and a Change/Edit/Delete overlay; it emits intents, the host owns the modals (SETTINGS-44).

Examples

State
Empty — full-width dashed upload card (the image IS the field)
Loading (same height — no jump) · filled contain · filled cover (hover for the Change/Edit/Delete overlay)

API

PropTypeDefaultNotes
stateempty | loading | filledemptyThe field's state — drives which affordance shows, at a constant box height
srcstringThe image URL when filled
fitcontain | covercontainHow the filled image sits in the box — contain (whole image, letterboxed) or cover (fill, cropped)
labelstringAdd imageThe empty-state prompt text
disabledbooleanfalseNon-interactive; grey fill
add / change / edit / deleteCustomEventComposed intents — the host runs the corresponding modal/flow

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-dropzone';   // registers <aha-image-dropzone>

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

When to use

When to use
  • Image dropzone — a standalone MAIN image field — a background/hero image, an interactive-image base, a picture reveal (SETTINGS-44)
  • Image action button — a per-OPTION image cell in an option row
The MAIN image field is this dropzone — NOT a hand-rolled "Add image"/"Replace image" button plus a separate "Remove image" danger button (SETTINGS-44). The loading state matches the empty card's height so the panel doesn't jump. It emits intents; the host owns the upload/crop modals.
Surfaces
editor settings

Spec

Zone full-width, min-height 132, radius 8 · Empty 1px dashed #E3E3E3 card, centred system-image-square + label; click emits `add` · Loading spinner at the SAME 132 min-height — the panel does not jump · Filled image fitted (fit=contain default | cover) + hover Change/Edit/Delete overlay; solid border · Intents add · change · edit · delete — host owns the modals, this owns none · Hover #D3B4FF border + #6A1EBB label/icon · Disabled #F1F1F1 fill, #EBEBEB border, not-allowed