# MaterialDrawer: A RecyclerView-Based Android Navigation Drawer for Kotlin and Material 3

> MaterialDrawer is an Apache-2.0 Android library that replaces hand-built DrawerLayout menus with a RecyclerView adapter of drawer items. It targets apps on API 16 and up, and the current 10.0.0 line is still published as a beta.

**mikepenz/MaterialDrawer** — The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.

- Repository: https://github.com/mikepenz/MaterialDrawer
- Website: https://mikepenz.dev
- Stars: 11,644 · Forks: 2,014
- Language: Kotlin
- License: Apache-2.0
- Published: 2026-09-21 · Updated: 2026-09-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/mikepenz-materialdrawer

## The problem MaterialDrawer removes from an Android app

A navigation drawer in a plain Android project is not one component. It is a DrawerLayout, a child view with a start gravity, a list of rows, a selected state, a header, and a click listener that has to keep the selection in sync with whatever screen is showing. Most teams rebuild that scaffolding once, then keep patching it as the menu grows.

MaterialDrawer replaces the list half of that scaffolding with an adapter. You declare drawer items as Kotlin objects, hand them to the slider, and the library renders them inside a RecyclerView. The README lists what comes with that model: PrimaryDrawerItem and SecondaryDrawerItem, DividerDrawerItem, expandable items, badge support, sticky footers or headers, an AccountSwitcher for profile switching, a Gmail-like MiniDrawer, and RTL support. It is aimed at app developers who are already using the AndroidX support libraries and a Material theme, and who want the drawer to look like the current Google Material Design guidelines without writing the row types themselves.

The library is Apache-2.0 and the repository is not archived. The last push was on 2026-09-15, so work is still landing on the develop branch. That does not mean the release line is settled: the newest release listed is v10.0.0-b01 from 2025-02-02, and the newest stable release below it is v9.0.2 from 2023-08-15.

## How the slider, adapter and DrawerLayout fit together

The architecture is a thin wrapper over AndroidX. MaterialDrawerSliderView is placed as a child of androidx.drawerlayout.widget.DrawerLayout with android:layout_gravity="start", so the DrawerLayout still owns the swipe and scrim behaviour. The slider is what MaterialDrawer adds: it holds an itemAdapter, exposes the parent DrawerLayout as slider.drawerLayout, and gives you openDrawer and closeDrawer calls on that layout.

Items are plain objects. You build a PrimaryDrawerItem, set nameRes and identifier, and add it to the adapter. The identifier is the handle you use afterwards: setSelection(1) selects by identifier, removeItem(2) removes by identifier, updateName(1, "A new name") renames by identifier. Because the rows live in a RecyclerView, updating one item goes through slider.updateItem(item1) rather than a full rebuild of the menu.

Two behaviours are worth knowing before you write a listener. First, clicking an item selects it by default; the README says you can opt out per item with isSelectable = false. Second, the click listener returns a Boolean, and the README example returns false. Selection state and navigation are therefore separate concerns you wire yourself: the library does not know about your fragments or your NavController.

For the last part there is a separate artifact, materialdrawer-nav, described in the README as NavController support contributed by a maintainer. Android-Iconics support is likewise a separate artifact, materialdrawer-iconics, which is how vector icons and icon fonts such as Google Material Design Icons, Material Community Icons and FontAwesome get into drawer rows.

## Installing MaterialDrawer and wiring a first drawer

Start with the Gradle dependency. The README shows the artifact as com.mikepenz:materialdrawer with the version supplied by a variable, and it lists the support modules the library expects alongside it. The README also notes that com.google.android.material requires at least 1.5.0-x, and the sample block pins 1.5.0-alpha05.

```gradle
implementation("com.mikepenz:materialdrawer:${latestRelease}")

//required support lib modules
implementation "androidx.appcompat:appcompat:${versions.appcompat}"
implementation "androidx.recyclerview:recyclerview:${versions.recyclerView}"
implementation "androidx.annotation:annotation:${versions.annotation}"
implementation "com.google.android.material:material:1.5.0-alpha05" // requires at least 1.5.0-x
implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}"
```

Next, put the slider in the layout. The README's XML places MaterialDrawerSliderView inside a DrawerLayout, with wrap_content width, match_parent height, start gravity and fitsSystemWindows on both views. Your own content goes where the comment sits. Without this child the slider has no DrawerLayout to open and close.

```xml
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <com.mikepenz.materialdrawer.widget.MaterialDrawerSliderView
        android:id="@+id/slider"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true" />
</androidx.drawerlayout.widget.DrawerLayout>
```

Then point your theme at the drawer styles. The README adds two items to an activity theme whose parent is Theme.Material3.DayNight.NoActionBar, and it warns that using v9.x with Material 3 theming requires a Material3 theme as the base.

```xml
<style name="SampleApp.DayNight" parent="Theme.Material3.DayNight.NoActionBar">
    <item name="materialDrawerStyle">@style/Widget.MaterialDrawerStyle</item>
    <item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle</item>
</style>
```

Finally, add items in code. The README keeps each item in a variable when it will be updated later, then adds them to slider.itemAdapter together with a DividerDrawerItem, and assigns slider.onDrawerItemClickListener. What you should see after this is a drawer that opens from the start edge with two labelled rows separated by a divider, and a listener that fires with the item and its position.

## Where MaterialDrawer gets in your way

The library covers the drawer, not the navigation graph. If your app already uses a NavController, the README points to materialdrawer-nav as a separate dependency rather than folding that support into the core artifact. That means an extra dependency and an extra version to keep aligned with the core library, since the README publishes them under the same release number.

The bigger constraint is the release line. The README's own release table splits the versions by language and design system: v10.0.0-b01 for Kotlin with M3 and JVM 17, v9.0.2 for Kotlin with Material 3, v8.4.5 for Kotlin, v6.1.2 for Java with AndroidX, and v6.0.9 for Java with AppCompat. The v8.4.5, v6.1.2 and v6.0.9 lines are marked "Provided as-is only" in the README, which is a clear signal that older branches do not receive the same attention. If you are on Java, the current work is not aimed at you.

There is also a version mismatch inside the README itself. The dependency snippet uses a ${latestRelease} placeholder, while the Maven Central links in the same section point at version 9.0.1. Anyone copying the snippet has to resolve the version themselves, and the newest published release is a beta. A team that needs a stable artifact should expect to pin v9.0.2 and accept the Material 3 note about the theme base.

Compose is the case where this is the wrong tool. The setup described in the README is an XML DrawerLayout plus a MaterialDrawerSliderView and an XML theme style. Nothing in the README describes a Compose equivalent, so a Compose-first app would be adding a View-based drawer into a Compose tree for features it may already have in Material 3's own navigation components.

## MaterialDrawer compared with Material 3's own navigation drawer

The honest alternative is the navigation drawer that ships inside com.google.android.material, which MaterialDrawer already depends on. Both end up as a DrawerLayout with a start-gravity child, and both read their colours from a Material 3 theme. The difference is what sits inside the child.

With the Material components, you write a NavigationView and describe the menu in a menu XML resource. Rows are menu items, selection is a checked item id, and headers are a layout you inflate. With MaterialDrawer, rows are Kotlin objects in an adapter, and the operations are methods on the slider: updateItem, updateName, addItem, addStickyFooterItem, removeItem, setSelection. That API is the reason to pick it. Updating a badge on one row, or swapping a sticky footer, is a single call rather than a menu resource edit plus a reinflate.

The second alternative is building the row list yourself on a RecyclerView inside the DrawerLayout. That is exactly what MaterialDrawer is doing, minus the item types, the badge and divider defaults, the MiniDrawer and the AccountSwitcher. If your drawer is five static rows that never change, the Material components version is less code and one fewer library. MaterialDrawer earns its place when the drawer is dynamic: badges that change, items that appear and disappear, profiles that switch.

## Maintenance, upgrades and the Apache-2.0 licence

The repository is not archived and the last push was on 2026-09-15, so commits are still arriving. The release cadence tells a different story: v10.0.0-a01 in January 2025, v10.0.0-b01 in February 2025, and nothing published since, with v9.0.2 sitting back in August 2023. A project can be pushed to without cutting releases, and that is what the release list shows here.

Upgrade cost is dominated by the version table in the README. Moving from below 8.0.0 is not a drop-in change; the README points to a MIGRATION.md guide for that jump. Moving between the 9.x and 10.x lines also means checking your toolchain, because the 10.0.0 line is described as Kotlin, M3 and JVM 17. If your build is on an older JVM target, that line is not open to you yet.

On licensing, the repository carries Apache-2.0, which is a permissive licence that permits commercial use and modification and includes a patent grant. It also requires that you keep the licence and attribution notices. This is a description of the licence identifier in the repository, not legal advice; if your organisation has a licence review process, run the Apache-2.0 text through it.

## Conclusion

Adopt MaterialDrawer if you want a RecyclerView-driven drawer with badges, sticky footers and an account switcher already built, and you can accept the version split: v9.0.2 is the stable Material 3 line while v10.0.0-b01 is the Kotlin, M3 and JVM 17 line. Do not adopt it if you need a Compose-only navigation stack; the setup here is an XML DrawerLayout plus a MaterialDrawerSliderView, and the README describes no Compose path. Before committing, check the materialdrawer artifact for the version you intend to ship and confirm your activity theme is a Material3 theme, because the README states that v9.x with Material 3 theming requires one.

## FAQ

### What is MaterialDrawer and what does it include?

MaterialDrawer is an Android drawer library that renders drawer items in a RecyclerView. The README lists an AccountSwitcher, badge support, expandable items, sticky footers or headers, a MiniDrawer, RTL support and Android-Iconics integration among its features.

### How do I add MaterialDrawer to my Android project?

Add the com.mikepenz:materialdrawer dependency from Maven Central along with the support modules the README lists, place a MaterialDrawerSliderView inside a DrawerLayout with start gravity, and add materialDrawerStyle and materialDrawerHeaderStyle to your activity theme.

### Which version of MaterialDrawer should I use?

The README's release table lists v10.0.0-b01 for Kotlin with M3 and JVM 17, v9.0.2 for Kotlin with Material 3, and older Kotlin and Java lines marked provided as-is only. The newest release is a beta, so a team needing a stable artifact would look at v9.0.2.

### Does MaterialDrawer work with Jetpack Compose?

The README documents an XML DrawerLayout containing a MaterialDrawerSliderView plus XML theme styles, and describes no Compose equivalent. A Compose-first app would be embedding a View-based drawer rather than using a Compose navigation component.

### What licence does MaterialDrawer use?

The repository carries Apache-2.0, a permissive licence that allows commercial use and modification and includes a patent grant, while requiring the licence and attribution notices to be kept.

## Sources

- [License: Apache-2.0](https://github.com/mikepenz/MaterialDrawer/blob/develop/LICENSE)
- [mikepenz/MaterialDrawer on GitHub](https://github.com/mikepenz/MaterialDrawer)
- [Project website](https://mikepenz.dev)
- [README](https://github.com/mikepenz/MaterialDrawer/blob/develop/README.md)
- [Releases](https://github.com/mikepenz/MaterialDrawer/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/mikepenz-materialdrawer
