Image
For local images, Prose UI calculates image dimensions at build time and passes them to the rendered HTML, preventing layout shift. In Next.js, images are also converted to use the Next.js Image component for additional optimizations.
Use simple Markdown syntax if you don't need to resize, align, or add a caption on it.

Images are retrieved from the public folder of your project by default, but this can be configured by passing the imageDir option when initializing the Remark plugins.
Images with external URLs
External images are converted into simple img tags because the dimensions of the image are not known in advance.

Image dimensions
To set image dimensions, use the width and height properties on the Image component. The values for width and height are in pixels.
If you set only the width, Prose UI will calculate the height automatically to maintain the image's proportions. The same applies if you set only the height.
The example below sets the width of the image to 400 pixels. The height will be automatically calculated to preserve the image's aspect ratio.
Alignment and caption
Use the Frame component to control alignment and add captions to images. Below are examples of different alignments:



Zoom on click
Standalone images zoom on click by default. Inline images skip zoom so text flows naturally. Toggle either behavior with the zoom prop on Image.
Zoom me: inside a sentence.
Inline images
By default, images added using Markdown syntax or the Image component are inline and will appear inside a paragraph tag unless wrapped in a Frame.
Here's an example of a resized inline image within a paragraph.
Here's an example of a Markdown image within a paragraph.