Image Hotspots
An image with pins that each open a small popover, for annotating a screenshot or photo.
<arc-image-hotspots>Overview
Image Hotspots puts pins over a picture, and each pin opens a popover. Slot the image and the <arc-hotspot> children together. Each pin positions itself from its x and y attributes, given as percentages of the image, so source order doesn't matter and nothing is measured.
Each pin is a <button> with a label and aria-expanded. Activating it opens its popover above the pin, and the popover flips and shifts to stay in the viewport. The parent keeps one popover open at a time. An open popover closes on Escape, on a click anywhere else, or on a second click of its pin.
Every close goes through close(), including the parent's. It fires a cancelable arc-close first, and a listener that calls preventDefault() keeps the popover open. Closing the other popovers is itself a close() call, so a hotspot holding an unsaved note can refuse to close when someone clicks another pin, as well as on Escape. Call close() yourself to dismiss a popover from script. Its first argument, restoreFocus, defaults to true and returns focus to the pin. Pass false when you're closing one popover to open another, so focus lands on the new pin.
Pins server-render at their coordinates because positioning is plain CSS from attributes. Only the popovers need JavaScript. Every hotspot fires arc-open and arc-close, which bubble to the parent with detail.value set to the hotspot's label, or its index if it has no label.
Guidelines
Do
- Give every hotspot a label. It names the pin for screen readers, heads the popover, and identifies the hotspot in events
- Keep popover content to a sentence or two, and link out for anything longer
- Put each pin on the feature it describes, not beside it
- Use a handful of pins per image
- Give the component a width that keeps the pins far enough apart to tap
Don't
- Don't put pins so close that their popovers cover each other's pins
- Don't put critical information only in a popover. People miss pins
- Don't use it for step-by-step onboarding. Pins have no order, and nothing here sequences them (`arc-guided-tour` was cut in v4, and `arc-tour` is the planned rebuild)
Features
- Pins pulse, and their glow rises on hover and focus
Preview
Usage
Image Hotspots is in the marketing group, so the default @arclux/arc-ui entry point doesn't include it. Import it from@arclux/arc-ui/marketing or from its own subpath,@arclux/arc-ui/image-hotspots.
This component needs JavaScript. Use the Web Component or a framework wrapper.
<arc-image-hotspots>
<img src="/screenshots/dashboard.png" alt="Analytics dashboard" />
<arc-hotspot x="18" y="30" label="Navigation">
Jump between reports, alerts, and settings from one rail.
</arc-hotspot>
<arc-hotspot x="60" y="45" label="Live charts">
Metrics stream in real time — no refresh required.
</arc-hotspot>
<arc-hotspot x="85" y="78" label="Exports">
Any panel exports to CSV, PNG, or a shared link.
</arc-hotspot>
</arc-image-hotspots>import { ImageHotspots, Hotspot } from '@arclux/arc-ui-react';
export default function FeatureTour() {
return (
<ImageHotspots onArcOpen={(e) => console.log('opened', e.detail.value)}>
<img src="/screenshots/dashboard.png" alt="Analytics dashboard" />
<Hotspot x={18} y={30} label="Navigation">
Jump between reports, alerts, and settings from one rail.
</Hotspot>
<Hotspot x={60} y={45} label="Live charts">
Metrics stream in real time — no refresh required.
</Hotspot>
<Hotspot x={85} y={78} label="Exports">
Any panel exports to CSV, PNG, or a shared link.
</Hotspot>
</ImageHotspots>
);
}<script setup>
import { ImageHotspots, Hotspot } from '@arclux/arc-ui-vue';
</script>
<template>
<ImageHotspots>
<img src="/screenshots/dashboard.png" alt="Analytics dashboard" />
<Hotspot :x="18" :y="30" label="Navigation">
Jump between reports, alerts, and settings from one rail.
</Hotspot>
<Hotspot :x="60" :y="45" label="Live charts">
Metrics stream in real time — no refresh required.
</Hotspot>
<Hotspot :x="85" :y="78" label="Exports">
Any panel exports to CSV, PNG, or a shared link.
</Hotspot>
</ImageHotspots>
</template><script>
import { ImageHotspots, Hotspot } from '@arclux/arc-ui-svelte';
</script>
<ImageHotspots>
<img src="/screenshots/dashboard.png" alt="Analytics dashboard" />
<Hotspot x={18} y={30} label="Navigation">
Jump between reports, alerts, and settings from one rail.
</Hotspot>
<Hotspot x={60} y={45} label="Live charts">
Metrics stream in real time — no refresh required.
</Hotspot>
<Hotspot x={85} y={78} label="Exports">
Any panel exports to CSV, PNG, or a shared link.
</Hotspot>
</ImageHotspots>import { Component } from '@angular/core';
import { ImageHotspots, Hotspot } from '@arclux/arc-ui-angular';
@Component({
imports: [ImageHotspots, Hotspot],
template: `
<arc-image-hotspots>
<img src="/screenshots/dashboard.png" alt="Analytics dashboard" />
<arc-hotspot x="18" y="30" label="Navigation">
Jump between reports, alerts, and settings from one rail.
</arc-hotspot>
<arc-hotspot x="60" y="45" label="Live charts">
Metrics stream in real time — no refresh required.
</arc-hotspot>
<arc-hotspot x="85" y="78" label="Exports">
Any panel exports to CSV, PNG, or a shared link.
</arc-hotspot>
</arc-image-hotspots>
`,
})
export class FeatureTourComponent {}import { ImageHotspots, Hotspot } from '@arclux/arc-ui-solid';
export default function FeatureTour() {
return (
<ImageHotspots>
<img src="/screenshots/dashboard.png" alt="Analytics dashboard" />
<Hotspot x={18} y={30} label="Navigation">
Jump between reports, alerts, and settings from one rail.
</Hotspot>
<Hotspot x={60} y={45} label="Live charts">
Metrics stream in real time — no refresh required.
</Hotspot>
<Hotspot x={85} y={78} label="Exports">
Any panel exports to CSV, PNG, or a shared link.
</Hotspot>
</ImageHotspots>
);
}import { ImageHotspots, Hotspot } from '@arclux/arc-ui-preact';
export default function FeatureTour() {
return (
<ImageHotspots>
<img src="/screenshots/dashboard.png" alt="Analytics dashboard" />
<Hotspot x={18} y={30} label="Navigation">
Jump between reports, alerts, and settings from one rail.
</Hotspot>
<Hotspot x={60} y={45} label="Live charts">
Metrics stream in real time — no refresh required.
</Hotspot>
<Hotspot x={85} y={78} label="Exports">
Any panel exports to CSV, PNG, or a shared link.
</Hotspot>
</ImageHotspots>
);
}Hotspot
<arc-hotspot>One pin inside Image Hotspots. `x` and `y` position it as percentages of the image, `label` names it, and its children become the popover body.
labelstring''- Accessible name for the pin button, repeated as the heading of the popover. Always set it: without a label the pin announces nothing useful to a screen reader.
xnumber50- Horizontal position of the pin as a percentage of the image width, from 0 (left edge) to 100 (right edge). Values outside the range are clamped; a non-numeric value falls back to 50.
ynumber50- Vertical position of the pin as a percentage of the image height, from 0 (top edge) to 100 (bottom edge). Values outside the range are clamped; a non-numeric value falls back to 50.
openbooleanfalse- Whether the pin's popover is currently visible. Reflected as an attribute. Opens on click; closes on Escape, outside click, or a second click on the pin.
Methods
close(restoreFocus?)restoreFocus?: boolean- Close the popover, firing the cancelable
arc-closefirst, so a listener that callspreventDefault()keeps it open, whoever asked for the close. arc-image-hotspots calls this to enforce one-open-at-a-time, which is why a consumer's veto is honoured there too and not only on a manual close.
Events
arc-opendetail:{value: string | number}- Fired when the popover opens. detail.value carries the label, or the pin's index within its parent when no label is set.
arc-closedetail:{value: string | number}- Fired before the popover closes and cancelable: preventDefault() vetoes the close. detail.value matches arc-open.
See also
- PopoverA floating panel that opens when its trigger is clicked, placed on one of four sides and closed by an outside click or Escape.
- TooltipA short text hint shown next to a control on hover or keyboard focus.
- ImageImage with a shimmer skeleton while it loads, a fade-in, an error fallback and aspect ratio presets.
- Hotspot