Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eygraber/compose-material3-navigation
A library which provides Compose Material3 support for Jetpack Navigation Compose. This features composable bottom sheet destinations.
https://github.com/eygraber/compose-material3-navigation
androidx-navigation bottom-sheet bottomsheet compose material3
Last synced: about 1 month ago
JSON representation
A library which provides Compose Material3 support for Jetpack Navigation Compose. This features composable bottom sheet destinations.
- Host: GitHub
- URL: https://github.com/eygraber/compose-material3-navigation
- Owner: eygraber
- License: mit
- Created: 2024-11-17T06:16:57.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2024-11-17T07:30:00.000Z (about 1 month ago)
- Last Synced: 2024-11-17T08:17:22.184Z (about 1 month ago)
- Topics: androidx-navigation, bottom-sheet, bottomsheet, compose, material3
- Language: Kotlin
- Homepage:
- Size: 150 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog_config.json
- License: LICENSE
Awesome Lists containing this project
README
# Compose Material3 Navigation
A library which provides [Compose Material3](https://developer.android.com/jetpack/androidx/releases/compose-material3)
support for [Jetpack Navigation Compose](https://developer.android.com/jetpack/compose/navigation).
This features composable bottom sheet destinations.## Usage
### Bottom Sheet Destinations
1. Create a `ModalBottomSheetNavigator` and add it to the `NavController`:
```kotlin
@Composable
fun MyApp() {
val bottomSheetNavigator = rememberModalBottomSheetNavigator()
val navController = rememberNavController(bottomSheetNavigator)
}
```
2. Wrap your `NavHost` in the `ModalBottomSheetLayout` composable that accepts a `ModalBottomSheetNavigator`.
```kotlin
@Composable
fun MyApp() {
val bottomSheetNavigator = rememberModalBottomSheetNavigator()
val navController = rememberNavController(bottomSheetNavigator)
ModalBottomSheetLayout(bottomSheetNavigator) {
NavHost(navController, "home") {
// We'll define our graph here in a bit!
}
}
}
```
3. Register a bottom sheet destination
```kotlin
@Composable
fun MyApp() {
val bottomSheetNavigator = rememberModalBottomSheetNavigator()
val navController = rememberNavController(bottomSheetNavigator)
ModalBottomSheetLayout(bottomSheetNavigator) {
NavHost(navController, "home") {
composable(route = "home") {
...
}
bottomSheet(route = "sheet") {
Text("This is a cool bottom sheet!")
}
}
}
}
```## Setup
```
repositories {
mavenCentral()
}dependencies {
implementation("com.eygraber:compose-material3-navigation:0.0.3")
}
```Snapshots can be found [here](https://s01.oss.sonatype.org/content/repositories/snapshots/com/eygraber/compose-material3-navigation).