This repo shows how to implement Ionic Nav in SvelteKit.
Implementing Ionic Nav requires a bit of deviation from the the Ionic API docs. Not too much, but just a bit.
Want to dive into an example? Use the link below to the code-sandbox. After opening the link, please pop-up the render window to see the results.
https://stackblitz.com/github/Tommertom/ionic-svelte-nav-howto
So, you can also clone this repo:
npx degit https://github.com/Tommertom/ionic-svelte-nav-howto ionic-nav
Best is just to look at the sample code in route /nav
+page.svelte
$lib
the NavHome which does the pushing of content (overview->detail)NavHome
pushes child/detail views with the props using the navController
push
method. It can simply import the component and pass it to the push
methodprops
to it, which gets passed to the componention-backbutton
for popping the view using the default animationion-backbutton
has a default-href
, otherwise it won't showSee code in +page.svelte
. For the rest, navController
has the same methods as ion-nav
- https://ionicframework.com/docs/api/nav
Create component for <ion-nav-link>