NavigationDrawer
Composable Component
Navigation drawers provide ergonomic access to destinations in an app. They’re often next to app content and affect the screen’s layout grid. Standard navigation drawers are good for frequent switching to different destinations.
Android
@Composable
fun NavigationDrawer(
drawerContent: @Composable NavigationDrawerScope.(DrawerValue) -> Unit,
modifier: Modifier = Modifier,
drawerState: DrawerState = rememberDrawerState(DrawerValue.Closed),
content: @Composable () -> Unit
)
Parameters
drawerContent | Content that needs to be displayed on the drawer based on whether the drawer is DrawerValue.Open or DrawerValue.Closed . Drawer-entries can be animated when the drawer moves from Closed to Open state and vice-versa. For, e.g., the entry could show only an icon in the Closed state and slide in text to form (icon + text) when in the Open state. |
modifier | the Modifier to be applied to this drawer |
drawerState | state of the drawer |
content | content of the rest of the UI |