3.2.12 • Published 2 years ago

@crave/farmblocks-image v3.2.12

Weekly downloads
1,123
License
MIT
Repository
github
Last release
2 years ago

logo-farmblocks

Farmblocks-Image

A React component for thumbnail images. See Storybook

Installation

npm install @crave/farmblocks-image

Spec

See it on zeplin: Thumbnails: https://scene.zeplin.io/project/595a9cd3b401bf1876faab27/screen/59f0df2fee4fbc85eccb17b1 Badges: https://scene.zeplin.io/project/595a9cd3b401bf1876faab27/screen/59f0df31bbc93198a853bbe2

Usage

import React from "react";
import ReactDOM from "react-dom";
import Image, { thumbnailSizes, badgeSizes } from "@crave/farmblocks-image";

const root = document.createElement("div");

const imageUrl =
  "https://openclipart.org/image/300px/svg_to_png/290343/1510649016.png&disposition=attachment";

ReactDOM.render(<Image src={imageUrl} size={badgeSizes.LARGE} badge />, root);

document.body.appendChild(root);

API

PropertyDescriptionType
srcrequired, the URL of the imagestring
badgemake the image a circleboolean
borderRadiusthe border radius of the image (it will be ignored if the badge prop is true)string or number
fithow should the image fit the size (same options that the object-fit css attribute)string
heightthe height of the imagestring or number
sizeif your image uses the same size in pixels for width and height, you can use this shorthandnumber
widththe width of the imagestring

Table of sizes

TypeValueSize result
badge - extra smallbadgeSizes.X_SMALL16 px
badge - smallbadgeSizes.SMALL24 px
badge - mediumbadgeSizes.MEDIUM40 px
badge - largebadgeSizes.LARGE56 px
thumbnail - smallthumbnailSizes.SMALL40 px
thumbnail - mediumthumbnailSizes.MEDIUM48 px
thumbnail - largethumbnailSizes.LARGE72 px
thumbnail - extra largethumbnailSizes.X_LARGE120 px
thumbnail - hugethumbnailSizes.HUGE240 px

License

MIT

3.2.12

2 years ago

3.2.11

3 years ago

3.2.8

3 years ago

3.2.7

3 years ago

3.2.6

3 years ago

3.2.5

4 years ago

3.2.4

4 years ago

3.2.3

4 years ago

3.2.2

4 years ago

3.2.1

4 years ago

3.2.0

4 years ago

3.1.2

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.0

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.2-alpha.26

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.2-alpha.1

5 years ago

1.1.1

5 years ago

1.1.1-alpha.13

5 years ago

1.1.1-alpha.12

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago

0.5.0

6 years ago

0.4.5

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago