Navigation
This allows micro-frontends to redirect users to different routes managed by the shell without direct access to the shell's router.
Client applications can request navigation within the shell application.
How It Works
Client calls
navigate({ path: '/target-path' })Request is sent to shell via framebus
Shell executes navigation using its router
URL changes and appropriate content is rendered
Basic Usage
Use the navigate function from useAppClient:
import { useAppClient } from '@akinon/app-client';
const NavigationExample = () => {
const { navigate } = useAppClient();
return (
<div>
<button onClick={() => navigate({ path: '/dashboard' })}>
Dashboard
</button>
<button onClick={() => navigate({ path: '/orders' })}>
Orders
</button>
<button onClick={() => navigate({ path: '/settings' })}>
Settings
</button>
</div>
);
};Navigation Payload
path
string
Target path to navigate to (should start with /)
external
boolean
If true, navigates at shell level instead of extension level
Navigation Examples
Simple Navigation
With Query Parameters
Dynamic Routes
Shell-Level Navigation
Navigate to shell routes (outside extension scope):
Navigation from Rich Modals
When you call navigate() from within a rich modal, the shell automatically:
Navigates the parent client
Closes the modal
To navigate within a rich modal without closing it, use your own routing logic (e.g., React Router).
Client-Side Navigation
For fullpage applications, you can also configure internal navigation:
When the shell triggers NAVIGATE_CHILD event, your navigation.navigate function is called.
Programmatic Navigation Patterns
After Form Submission
Conditional Navigation
Navigation with Confirmation
Best Practices
1. Use Meaningful Paths
2. Handle Navigation Errors
3. Avoid Navigation on Mount
Don't navigate immediately on component mount - let the user interact first:
Next Steps
Actions - Invoke shell actions
Hooks - Complete useAppClient reference
Last updated
Was this helpful?

