Skip to content

Commit 66eb7aa

Browse files
author
Greg B
authored
Update imageprops.md (#279)
adds Image example
1 parent 8465d3d commit 66eb7aa

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

website/docs/api/interfaces/imageprops.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@ title: "ImageProps"
44
sidebar_label: "ImageProps"
55
---
66

7+
The Image component provides the ability to render images. It is based on
8+
[NodeGui's QPixmap](https://docs.nodegui.org/docs/api/generated/classes/qpixmap).
9+
## Example
10+
```javascript
11+
import React from "react";
12+
import { Renderer, Image, Window } from "@nodegui/react-nodegui";
13+
import { AspectRatioMode } from "@nodegui/nodegui";
14+
const App = () => {
15+
return (
16+
<Window>
17+
<Image
18+
aspectRatioMode={AspectRatioMode.KeepAspectRatio}
19+
size={{ height: 200, width: 150 }}
20+
src="https://place-hold.it/200x150"
21+
></Image>
22+
</Window>
23+
);
24+
};
25+
Renderer.render(<App />);
26+
27+
```
28+
729
## Hierarchy
830

931
[TextProps](textprops.md)

0 commit comments

Comments
 (0)