Or hoist the array with export const shots = [...] and pass images={shots}.
Props:images (required), aspect (default aspect-[16/9]), fit (cover|contain), showArrows, showDots, showCounter.
Notes
No new dependencies — scroll-snap based, so touch swipe and trackpad scroll work natively; arrows/dots call scrollTo.
Reuses the existing Image wrapper, so s3.jonb.io and /static paths work with no next.config.js change.
not-prose on the figure so the typography plugin does not fight the layout.
Arrow-key navigation when focused; aria-roledescription="carousel" and labelled buttons. Two eslint-disable lines for jsx-a11y because the WAI-ARIA carousel pattern requires a focusable region with a key handler.
Arrows, dots and counter auto-hide for a single image.
Verified with a local static export: inline array, export const array, remote s3 path, local /static path, and single-image case all render.
Adds an `ImageCarousel` MDX component so posts can embed a swipeable gallery.
**Usage**
```mdx
<ImageCarousel
images={[
{ src: "https://s3.jonb.io/cdn/projects/qbitmaid.jpg", alt: "qbit-maid", caption: "qbit-maid dashboard" },
{ src: "/static/images/qbitmaid.jpg", alt: "local", caption: "local static path" },
]}
/>
```
Or hoist the array with `export const shots = [...]` and pass `images={shots}`.
**Props:** `images` (required), `aspect` (default `aspect-[16/9]`), `fit` (`cover`|`contain`), `showArrows`, `showDots`, `showCounter`.
**Notes**
- No new dependencies — scroll-snap based, so touch swipe and trackpad scroll work natively; arrows/dots call `scrollTo`.
- Reuses the existing `Image` wrapper, so `s3.jonb.io` and `/static` paths work with no `next.config.js` change.
- `not-prose` on the figure so the typography plugin does not fight the layout.
- Arrow-key navigation when focused; `aria-roledescription="carousel"` and labelled buttons. Two `eslint-disable` lines for `jsx-a11y` because the WAI-ARIA carousel pattern requires a focusable region with a key handler.
- Arrows, dots and counter auto-hide for a single image.
Verified with a local static export: inline array, `export const` array, remote s3 path, local `/static` path, and single-image case all render.
Scroll-snap carousel usable directly in .mdx posts:
<ImageCarousel images={[{ src, alt, caption }]} />
Props: images (required), aspect (default aspect-[16/9]), fit
(cover|contain), showArrows, showDots, showCounter. Native swipe and
trackpad scroll, arrow-key support when focused, per-slide captions,
and arrows/dots/counter auto-hide for a single image.
No new dependencies; reuses the existing Image wrapper so s3.jonb.io
and /static paths work as-is.
trexBot
merged commit e05e8a3fc3 into main2026-11-22 01:18:36 -06:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Adds an
ImageCarouselMDX component so posts can embed a swipeable gallery.Usage
Or hoist the array with
export const shots = [...]and passimages={shots}.Props:
images(required),aspect(defaultaspect-[16/9]),fit(cover|contain),showArrows,showDots,showCounter.Notes
scrollTo.Imagewrapper, sos3.jonb.ioand/staticpaths work with nonext.config.jschange.not-proseon the figure so the typography plugin does not fight the layout.aria-roledescription="carousel"and labelled buttons. Twoeslint-disablelines forjsx-a11ybecause the WAI-ARIA carousel pattern requires a focusable region with a key handler.Verified with a local static export: inline array,
export constarray, remote s3 path, local/staticpath, and single-image case all render.Scroll-snap carousel usable directly in .mdx posts: <ImageCarousel images={[{ src, alt, caption }]} /> Props: images (required), aspect (default aspect-[16/9]), fit (cover|contain), showArrows, showDots, showCounter. Native swipe and trackpad scroll, arrow-key support when focused, per-slide captions, and arrows/dots/counter auto-hide for a single image. No new dependencies; reuses the existing Image wrapper so s3.jonb.io and /static paths work as-is.