ImageModal
ImageModal component of React Native for building a user interface.
How to use
import React from 'react';
import {ImageModal} from '@gyri/native-ui-components';
const App = ({className}) => {
return (
<ImageModal
className={className}
resizeMode="contain"
style={{
width: 250,
height: 250,
}}
source={{
uri: 'https://cdn.pixabay.com/photo/2019/07/25/18/58/church-4363258_960_720.jpg',
thumbUri: 'https://cdn.pixabay.com/photo/2019/07/25/18/58/church-4363258_960_720.jpg',
}}
/>
)
}
export default App
Props
| # | Name | Data type | Default value | Values | Description |
|---|---|---|---|---|---|
| 1 | style | object | Custom style object | ||
| 2 | className | string | '' | It defined nativewind style classes. | |
| 3 | source | object | {} | {uri: image path, thumbUri: compressed thumb url} | Image source uri and thumb uri. Thumb uri image should be of smaller size; so it will give better performance. |
| 4 | resizeMode | string | 'cover' | contain, cover, stretch, repeat, center. |
For more details https://github.com/jobtoday/react-native-image-viewing#readme