Navigation Drawer Using Jetpack compose

Updated 28 February 2022


What is Navigation Drawer?

Navigation Drawer is a sliding left menu that is used to display the menu content in Android.
It makes it easy to navigate between different screens.
The drawer appears when the user touches the drawer menu icon in the app bar.
It also appears when the user swipes a finger from the left edge of the screen.

Navigation Drawer using jetpack compose have same features and functionality.
To add a drawer in jetpack compose we use the Scaffold component.
Scaffold implements the basic material design visual layout structure.
It provides APIs to put together several material components to construct your screen.

In this article, we make a sample Navigation Drawer Using Jetpack compose.

We will take some static data to show in the drawer menu.

Lat’s take an example to check how the navigation drawer works in jetpack compose.
We have added all code in the MainActivity file. You can do it according to the need and architecture of the application.

Let’s look at the code.

Function to add Heading in drawer :

Function to add content/sub-content in drawer :

Complete Code :

Now, Run the code and check the result.

Result :

Drawer in jetpack compose

Conclusion :

In this article, we learn how we can add a drawer to our app using jetpack compose.
For more information about the drawer in jetpack compose, please follow the link.

Thank you For Reading.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


  • Afas
    • Pankaj Tyagi
  • Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home