rsnext/examples/image-component/pages/background.tsx
Steven e2f16f96c2
Update next/image docs and examples (#41434)
This PR updates the docs for the following code change:

- #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
2022-10-17 10:41:35 -04:00

30 lines
664 B
TypeScript

import Image from 'next/image'
import ViewSource from '../components/view-source'
import styles from '../styles.module.css'
import mountains from '../public/mountains.jpg'
const BackgroundPage = () => (
<div>
<ViewSource pathname="pages/background.tsx" />
<div className={styles.bgWrap}>
<Image
alt="Mountains"
src={mountains}
placeholder="blur"
quality={100}
fill
sizes="100vw"
style={{
objectFit: 'cover',
}}
/>
</div>
<p className={styles.bgText}>
Image Component
<br />
as a Background
</p>
</div>
)
export default BackgroundPage