Modo - state-based Jetpack Compose navigation
Modo is a simple and convenient state-base navigation library for Jetpack Compose.
Modo.overview.mp4
Check out our website to get the most up-to-date information about the library:
Each integration of Modo is a rooted tree (wiki) that can be displayed:
- Each node - is a
Screen
orContainerScreen
- Leafs nodes - are
Screen
s. - Inner nodes - are
ContainerScreen
s. They can contain otherScreen
s orContainerScreen
s in theirnavigationState
. - Root node - is a
RootScreen
. You can have multiply roots in your app. See How to integrate Modo for details.
NavigationState
defines UI- Initial state is defined in constructor of
ContainerScreen
bynavModel: NavModel<State, Action>
- To update state, use
dispatch(action: Action)
onNavigationContainer
, or build-in extension functions for StackScreen and MultiScreen
- Initial state is defined in constructor of
- There are Screen and ContainerScreen
- ContainerScreen can contain and render child screens
- There are some build-in implementation of ContainerScreen like StackScreen and MultiScreen
- You can easily create custom
Action
by extendingAction
orReducerAction
,
MIT License
Copyright (c) Konstantin Tskhovrebov (@terrakok)
and Karenkov Igor (@KarenkovID)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.