---
title: "Accessibility"
description: "Dialog semantics, keyboard, focus and labels."
canonical_url: "https://kukson777.github.io/nuxt-image-viewer/docs/guide/accessibility"
---
# Accessibility

> Dialog semantics, keyboard, focus and labels.

## The dialog

- The viewer is a `role="dialog"` with `aria-modal="true"`, named by the [`labels.dialog`](https://kukson777.github.io/nuxt-image-viewer/docs/customization/options#labels) option.
- Focus moves into the dialog when it opens. <kbd value="Tab">



</kbd>

 and <kbd value="Shift">



</kbd>

 + <kbd value="Tab">



</kbd>

 go round its buttons and never leave it.
- On close, focus returns to the page image the viewer closed into — or, when opened from code without an element, to whatever had focus before `open()`.
- Slides other than the current one are `aria-hidden`; the counter is a polite live region, so screen readers announce `3 / 7` as you scroll.
- Every button has an accessible name and visible focus (`--image-viewer-focus-color`).

## Page images

- `<ZoomImage>` is focusable (`tabindex="0"`) and opens with Enter or Space.
- `alt` falls back to the caption. Pass `alt` explicitly when the caption isn't a good description.
- Page images get `cursor: zoom-in` and a focus ring — restyle them with `[data-image-viewer]`.

## Custom labels

All names are options, globally or per call. Override only the ones you want to change — the rest keep their English defaults:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  imageViewer: {
    labels: {
      dialog: 'Photo gallery',
      close: 'Close gallery',
      prev: 'Previous photo',
      next: 'Next photo',
    },
  },
})
```

For other languages, pass translated labels per call — with `@nuxtjs/i18n`: `open(items, 0, { labels: { close: t('viewer.close') } })`. See the [i18n recipe](https://kukson777.github.io/nuxt-image-viewer/docs/customization/recipes#labels-from-nuxtjsi18n).

## Motion

`prefers-reduced-motion: reduce` turns the animations off — see [Gestures](https://kukson777.github.io/nuxt-image-viewer/docs/guide/gestures#reduced-motion).


## Sitemap

See the full [sitemap](https://kukson777.github.io/nuxt-image-viewer/sitemap.md) for all pages.
