Skip to main content


power navigation


In Jetpack Compose navigation is only possible from composable itself, but in reality ViewModel has to decide:

  • where to go,
  • when to go,
  • how to go(arguments, etc.).

Also we can should not pass NavHostController like things in ViewModel.

PowerNavigation allows you to control

  • any type of navigation scenario
  • direct from ViewModel
  • without breaking any best practices or recommendations.


Inside your viewModel which already inherited from WirelessViewModel has the access of pownav.

pownav.scope { navHostController, lifecycleOwner, toaster ->

Inside the pownav.scope you have the navHostController so you can call any navigation api.

That is it, extremely simple with huge power and no bad practices.


You may have already noticed that the pownav.scope block provide a toaster as well. With this you can show toast.

toaster?.toast("Hello") // short toast by default
toaster?.toast("Hello", Toast.LENGTH_LONG) // long toast