npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@wix/image

v1.337.0

Published

Wix base image component

Downloads

3,570

Readme

Image

One Image to rule them all.

... and in the darkness register the custom element and load them.

Example

import { Image } from '@wix/image';

function Example() {
  return <Image {...props} />
}

Installation

Install package

You can install the package via npm/yarn

> npm install -s @wix/image --registry http://npm.dev.wixpress.com/

or:

> yarn add @wix/image --registry http://npm.dev.wixpress.com/

Props

| Prop name | Type | Default | Description | | -------------- | ------------ | --------- | --------- | | id | string | - | System generated id | | containerId | string | - | Parent container id | | uri | string | - | Original image URI | | alt | string | - | Alternate text | | name | string | '' | Name of the image, used for generating a pretty URL | | role | string | - | Role | | width | number | - | Width of the original source image | | height | number | - | Height of the original source image | | displayMode | string | - | Method to use for fitting the image into its container (like CSS's object-fit property) : fill | fit | stretch | devicePixelRatio | number | - | Force a pixel-ratio to use for loading the image. Defaults to DPR of the device and using 2 as max | | quality | object | - | Image quality : quality: number ; unsharpMask: {radius: any;amount: any; threshold: any;} | | alignType | string | - | Alignment of the image. To note: if the image is larger than the container and the display mode is not set to fit or stretch, the alignment will refer to the container's position on the image. Otherwise, it will refer to the position of the image within the container. Options: center | top | top_left | top_right | left | right | bottom | bottom_left | bottom_right | | bgEffectName |string | '' | name of background scroll effect | | focalPoint | object | - | Image focal point (0 - 100). Relevant only if displayMode is set to fill, actual_size and original_size {x: number; y: number} | | upscaleMethod | string| - | auto | classic | super | | className |string | '' | Additional class names | | crop | object | - | Image crop (x & y are coordinates of the pixel to start cropping from). Flip and rotate parameters are relevant only if svgId is provided. { x: number; y: number; width: number; height: number; svgId?: string; flip?: 'vertical' \| 'horizontal' \| 'both' \| 'none'; rotate?: number;} | | imageStyles |object | {} | Inline styling | | targetWidth |number | - | Override for the rendered image element's width | | targetHeight |number | - | Override for the rendered image element's height | | containerWidth | number | - | Width in pixels of the container element | | containerHeight |number | - | Height in pixels of the container element | | onLoad | function | () => {} | Image's onLoad callback | | onError | function | () => {} | Image's onError callback | | shouldUseLQIP | boolean | - | Indicates whether component should use a low quality placeholder before loading the final high-quality image'| | getPlaceholder | function | - | function that returns placeholder uri and styling (if undefined and shouldUseLQIP true, the component will default to use getPlaceholder from the @imageKit) | | isInFirstFold | boolean | - | If true, render high quality image in SSR (currently only supported for images with known fixed size) | | placeholderTransition | string | 'blur' | Method of transition to use between placeholder and final image | | socialAttrs | object| - | {'data-pin-nopin'?: boolean; 'data-pin-url'?: string; 'data-pin-media'?: string;} | | isSEOBot | boolean | - | If true, render high quality image for indexing robots | | skipMeasure | boolean | false | If true, the measurement for the image will be skipped and given dimensions will be used instead.| | hasAnimation | boolean | false | Is the image an animated webp.|