Skip to content

Commit

Permalink
docs(image): Add documentation for Image component - styleguide
Browse files Browse the repository at this point in the history
  • Loading branch information
codedavinci committed Dec 13, 2017
1 parent 08fd462 commit c3b29a3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/Image/Image.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### Usage criteria

* We recommend not to `resize/crop` images in the browser.
* The width and height should be the same ratio as the natural width and height of the image.
* Image optimization should be done BEFORE rendering.
* You can use the `contentful API` to request an image of a certain size.
* `rounded="circle"` requires a square image `(width == height)` in order to generate a perfect circle.
* Non-square images will give a warning and will appear oval shaped.

```jsx
<Image src="image-example.jpg" rounded="corners" width={300} height={300} alt="Image of co-workers collaborating" />
```

0 comments on commit c3b29a3

Please sign in to comment.