SmartImage
An image component with more features and better defaults that
next/image
.This should be used instead of
next/image
and <img>
in all cases.Notably, if you configured a
basePath
other than the root in next.config.js
, this component will automatically prepend it to the src
prop.Props
The same as
next/image
component, as well as:disableStrictCLS
: Disables the Next.js CLS error. Particularly, this means you can not passwidth
andheight
even if the import is not static, and the component will behave like a normal<img>
would. Note that this is frowned upon as it causes cumulative layout shift.
Examples
Image without given width

Note: this text will shift its position as soon as the image loads.