AhaSlides Design
v0.52.0React · Vue · Lit

Patterns · Settings

Image action button

The compact per-option image control — an image icon button with empty / loading / thumbnail states and a Change/Edit/Delete menu; it emits intents, the host owns the modals.

Examples

State
Per-option image control — empty · loading · filled (hover the thumbnail for the menu)

API

PropTypeDefaultNotes
stateempty | loading | filledemptyThe control's state — drives which affordance shows
srcstringThe thumbnail image URL when filled
labelstringAdd imageThe empty-state tooltip / aria-label
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-action-button';   // registers <aha-image-action-button>

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

When to use

When to use
  • Image action button — a per-OPTION image cell in an option row
  • Image dropzone — a standalone MAIN image field where the image IS the field (SETTINGS-44)
Per-option image support is all-or-nothing: present with its FULL state set, or the control is omitted entirely — never a disabled/greyed stub when unsupported (SETTINGS-22). It is a compact icon button, not a text "Image" button (SETTINGS-32). It emits intents; the host owns the upload/crop modals — never a self-built uploader.
Surfaces
editor settings

Spec

Trigger 36×36 icon button, radius 8, 1px #E3E3E3 border · Empty system-image-square glyph + "Add image" tooltip; click emits `add` · Loading spinner at the same 36×36 size — no layout jump; role=status, aria-label "Loading", aria-busy · Filled thumbnail + hover pencil overlay; click opens Change/Edit/Delete · Menu Change / Edit / Delete (Delete in #F5222D); each emits an intent · Intents add · change · edit · delete — host owns the modals, this owns none · Disabled #F1F1F1 fill, #EBEBEB border, not-allowed