Looking for documentation on gluestack-ui v2 with NativeWind? Refer to this link.
This is an illustration of a Themed Image component with default configuration.
size
borderRadius
<Image
size="md"
borderRadius="$none"
source={{
uri: "https://images.unsplash.com/photo-1472214103451-9374bd1c798e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80",
}}
/>

API Reference

Import

To use this component in your project, include the following import statement in your file.
import { Image } from "@gluestack-ui/themed"

Anatomy

The structure provided below can help you identify and understand a Image component's various parts.
export default () => <Image source={source} />

Component Props

This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.

Image

It inherits all the properties of React Native's Image component.

Themed

The themed version of the component is a pre-styled version of the component, which allows you to quickly integrate the component into your project. The component's design and functionality are fully defined, allowing you to focus on the more important aspects of your project. To know more about Themed Library please visit this link.

Props

Image component is created using Image component from react-native. It extends all the props supported by React Native Image, utility props and the props mentioned below.

Image

Name
Value
Default
size
2xs | xs | sm | md | lg | xl | 2xl | full
md
Note: These props are exclusively applicable when utilizing the default configuration of gluestack-ui/config. If you are using a custom theme, these props may not be available.

Unstyled

All the components in gluestack-ui are unstyled by default. To customize your UI using the extendedTheme, please refer to this link. The import names of components serve as keys to customize each component.

How to use Next.js Image

By default, Image component uses Native Image component. If you want to use Next.js Image component, you have to create a new styled component for image and map it to Image component. You can also change the already present styled-component for images on the path ./components/core/button/styled-components in your project.
import Image from 'next/image';
// Using the Next Image component
const StyledImage = styled(Image, styling, componentConfig, extenedBaseConfig);
// if some styling are direct props, you can pass them as props in the styling
props: {
w: 100,
h: 100,
borderRadius: '$full',
}
// import the createImage function
import { createImage } from '@gluestack-ui/image';
// Understanding the API
const Image = createImage({
Root: StyledImage
});
// you can also /style/docs/getting-started/styled to style the component
export default () => <Image />;

How to use Expo Image

In expo, Image component doesn't accept dataSet prop in the components. So, you have to pass config to not optimize the Image component on web in the styled function to make it work.
import Image from "expo-image"
// Using the Expo Image component
const StyledImage = styled(Image, styling, componentConfig, extenedBaseConfig)
// import the createImage function
import { createImage } from "@gluestack-ui/image"
// Understanding the API
const Image = createImage({
Root: StyledImage,
})
export default () => <Image />

Spec Doc

Explore the comprehensive details of the Image in this document, including its implementation details, checklist, and potential future additions. Dive into the thought process behind the component and gain insights into its development journey.