Skip to main content

Photo

Image component built on expo-image with loading states and placeholders.

Basic Usage​

import { Photo } from '@multinaire/expo-ui';

<Photo source={{ uri: 'https://example.com/image.jpg' }} />

Props​

PropTypeDefaultDescription
sourceImageSource—Image source (same as expo-image)
widthDimensionValue—Fixed width of the image
heightDimensionValue—Fixed height of the image
aspectRatio'1:1' | '16:9' | '9:16'—Predefined aspect ratio shorthand
borderRadiusBorderRadiusProps—Corner radius. Accepts a number or per-corner object
marginSpacingProps—Outer margin
isLoadingbooleanfalseShow a loading skeleton in place of the image
placeholderReactNode—Placeholder rendered while the image loads or on error

All expo-image props are also supported.

Examples​

Fixed Size Image​

<Photo
source={{ uri: 'https://example.com/image.jpg' }}
width={200}
height={150}
/>

With Aspect Ratio​

<Photo
source={{ uri: 'https://example.com/image.jpg' }}
width="100%"
aspectRatio="16:9"
/>

Rounded Image​

<Photo
source={{ uri: 'https://example.com/avatar.jpg' }}
width={80}
height={80}
borderRadius={40}
/>

With Placeholder​

<Photo
source={{ uri: user.avatarUrl }}
width={64}
height={64}
placeholder={<Icon icon="User" size={32} />}
/>

Loading State​

<Photo
isLoading
width={200}
height={150}
/>

Local Image​

<Photo
source={require('../assets/logo.png')}
width={100}
height={100}
/>