M
M
Magny resources
Search…
⌃K

Links and actions

When a link command is clicked or executed, it navigates the user to a new page in your app.
There are 3 different types of routing for you to be able to navigate your client in different ways.
When someone clicks or selects on the command, the browser will open the link in the current window or tab.
For example, you can set link input as https://magny.io/. This will open the defined link on the same page. When creating your link command, make sure you click on the Open link in the same tab checkbox.
When someone clicks or selects on the command, it will open up in a new tab, or possibly a new window depending on the person’s browser settings.
For example, you can set link input as https://magny.io/ . This allows you to open the link in a new tab. In this case make sure you untick the Open link in the same tab checkbox.
This option will be used to route within an ap, without refreshing whole page. If you already have a routing system and you want to integrate with Magny you can pass your routing function as a navigate props in Magny component.
As an example, you want to set a link input as /home. That will you allow to navigate with your navigate function. When creating your link command make sure you first enable the Open link in the same tab checkbox.
Then, to integrate your routing function with Magny you can use the example code bellow.
import { Magny } from 'magny';
import { useNavigate } from "react-router-dom";
function MyComponent() {
const navigate = useNavigate();
return (
<Magny projectId="<project-id>" navigate={navigate} />
// ...
You can also use this feature in your context commands. For this, you can have a look at the Using context hooks section for more information.