New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-statamic-image

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-statamic-image

Responsive image component

  • 1.0.15
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Weekly downloads
 
Created
Source

Vue-Statamic-Image

Responsive image component

Uses the image attributes srcSet and sizes to responsively display an an image from statamic.

Generates srcSet with a placeholder for lazyloading based on screen sizes passed in options and adjusts the sizes attribute depending on the screen size.

Installation

npm i vue-statamic-image

Setup

Vue.use(StatamicImage, {
  statamicBaseUrl: "localhost:3000",
});

Usage

<StatamicImage src="/assets/image.jpg" />

Plugin Options

OptionDefaultRequiredTypeComment 
statamicBaseUrlnulltrueString
statamicGlideApiEndpoint/api/imgfalseStringIf this option is not set, the image manipulation features of this component will not work
screenSizesdefault screen sizesfalseObject

Attributes

AttributeDefaultRequiredTypeDescription
srcnulltrueStringRelative path to image from statamicAssetUrl
quality90falseNumber Glide Option
blurnullfalseNumberGlide Option
fitnullfalseStringGlide Option
cropnull falseStringGlide Option
formatnullfalseStringGlide Option
fallbackWidthnullfalseNumberIf srcSet and sizes are not supported in the clients browser, this will be the fixed width of the image itself (not css width)
 aspectRatio null false NumberIf you set this attribute the component will ignore the placeholderDataUrl attribute and load the placeholder image from statamic because the aspect ratio would change between placeholder and the real image
 placeholderDataUrlnullfalseString If this attribute is set all other placeholder options are ignored and this url is used as the placeholder source.
 placeholderBlur100falseNumber Glide Option
placeholderQuality30 falseNumberGlide Option
placeholderWidth400 falseNumberGlide Option
usePlaceholder true falseBooleanIf this attribute is set to false, no placeholder will be displayed and the original image will be rendered immediately

Example

<StatamicImage
  src="/assets/image.jpg"
  format="webp"
  :quality="80"
  placeholderDataUrl="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDo etc"
/>

FAQs

Package last updated on 07 Apr 2021

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