We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eaac9e9 commit cf54d02Copy full SHA for cf54d02
packages/website/docs/nextjs.md
@@ -35,9 +35,29 @@ export default UnoptimizedLink;
35
```
36
37
```tsx title=".ladle/UnoptimizedImage.tsx"
38
-const UnoptimizedImage = (props: any) => {
39
- return <img {...props} />;
+import React from 'react';
+
40
+interface UnoptimizedImageProps
41
+ extends React.ImgHTMLAttributes<HTMLImageElement> {
42
+ fill?: boolean;
43
+}
44
45
+const UnoptimizedImage: React.FC<UnoptimizedImageProps> = ({
46
+ fill,
47
+ ...props
48
+}) => {
49
+ const style: React.CSSProperties = fill
50
+ ? {
51
+ position: 'absolute',
52
+ inset: '0',
53
+ width: '100%',
54
+ height: '100%',
55
+ }
56
+ : {};
57
58
+ return <img {...props} style={style} />;
59
};
60
61
export default UnoptimizedImage;
62
63
0 commit comments