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

@merchantlabs/gatsby-image-loader

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@merchantlabs/gatsby-image-loader - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

package.json
{
"name": "@merchantlabs/gatsby-image-loader",
"version": "0.1.1",
"version": "0.1.2",
"description": "gatsby-image-loader React component",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -60,3 +60,19 @@ # @merchantlabs/gatsby-image-loader

```
## `gatsby-image-loader` props
| Name | Type | Description |
| ----------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `resolutions` | `object` | Data returned from the `resolutions` query |
| `sizes` | `object` | Data returned from the `sizes` query |
| `title` | `string` | Passed to the underlying hidden `img` element |
| `alt` | `string` | Passed to the underlying hidden `img` element |
| `onLoad` | `func` | A callback that is called when the full-size image has loaded. |
| `children` | `func` | Function that receives `src` and `imgLoaded` as props and returns a React component |
----------------
**Everything below here is copied directly from the [`gatsby-image` docs](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-image) without modification.**
----------------
## Two types of responsive images

@@ -84,2 +100,53 @@

## "Resolutions" queries
### Component
Pass in the data returned from the `resolutions` object in your query via the
`resolutions` prop. e.g. `<ImageLoader resolutions={resolutions}> {({ src }) => {...}} </ImageLoader>`
### Query
```graphql
{
imageSharp {
# Other options include height (set both width and height to crop),
# grayscale, duotone, rotate, etc.
resolutions(width: 400) {
# Choose either the fragment including a small base64ed image, a traced placeholder SVG, or one without.
...GatsbyImageSharpResolutions
}
}
}
```
## "Sizes" queries
### Component
Pass in the data returned from the `sizes` object in your query via the `sizes`
prop. e.g. `<ImageLoader sizes={sizes}> {({ src }) => {...}} </ImageLoader>`
### Query
```graphql
{
imageSharp {
# i.e. the max width of your container is 700 pixels.
#
# Other options include maxHeight (set both maxWidth and maxHeight to crop),
# grayscale, duotone, rotate, etc.
sizes(maxWidth: 700) {
# Choose either the fragment including a small base64ed image, a traced placeholder SVG, or one without.
...GatsbyImageSharpSizes_noBase64
}
}
}
```
## Image processing arguments
[gatsby-plugin-sharp](/packages/gatsby-plugin-sharp) supports many additional arguments for transforming your images like
`quality`,`sizeByPixelDensity`,`pngCompressionLevel`,`cropFocus`,`greyscale` and many more. See its documentation for more.
## Fragments

@@ -147,63 +214,1 @@

options._
## "Resolutions" queries
### Component
Pass in the data returned from the `resolutions` object in your query via the
`resolutions` prop. e.g. `<ImageLoader resolutions={resolutions}> {({ src }) => {...}} </ImageLoader>`
### Query
```graphql
{
imageSharp {
# Other options include height (set both width and height to crop),
# grayscale, duotone, rotate, etc.
resolutions(width: 400) {
# Choose either the fragment including a small base64ed image, a traced placeholder SVG, or one without.
...GatsbyImageSharpResolutions
}
}
}
```
## "Sizes" queries
### Component
Pass in the data returned from the `sizes` object in your query via the `sizes`
prop. e.g. `<ImageLoader sizes={sizes}> {({ src }) => {...}} </ImageLoader>`
### Query
```graphql
{
imageSharp {
# i.e. the max width of your container is 700 pixels.
#
# Other options include maxHeight (set both maxWidth and maxHeight to crop),
# grayscale, duotone, rotate, etc.
sizes(maxWidth: 700) {
# Choose either the fragment including a small base64ed image, a traced placeholder SVG, or one without.
...GatsbyImageSharpSizes_noBase64
}
}
}
```
## `gatsby-image-loader` props
| Name | Type | Description |
| ----------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `resolutions` | `object` | Data returned from the `resolutions` query |
| `sizes` | `object` | Data returned from the `sizes` query |
| `title` | `string` | Passed to the underlying hidden `img` element |
| `alt` | `string` | Passed to the underlying hidden `img` element |
| `onLoad` | `func` | A callback that is called when the full-size image has loaded. |
| `children` | `func` | Function that receives `src` and `imgLoaded` as props and returns a React component |
## Image processing arguments
[gatsby-plugin-sharp](/packages/gatsby-plugin-sharp) supports many additional arguments for transforming your images like
`quality`,`sizeByPixelDensity`,`pngCompressionLevel`,`cropFocus`,`greyscale` and many more. See its documentation for more.
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