On this page
@addTagHelper *, Webority.Ui.RazorGallery
Use thumbnails that open each image full screen when a reader compares photos or reads captions.
Single picture
Show one photo at the full width of its container when a page needs a single image with its caption.
Every option
Every value of every prop, one cell each.
items
download
label
layout
openIndex
onChange
onClose
className
Guidance
What to do, and what to avoid.
Use it when
- A gallery of photos.
- Image attachments on a record that should open without leaving it.
Reach for something else when
- A PDF, video or audio file. → AppFileViewer
- One image that is part of the page's content. → a plain img
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
12 props. The 4 most used come first.
Used on most screens 4 props
| Prop | Type | Default | Description |
|---|---|---|---|
| downloaddefault false | bool | false | Shows a download action. A browser ignores name for an image on another origin. |
| labeldefault Image viewer | string | Image viewer | The full-screen dialog's name for screen readers. |
| layoutdefault gallery | string | gallery | gallery shows thumbnails; single shows each image at the container's full width, at its own shape. |
| open-indexdefault - | int | - | Opens the viewer on this image, counted from 0. |
Less common 8 props
| Prop | Type | Default | Description |
|---|---|---|---|
| <app-lightbox-item> srcdefault - | string | - | The full image. |
| <app-lightbox-item> thumbdefault src | string | src | The thumbnail. |
| <app-lightbox-item> altdefault caption | string | caption | The image's text alternative. |
| <app-lightbox-item> captiondefault - | string | - | The line under the image in the full-screen view. |
| <app-lightbox-item> namedefault last part of src | string | last part of src | The file name a download saves under. |
| wui-lightbox:opendefault - | event | - | Fires when the full-screen view opens, with detail.index for the image shown. |
| wui-lightbox:changedefault - | event | - | Fires when the image shown changes, with detail.index; React's onChange is this event. |
| wui-lightbox:closedefault - | event | - | Fires when the full-screen view closes, with detail.index; React's onClose is this event. |
Screen reader
3 notes- Left and Right change image, wrapping at the ends; plus and minus zoom, 0 resets the zoom, and Escape closes and puts focus back on the thumbnail of the image last shown.
- On a touch screen, swipe sideways to change image, pinch or double tap to zoom, drag to pan, and tap beside the image to close.
- The full-screen dialog is named by `label`, and each thumbnail is a link to its image that still opens normally with Ctrl, Cmd or Shift.