forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
next/image
docs and examples (vercel#41434)
This PR updates the docs for the following code change: - vercel#41399 There are a few updates here: - [x] Update docs - [x] Update links to docs inside component - [x] Update examples - [x] Fix corner cases in codemod
- Loading branch information
Showing
44 changed files
with
1,070 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
341 changes: 170 additions & 171 deletions
341
docs/api-reference/next/future/image.md → docs/api-reference/next/legacy/image.md
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
/** @type {import('next').NextConfig} */ | ||
module.exports = { | ||
images: { | ||
domains: ['assets.vercel.com'], | ||
formats: ['image/avif', 'image/webp'], | ||
remotePatterns: [ | ||
{ | ||
protocol: 'https', | ||
hostname: 'assets.vercel.com', | ||
port: '', | ||
pathname: '/image/upload/**', | ||
}, | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import Image from 'next/image' | ||
import ViewSource from '../components/view-source' | ||
import mountains from '../public/mountains.jpg' | ||
|
||
const Fill = () => ( | ||
<div> | ||
<ViewSource pathname="pages/layout-fill.tsx" /> | ||
<h1>Image Component With Layout Fill</h1> | ||
<div style={{ position: 'relative', width: '300px', height: '500px' }}> | ||
<Image | ||
alt="Mountains" | ||
src={mountains} | ||
fill | ||
sizes="100vw" | ||
style={{ | ||
objectFit: 'cover', | ||
}} | ||
/> | ||
</div> | ||
<div style={{ position: 'relative', width: '300px', height: '500px' }}> | ||
<Image | ||
alt="Mountains" | ||
src={mountains} | ||
fill | ||
sizes="100vw" | ||
style={{ | ||
objectFit: 'contain', | ||
}} | ||
/> | ||
</div> | ||
<div style={{ position: 'relative', width: '300px', height: '500px' }}> | ||
<Image | ||
alt="Mountains" | ||
src={mountains} | ||
quality={100} | ||
fill | ||
sizes="100vw" | ||
style={{ | ||
objectFit: 'none', | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
) | ||
|
||
export default Fill |
Oops, something went wrong.