@rn-flix/auto-image
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Auto Image

⚡ Image with enhanced feature like auto scale image, loading, and more ⚡

Description

Auto Image is a React Native component that automatically scales images to fit the screen while maintaining their aspect ratio. It also provides a loading indicator and error handling.

Installation

To install Auto Image, run the following command:

npm install @rn-flix/auto-image

Usage

To use Auto Image, import the component and pass the image source as a prop:

import AutoImage from '@rn-flix/auto-image';

const App = () => {
  return (
    <AutoImage source={{ uri: 'https://picsum.photos/400/200' }} width={300} />
  );
};

Props

The following props are available:

  • source: The image source (required)
  • width: The width of the image (optional)
  • height: The height of the image (optional)
  • style: Custom styles for the image (optional)
  • loadingWidth: Set the width of the loading indicator (optional)
  • loadingHeight: Set the height of the loading indicator (optional)

Example

Here is an example of using Auto Image with a remote image:

import AutoImage from '@rn-flix/auto-image';

const App = () => {
  return (
    <AutoImage
      source={{ uri: 'https://picsum.photos/400/200' }}
      width={300}
      style={{ borderRadius: 10 }}
    />
  );
};

License

Auto Image is licensed under the MIT License.

Author

Auto Image was created by Flix.

Bugs and Issues

If you encounter any bugs or issues, please report them on the issue tracker.

Package Sidebar

Install

npm i @rn-flix/auto-image

Weekly Downloads

5

Version

1.0.1

License

MIT

Unpacked Size

22.7 kB

Total Files

10

Last publish

Collaborators

  • flixyudh