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.
19 lines
487 B
TypeScript
19 lines
487 B
TypeScript
import TOCInline from 'pliny/ui/TOCInline'
|
|
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,
|
|
table: TableWrapper,
|
|
BlogNewsletterForm,
|
|
}
|