Socket
Book a DemoInstallSign in
Socket

pro-image

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pro-image

React native image component with blurred progressive loading

0.0.3
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

ProImage

React native progressive image component.

Install

$ npm i pro-image
or
$ yarn add pro-image

Usage

Simple example:

import ProImage from 'pro-image';

const MyImageComponent = () =>
  <ProImage 
    thumbnail={{ uri: 'lorem.ipsum/thumbnail.png' }} 
    image={{ uri: 'lorem.ipsum/big-image.png' }} 
  />

Properties

PropertyIs optional?DefaultDescription
imageno-Image to render.
thumbnailyesnullThe image to render with the same aspect ratio and the smallest resollution possible.
placeholderyesnullPlaceholder image to render while the image is loading.
(Note: placeholder will not show if there's a thumbnail)
resizeModeyescoverImage resize mode.
styleyes{}Styles for the image.
containerStyleyes{}Styles for the image container (View).
durationyes1000 (ms)Time in milliseconds that the fade effects lasts.

Full example:

import ProImage from 'pro-image';
import placeholder from './path/to/placeholder.png';

const MyImageComponent = () =>
  <ProImage
    placeholder={placeholder}
    thumbnail={{ uri: 'lorem.ipsum/thumbnail.png' }}
    image={{ uri: 'lorem.ipsum/big-image.png' }}
    containerStyle={{ margin: 4 }}
    style={{ height: 100, width: 200 }}
    resizeMode="contain"
/>

Global properties

Set global values to all the images in your app.

Properties

PropertyDefalutDescription
duration1000 (ms)Time in milliseconds that the fade effects lasts.
placeholdernullPlaceholder image.
blur1Blur radius for the thumbnail.

Usage

Customize all options:

import ProImage from 'pro-image';
import placeholder from './path/to/placeholder.png';

ProImage.setDefaultConfig({
  duration: 500, 
  placeholder, 
  blur: 2
});

Changing just one value:

import ProImage from 'pro-image';
ProImage.setDefaultConfig({ duration: 750 });

FAQs

Package last updated on 19 Nov 2017

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.