Image
Lightweight web-compatible image with Tamagui styleΒ props
This lightweight Image component renders on web and native with Tamagui style props and no react-native-web dependency.
Features
Web and native support
Server rendering support
No react-native-web dependency
Installation
Image is already installed in tamagui, or you can install it independently:
yarn
npm
bun
pnpm
Usage
API reference
Image
Tamagui props + Web img props + React Native Image props.
Some common props
Props
src
string | number
The image URL.
alt
string
Mandatory and incredibly useful for accessibility.
objectFit
CSS.ObjectFit
Sets how the content of the image is resized to fit its container. An alternative to the `resizeMode` prop.
unstyled
boolean
When true, removes all default styles.
onLoad
function
Callback when the image is loaded.
onError
function
Callback when the image fails to load.