Bottom Navigation in Compose Way

Preparation

Before we play with bottom navigation, there are some preparation need to be done before. First, we need to implement compose material dependency so that we can use bottom navigation.

implementation "androidx.compose.material:material:$compose_version"

Bottom Navigation

To create bottom navigation using compose, we need to add three things, BottomNavigation(), NavHost(), and Scaffold(). First let’s create BottomNavigation.

Result

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store