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

@assetcrush/react-native-sdk

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@assetcrush/react-native-sdk

A simple react native library to resize image on fly

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

NPM License NPM Version

assetcrush

A simple react-native library to resize image on fly.

What is assetcrush ?

assetcrush is an image resize service for on the fly dynamic resize. If your users are uploading images of various sizes and then you are consuming those images on different devices then this service is ideal for your use. Since every device has different dimensions our sdk will make sure to get the rightly resized image for you via assetcrush resize service.

Getting started

https://assetcrush.com/en/docs/getting-started

Installation

npm i @assetcrush/react-native-sdk --save

or with yarn

yarn add @assetcrush/react-native-sdk

Usage

import React from "react";
import { StyleSheet } from "react-native";
import { ImageCrush, setKey } from '@assetcrush/react-native-sdk';

// replace test-key with your assetcrush key
setKey("test-key");

export default function App() {
  return (
    <ImageCrush
      source={{
        uri: "https://cdn.pixabay.com/photo/2021/12/11/07/59/hotel-6862159__340.jpg"
      }}
      style={styles.image}
    />
  );
}

const styles = StyleSheet.create({
  image: { width: 300, height: 300 },
});

Props

PropTypeRequiredNote
sourceobjectyessource object should contain uri
styleobjectnostyle object
spinnerIconelementnoCustom Reactative element for loading
reloadIconelementnoCustom Reactative element for retry
spinnerColorstringnoCustom color for loading
hideSpinnerboolnoShow or hide loading
onErrorfuncnoIf image fails to load
onLoadfuncnoWhen image loads successfully
acEnvstringnoEnvoirment of the compoent

Any additional props are passed down to underlying <Image /> element.

Run example

git clone https://github.com/assetcrush/react-native-sdk.git
cd react-native-sdk/example
yarn install # or npm install

# to run with npm
npm start

# to run with yarn
yarn start

Seeing issues or any feedback or feature suggest ?

Create an issue with github.

Keywords

FAQs

Package last updated on 15 Jun 2022

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