@hashicorp/hashi-image

super optimized image element, pulls from dato and formats for 7 screen sizes in two formats. Skips optimization for SVGs.

Stats

StarsIssuesVersionUpdatedCreatedSize
@hashicorp/hashi-image
1.0.72 years ago4 years agoMinified + gzip package size for @hashicorp/hashi-image in KB

Readme

Image

Super optimized image element, pulls from dato and formats for 7 screen sizes in two formats. Skips optimization for SVGs.

Props

  • src (str): url of the image docs
  • steps (arr): [optional] array of screen sizes to optimize for
  • sizes (str): [optional] same as sizes on an img tag docs
  • classes (str): [optional] any classes to be added to the image
  • alt (str): [optional] alt text for the image docs
  • aspect_ratio (arr or str): [optional] automatically crops to aspect ratio. first two items in the array are the ratio (ex. [16,9]), and the third is the base width that images will be cropped to in IE, which doesn't support srcset (ex. [16,9,500]). if string is provided, brackets should be excluded (ex. 16,9,500). string will be converted to array
  • params (obj): [optional] params passed directly to imgix

Dependents:

  • hero
  • logo-grid
  • nav
  • person-list
  • resource-list
  • text-and-image

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.