feat(mdx): add ImageCarousel component for post galleries
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.
This commit is contained in:
1 parent
48c8c8de08
commit
2e40c0ae4d
2 files changed
+190
No files matched your search
@@ -3,11 +3,13 @@ import Pre from 'pliny/ui/Pre'
|
||||
import BlogNewsletterForm from 'pliny/ui/BlogNewsletterForm'
|
||||
import type { MDXComponents } from 'mdx/types'
|
||||
import Image from './Image'
|
||||
import ImageCarousel from './ImageCarousel'
|
||||
import CustomLink from './Link'
|
||||
import TableWrapper from './TableWrapper'
|
||||
|
||||
export const components: MDXComponents = {
|
||||
Image,
|
||||
ImageCarousel,
|
||||
TOCInline,
|
||||
a: CustomLink,
|
||||
pre: Pre,
|
||||
|
||||
Reference in new issue
Block a user