# Shot

A picture whole in its frame with what happened drawn on it, a thumb zoomed onto one point, or a square it fills.

Live variants: https://design.arcadia.is/components/shot

```tsx
import { Shot } from "@arcadia/ui";
```

One page, three marks: a box on the filled field, an arrow to the empty one, a ring where the agent clicked.

```tsx
<ShotShot
  src={SIGNUP}
  alt="The sign-up page: Email filled in, Password left empty, Create account clicked"
  width={640}
  height={400}
  marks={[
    { kind: "box", x: 194, y: 144, w: 252, h: 48 },
    { kind: "arrow", x: 560, y: 160, to: { x: 452, y: 236 } },
    { kind: "ring", x: 320, y: 306 },
  ]}
/>
```

## Accessibility

The picture is an `img` with your `alt`. Say what the page shows and what happened on it, or pass an empty `alt` when the words beside it already say so, as in a list of steps. The marks and the focus dot are hidden from assistive technology, so what they point at belongs in the `alt` or in the text nearby.

With `onOpen` the picture is a `button` named by its `alt`, so a picture that opens needs an `alt` that is not empty. It takes the focus ring like any control, and the pointer shows it zooms in.

A moving picture is named by its `alt` whether it plays or stands still, and its badge is a `button` named for what a press does, Stop GIF or Play GIF, so focus stays on it as it swaps. It stands beside the picture's own button, never inside it; the picture's ring then stands inside its frame.

- Enter + Space: Opens a picture that has onOpen; on a moving picture's badge, stops or starts it

## API reference

### Shot

- `src` (`string`, required)
- `alt` (`string`, required)
- `width` (`number`, required): The span it shows, in its marks' units.
- `height` (`number`, required)
- `marks` (`readonly ShotMark[]`, default `[]`)
- `size` (`"frame" | "thumb"`, default `"frame"`): `frame`: the picture whole at its own shape, up to `--shot-max-h`; one very tall or very wide stands whole inside a box of at most 2:1 either way, never as a thin strip. `thumb`: 32 by 20, zoomed onto `focus`.
- `focus` (`{ x: number; y: number }`): A thumb's dotted centre.
- `zoom` (`number`): How far a thumb is zoomed in: 2 by default.
- `animated` (`boolean`, default `false`): The picture moves (a GIF). Its `GIF` badge is a button that stops and starts it, in any setting (M45); under reduced motion it starts stopped, on its first frame. A thumb has no room for the badge, so it holds its first frame. The badge's press is never `onOpen`'s.
- `onOpen` (`() => void`): Makes it a button.
- `label` (`string`)
- `rootStyle` (`RootStyle<ShotKnobs>`)
