ECOSYSTEM / ROUTER
Reference
Every public name of janelkit-router.
Ecosystem package
janelkit-router Navigation between screens: page stacks that keep their state, parallel sections, results with await and transitions. pip install janelkit-routerAlpha / 0.2 — These pages document JanelKit 0.2 and its packages. Each series (0.1, 0.2…) may change the public API, always with migration notes: see Changes and migration. The website uses Svelte; the desktop examples use Python and JanelKit, not JavaScript.
Public names
Import them from janelkit_router. pages, sections and navigation are called during the setup of a component, like on_mount.
| Name | Description |
|---|---|
| pages | nav = pages(Home, **props) creates a page stack that starts with Home, an imported component. |
| PageStack | The type of pages(): push(C, **props_and_on_events) (awaitable: await returns the value of back(value)), pop(), back(value=None), replace(...), reset(...) (the four are awaitable: True if the page was left, False if a before_leave refused); reactive current, depth and can_go_back; page, the visible instance. |
| navigation | nav = navigation() in the script of a page, or of a component inside it, returns its stack. |
| sections | areas = sections(a=A, b=B) creates parallel sections, each with its own stack. |
| SectionSet | The type of sections(): show(name), [name] (its stack), stack (the visible one’s), names; reactive current. |
| <Pages stack={nav} /> | Shows the top page. Accepts transition: and the common properties (flex, width, class…). |
| <Sections of={areas} /> | Shows the visible section. Same as <Pages>. |
English documentation based on the JanelKit source. For additional details, browse the source docs ↗.