Skip to content
UI Kit
Accent color

Image galleries with lightbox

Pictures in masonry, filters, carousels and a lightbox, plus a before and after slider.

7 variants
Switch category

Masonry, filter or lightbox

A gallery lets the work speak, for photographers, venues, craftspeople and shops. The seven layouts here take your own img or picture elements, so loading, sizes and alt text stay in your hands, and fit each one into its frame without distortion.

Masonry suits photos of mixed formats. Grid with filter helps when there are categories such as kitchens, bathrooms and gardens. Carousel and Horizontal scroll show a series in little height. Lightbox opens each picture large with arrow keys and Escape. Featured with thumbnails fits a product or a property, Before and after compares two states with a slider that also works with the keyboard.

Pick fewer, better pictures, twelve strong ones say more than sixty. Use the same light and crop across a series. Export images in the size they are shown, aiw media optimize writes AVIF and WebP in four widths for you.

Details

What Gallery brings along, read from the registry and the source.

Variants
7
Version
1.0.0 · since 1.0.0
File
components/ui/gallery.tsx
Brings along
utilskiticonsectionreveal
npm packages
None
Languages
English and German, 15 texts of its own

Props

The GalleryProps interface from components/ui/gallery.tsx, with the comments from the code.

  • variantoptional
    GalleryVariant

    masonryfiltercarousellightboxbefore-afterfeaturedhorizontal-scroll

  • eyebrowoptional
    React.ReactNode
  • titleoptional
    React.ReactNode
  • descriptionoptional
    React.ReactNode
  • itemsoptional
    GalleryItem[]
  • compareoptional
    GalleryCompare

    For before-after

Built-in texts

Gallery writes these texts itself. The language follows the KitProvider, the labels prop replaces single ones.

Show all 15 texts
allEnglish AllGerman Alle
imagesEnglish {n} imagesGerman {n} Bilder
imageEnglish {n} imageGerman {n} Bild
previousEnglish Previous imageGerman Vorheriges Bild
nextEnglish Next imageGerman Nächstes Bild
closeEnglish CloseGerman Schließen
openEnglish Open {title}German {title} öffnen
showEnglish Show {title}German {title} zeigen
beforeEnglish BeforeGerman Vorher
afterEnglish AfterGerman Nachher
compareEnglish Drag to compare before and afterGerman Ziehen, um vorher und nachher zu vergleichen
compareValueEnglish {n} percent beforeGerman {n} Prozent vorher
filterEnglish Filter imagesGerman Bilder filtern
galleryEnglish GalleryGerman Galerie
ofEnglish ofGerman von

Accessibility

Read from the source of the component.

  • Gallery handles the keys Arrow left, Arrow right, Home, End and Space itself.
  • Built on the native dialog element. The browser keeps focus inside and closes it with Escape.
  • Sets aria-current, aria-haspopup, aria-label, aria-live, aria-pressed, aria-roledescription and aria-valuetext, so screen readers announce purpose and state.
  • Uses the roles group and region.
  • Announces changes through a live region without moving focus.
  • Adds text for screen readers where icons and graphics stand alone.
  • Shows a visible focus ring when used with the keyboard.
  • The server renders the starting state in full, JavaScript only adds the interaction.

Motion

  • Rises in briefly the first time it comes into view (kit-rise, useInView).
  • Brings animations of its own, calmly timed and without wobble.
  • With reduced motion (prefers-reduced-motion) it stays still. 11 places in the code switch motion off then.

Frequent questions

How do I install Gallery?

With aiw add @ai-website/gallery. The command puts components/ui/gallery.tsx into your project, the code is yours from then on. It brings along icon, section and reveal. It needs no further npm packages.

Which variants does Gallery have?

7 variants, Masonry, Grid with filter, Carousel, Lightbox, Before and after, Featured with thumbnails and Horizontal scroll. You pick one with the variant prop, for example variant="filter".

Can I translate the texts of Gallery?

Yes. Gallery carries 15 texts of its own in English and German, such as “All”, “Previous image” and “Next image”. The language follows the KitProvider, single texts change through the labels prop.

Can an AI assistant build with Gallery?

Yes. Through the MCP server of the aiw CLI, Claude, Cursor, GitHub Copilot, Windsurf, Codex and Gemini find Gallery with aiw_components and install it with aiw_add @ai-website/gallery. Name the variant in your prompt, for example variant="masonry", and the assistant writes your content straight into the props.

Can I adjust Gallery without code?

Yes, in the Studio. All 7 variants are editable there, texts, lists and switches. The Studio writes the matching Gallery code to copy.

Often searched

Jump to

Copied to the clipboard