Generic Image components from
.
You can use all props of React native Image.
function Example() {
return <Image source={{
uri: "https://wallpaperaccess.com/full/317501.jpg"
}} alt="Alternate Text" size={"xl"} />;
}
function Example() {
return <ScrollView>
<VStack space={2} alignItems="center" safeAreaTop my={6}>
{["xs", "sm", "md", "lg", "xl", "2xl"].map(size => <Image size={size} resizeMode="cover" source={{
uri: "https://wallpaperaccess.com/full/317501.jpg"
}} alt={"Alternate Text " + size} />)}
</VStack>
</ScrollView>;
}
function Example() {
return <Image size={150} resizeMode={"contain"} borderRadius={100} source={{
uri: "https://wallpaperaccess.com/full/317501.jpg"
}} alt="Alternate Text" />;
}
function Example() {
return <Image size={150} alt="fallback text" borderRadius={100} source={{
uri: "https://-page-icon.png"
}} fallbackSource={{
uri: "https://www.w3schools.com/css/img_lights.jpg"
}} />;
}
function Example() {
const myRef = React.useRef(null);
React.useEffect(() => {
myRef.current.setNativeProps({
borderWidth: 10,
opacity: 0.5
});
}, [myRef]);
return <Image ref={myRef} source={{
uri: "https://wallpaperaccess.com/full/317501.jpg"
}} alt="Alternate Text" size="xl" />;
}
Image implements
,
,
,
,
,
,
,
The alt text that describes the image. This will be added as accessibilityLabel in android/iOS and alt on web
In event there was an error loading the src, specify a fallback source.
Opt out of the fallbackSource logic and show alternative text