Attach the directive to an image or an accessible image button. Bind an image URL, a NeuImageViewerItem or a list with meaningful alt text and optional captions. For a list, neuIvIndex selects the zero-based image to enlarge. Plain thumbnails work without Gallery; choose Gallery when you also need a carousel component.
Click or tap either visible thumbnail to enlarge that same illustration. With the keyboard, Tab to a thumbnail and press Enter or Space. Use the previous/next controls or arrow keys to move between the two images, then Escape to close and return focus to the thumbnail.
The application supplies the image list and initial index. The directive owns zoom, navigation and visibility during the session. Its opened and closed events report visibility. Use open() and close() when a separate application action needs control.
Each thumbnail is a native button with an accessible action name and an image with meaningful alt text. Enter and Space open the corresponding image. The full-screen dialog keeps focus inside while open and restores the originating thumbnail on close. Gallery exposes public inputs when custom viewer control labels are needed.
Key
Action
Enter / Space
Open the focused viewer trigger.
โ / โ
Move to the previous or next image when available.
Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.
Name
Payload
Template binding
Description
closed
void
(closed)="onClosed($event)"
Emits when the viewer closes.
opened
void
(opened)="onOpened($event)"
Emits when the viewer opens.
Templates
ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.
This component does not expose content projection or public customization templates.
Public methods
Name
Contract
close
close(): void;
open
open(): void;
Public Types
Open a type to inspect its definition and interface fields.
NeuImageViewerItem.d.ts
import type { NeuImageViewerItem } from '@neural-ui/core/image-viewer';
// Public declaration (reference only)
interface NeuImageViewerItem {
alt: string;
caption?: string;
src: string;
}