Creating an image carousel

There are all kinds of applications that make use of image carousels. Any time there's a collection of images that you'd like your user to be able to peruse, a carousel is likely among the most effective UI patterns for accomplishing the task.

There are a number of packages in the React Native community for handling the creation of carousels, but in my experience none are more stable or more versatile than react-native-snap-carousel (https://github.com/archriss/react-native-snap-carousel). This package provides a great API for customizing the look and behavior of your carousel, and supports Expo app development without the need for ejecting. You can easily change how slides appear as they slide in and out of the carousel frame via the Carousel component's layout property, and as of version 3.6, you can even create custom interpolations!

While you are not limited to only displaying images with this package, we'll be building a carousel that just displays images along with a caption to keep the recipe simple. We'll be using the excellent license-free photo site unsplash.com to get random images for displaying in our carousel via the Unsplash Source project hosted at source.unsplash.com. Unsplash Source allows you to easily request random images from Unsplash without needing to access the official API. You can visit the Unsplash Source site for more information on how it works.