mui / toolpad

Toolpad: Full stack components and low-code builder for dashboards and internal apps.
https://mui.com/toolpad/
MIT License
964 stars 243 forks source link

Support navigating pages from the code #1597

Open yaredtsy opened 1 year ago

yaredtsy commented 1 year ago

I am trying to make a simple login page. and is there a way to navigate pages from the code?

if(username.value==="admin")
{
  // naviagte to page1
}

link: https://demo.toolpad.io/_toolpad/app/cld06iouh01jupc7byglpysen/pages/tc03qqz

prakhargupta1 commented 1 year ago

Hi @yaredtsy Apologies for responding late.

Navigating to a different page is currently supported from onCLick event handler prop of the Button component.

Screenshot 2023-04-18 at 9 30 07 AM

We'll support adding a navigation condition where you'll be able to write JS code. This will be available as a binding in this UI. It will help us design it better if you could tell us more about what are you trying to build. Thanks!