Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@crave/farmblocks-image

Package Overview
Dependencies
Maintainers
6
Versions
1126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crave/farmblocks-image

A react component for thumbnail images

  • 3.2.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
188
decreased by-84.78%
Maintainers
6
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 05 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc