You can use a list with multiple item types to display mixed content types such as text, images, and interactive elements.
Version compatibility
This implementation requires that your project minSDK be set to API level 21 or higher.
Dependencies
Add multiple item types
You can specify the content type for each item of the layout when you compose a list or a grid with multiple types of items:
Key points about the code
- Specifies the content type for each item by setting
contentType
initems()
. - Maps each content type to a corresponding composable. For example,
Audio
is acontentType
that is defined elsewhere and is mapped to anAudioMessage
composable. - Compose reuses the rendered composables for each item of a given content type.
Results
![Code output showing audio and text messages](https://developer.android.com/static/quick-guides/content/multiple-item-types.png?authuser=5)
Parent collections
![](https://developer.android.com/static/images/quick-guides/collection-illustration.png?authuser=5)
Display a list or grid
Lists and grids allow your app to display collections in a
visually pleasing form that's easy for users to consume.
![](https://developer.android.com/static/images/quick-guides/collection-illustration.png?authuser=5)
Display interactive components
Learn how composable functions can enable you to easily
create beautiful UI components based on the Material Design design
system.
![](https://developer.android.com/static/images/quick-guides/collection-illustration.png?authuser=5)
Compose basics (video collection)
This series of videos introduces various Compose APIs,
quickly showing you what’s available and how to use them.
Have questions or feedback
Go to our frequently asked questions page and learn about quick guides or reach out and let us know your thoughts.