Skip to content

Commit 57b369b

Browse files
authored
add image tag (#27)
1 parent ab7c573 commit 57b369b

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/tags.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const Head = require('next/head');
2+
const Image = require('next/image');
23
const Link = require('next/link');
34
const Script = require('next/script');
45

@@ -16,6 +17,53 @@ exports.head = {
1617
attributes: {},
1718
};
1819

20+
exports.image = {
21+
render: Image,
22+
description: 'Renders a Next.js image tag',
23+
// https://nextjs.org/docs/app/api-reference/components/image
24+
attributes: {
25+
src: {
26+
type: String,
27+
required: true,
28+
},
29+
alt: {
30+
type: String,
31+
required: true,
32+
},
33+
width: {
34+
type: Number,
35+
required: true,
36+
},
37+
height: {
38+
type: Number,
39+
required: true,
40+
},
41+
fill: {
42+
type: Boolean,
43+
},
44+
sizes: {
45+
type: String,
46+
},
47+
quality: {
48+
type: Number,
49+
},
50+
priority: {
51+
type: Boolean,
52+
},
53+
placeholder: {
54+
type: String,
55+
matches: ['blur', 'empty'],
56+
},
57+
loading: {
58+
type: String,
59+
matches: ['lazy', 'eager'],
60+
},
61+
blurDataURL: {
62+
type: String,
63+
},
64+
},
65+
};
66+
1967
exports.link = {
2068
render: Link,
2169
description: 'Displays a Next.js link',

0 commit comments

Comments
 (0)