Hanzo Docs

Zoomable Image

Allow zoom-in images in your documentation

banner

Install to your codebase

Easier customisation & control.

Usage

Replace img with ImageZoom in your MDX components.

mdx-components.tsx
import { ImageZoom } from '@hanzo/docs/ui/components/image-zoom';
import defaultComponents from '@hanzo/docs/ui/mdx';
import type { MDXComponents } from 'mdx/types';

export function getMDXComponents(components?: MDXComponents): MDXComponents {
  return {
    ...defaultComponents,
    img: (props) => <ImageZoom {...(props as any)} />,
    ...components,
  };
}

Now image zoom will be automatically enabled on all images.

![Test](/banner.png)

Image Optimization

On Next.js, a default sizes property will be defined for <Image /> component if not specified.

How is this guide?

Last updated on

On this page