-
Notifications
You must be signed in to change notification settings - Fork 31.2k
Expand file tree
/
Copy pathpage.tsx
More file actions
46 lines (44 loc) · 1.04 KB
/
page.tsx
File metadata and controls
46 lines (44 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import Image from "next/image";
import ViewSource from "../../components/view-source";
import mountains from "../../public/mountains.jpg";
const Fill = () => (
<div>
<ViewSource pathname="app/fill/page.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;