diff --git a/examples/image-legacy-component/app/background/page.tsx b/examples/image-legacy-component/app/background/page.tsx new file mode 100644 index 0000000000000..f0a08df543dfa --- /dev/null +++ b/examples/image-legacy-component/app/background/page.tsx @@ -0,0 +1,25 @@ +import Image from "next/legacy/image"; +import ViewSource from "@/components/view-source"; +import styles from "@/styles/styles.module.css"; + +export default function Background() { + return ( +
+ Image Component
+
+ as a Background
+
+ This page demonstrates the usage of the{" "} + + next/legacy/image + {" "} + component with live examples. +
++ This component is designed to{" "} + + automatically optimize + {" "} + images on-demand as the browser requests them. +
+
+ External images must be configured in next.config.js
{" "}
+ using the remotePatterns
property.
+
+ Select a layout below and try resizing the window or rotating your + device to see how the image reacts. +
+
+ The placeholder
property tells the image what to do while
+ loading.
+
+ You can optionally enable a blur-up placeholder while the high + resolution image loads. +
++ Try it out below (you may need to disable cache in dev tools to see + the effect if you already visited): +
+
+ The following is an example of a reference to an internal image from
+ the public
directory.
+
+ This image is intentionally large so you have to scroll down to the + next image. +
+
+ The following is an example of a reference to an external image at{" "}
+ assets.vercel.com
.
+
+ External images must be configured in next.config.js
{" "}
+ using the remotePatterns
property.
+
+ You can optionally configure a cloud provider, device sizes, and more! +
++ Checkout the{" "} + + Image Optimization documentation + {" "} + to learn more. +
+