⚡ Image with enhanced feature like auto scale image, loading, and more ⚡
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.
To install Auto Image, run the following command:
npm install @rn-flix/auto-image
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} />
);
};
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)
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 }}
/>
);
};
Auto Image is licensed under the MIT License.
Auto Image was created by Flix.
If you encounter any bugs or issues, please report them on the issue tracker.