Each item contains src and an accessible alt; title is optional. Choose activeIndex for a controlled image or initialIndex for internal state. Thumbnails may appear below or beside the stage. objectFit selects contain or cover. previewEnabled opens the image viewer from the main image; its controls support zoom, rotation, flip, reset and download. All toolbar labels can be translated.
Accept activeIndexChange by updating activeIndex. previewChange, zoomChange, rotationChange and flipChange report observed viewer state. imageError identifies the item and index that failed to load. The item Template replaces main-image rendering; the caption Template replaces its caption. Keep a meaningful alt on a custom image.
Use arrow keys, Home and End to navigate the stage. Thumbnails expose the active state. The preview traps focus, Escape closes it and focus returns to its trigger. Supply translated control labels, descriptive image alternatives and keyboard-safe content in Templates.
Key
Action
Tab
Reach gallery controls; focus stays inside an open modal preview.
ArrowLeft / ArrowRight
Move to the previous or next gallery item.
Home
Show the first item.
End
Show the last item.
Enter
Activate the focused thumbnail or gallery button.
Space
Activate the focused thumbnail or gallery button.
Escape
Close the preview and return focus to its trigger.
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.
Open a type to inspect its definition and interface fields.
NeuGalleryCaptionContext.d.ts
import type { NeuGalleryItem } from '@neural-ui/core/gallery';
import type { NeuGalleryCaptionContext } from '@neural-ui/core/gallery';
// Public declaration (reference only)
export interface NeuGalleryCaptionContext {
$implicit: NeuGalleryItem;
index: number;
}
NeuGalleryItem.d.ts
import type { NeuImageViewerItem } from '@neural-ui/core/image-viewer';
import type { NeuGalleryItem } from '@neural-ui/core/gallery';
// Public declaration (reference only)
export type NeuGalleryItem = NeuImageViewerItem;
NeuGalleryItemContext.d.ts
import type { NeuGalleryItem } from '@neural-ui/core/gallery';
import type { NeuGalleryItemContext } from '@neural-ui/core/gallery';
// Public declaration (reference only)
export interface NeuGalleryItemContext {
$implicit: NeuGalleryItem;
active: boolean;
index: number;
}
NeuImageViewerItem.d.ts
import type { NeuImageViewerItem } from '@neural-ui/core/image-viewer';
// Public declaration (reference only)
interface NeuImageViewerItem {
alt: string;
caption?: string;
src: string;
}