1.0.4 • Published 2 years ago

react-native-macos-fast-image v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

fast image for react native macOS adapted from https://github.com/candlefinance/faster-image

Features

  • Fast image loading
  • Memory and disk caching
  • Placeholder support:
  • Animated transition
  • Failure image
  • Typescript support
  • Written in Swift

Installation

yarn add react-native-macos-fast-image

Usage

import { FasterImageView } from 'react-native-macos-fast-image';

<FasterImageView
  rounded={true}
  onError={(event) => console.warn(event.nativeEvent.error)}
  style={{ width: 300, height: 300 }}
  thumbhash="k0oGLQaSVsJ0BVhn2oq2Z5SQUQcZ"
  cachePolicy="discNoCacheControl"
  transitionDuration={0.3}
  url="https://picsum.photos/seed/3240/4000/3000"
/>;

Props

PropTypeDefaultDescription
urlstringThe URL of the image
styleobjectThe style of the image
resizeModestringcontainThe resize mode of the image
thumbhashstringThe thumbhash of the image as a base64 encoded string to show while loading
blurhashstringThe blurhash of the image to show while loading
showActivityIndicatorbooleanfalseWhether to show the UIActivityIndicatorView indicator when the image is loading
base64PlaceholderstringThe base64 encoded placeholder image to show while the image is loading
cachePolicystringmemoryThe cache policy of the image
transitionDurationnumber0.75The transition duration of the image
roundedbooleanfalseRound the image into a circle
failureImagestringIf the image fails to download this will be set (blurhash, thumbhash, base64)
progressiveLoadingEnabledbooleanfalseProgressively load images
onErrorfunctionThe function to call when an error occurs. The error is passed as the first argument of the function
onSucessfunctionThe function to call when the image is successfully loaded

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago