Pass Arguments & Deep Links
Move data between destinations safely.
Pass Arguments & Deep Links is a free Kotlin Multiplatform Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Kotlin Multiplatform Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Screens Need Data
A details screen has to know which item to show. Arguments are how one screen tells the next exactly what to display. 📦
Put the Value in the Route
You declare a placeholder right inside the route string. Curly braces mark where a value will be slotted in.
composable("details/{itemId}") { entry ->
DetailsScreen(entry)
}Read the Argument
Inside the destination you pull the value from the back stack entry. It arrives as a string you can use right away.
val itemId = entry.arguments?.getString("itemId")Pass a Value When Navigating
To send data you simply build the real route with your value inside it, then navigate to that string.
navController.navigate("details/42")Type-Safe Arguments
You can declare an argument as an Int instead of a string, so the framework parses and validates it for you.
composable(
"details/{itemId}",
arguments = listOf(navArgument("itemId") { type = NavType.IntType })
) { /* ... */ }Optional Query Arguments
Some values are optional, like a search filter. You add them as query parameters after a question mark in the route.
navController.navigate("search?query=kotlin")What Is a Deep Link
A deep link is a URL that opens a specific screen directly, even from outside the app. It maps a link to a route.
Register a Deep Link
You attach a deepLink pattern to a destination. When that URL arrives, navigation jumps straight to this screen.
composable(
"details/{itemId}",
deepLinks = listOf(navDeepLink { uriPattern = "myapp://details/{itemId}" })
) { /* ... */ }Deep Links Carry Arguments Too
The same placeholders work in a deep link URL. The itemId from the link lands in your back stack entry like any argument.
Platforms Wire Links Differently
Android and iOS each register your URL scheme in their own config, but both then hand the link to the shared graph. 🔗
Keep Arguments Small
Pass an id, not a whole object. Let the destination load its own data from the id, so routes stay tiny and reliable.
Quick Check
How should you typically send a complex object to the next screen?
Recap: Data and Direct Links
You sent arguments through routes, read them on the next screen, and mapped a deep link URL straight to a destination. 🎯
Frequently asked questions
Is the “Pass Arguments & Deep Links” lesson free?
Yes — the full text of “Pass Arguments & Deep Links” is free to read here on the web, and the Kotlin Multiplatform Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Kotlin Multiplatform Academy course, upgrade to CoddyKit PRO.
What will I learn in “Pass Arguments & Deep Links”?
Move data between destinations safely. You practise Kotlin Multiplatform Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Kotlin Multiplatform Academy?
No prior experience is required. Kotlin Multiplatform Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Pass Arguments & Deep Links” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Kotlin Multiplatform Academy lesson?
Yes. Every Kotlin Multiplatform Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Navigate Between Shared Screens
- Pass Arguments & Deep Links
- Shared Images, Fonts & Strings
- Localize Shared UI Text