Provider for easier handling routing.

The <RouterProvider> is a component from react-aria-components which we expose to give you something on the hand to handle your routes in your application. It can be used to handle your routes if you use Next.js or the React Router.



To import the component you just have to use this code below.

import { RouterProvider } from '@marigold/components';


childrenReactNodenoneThe children of the component.
navigate(path: string) => voidnoneSet the recived paths where you want to navigate.


React Router

You can use the provider with the useNavigate hook from react-router-dom. The outcome from the function you can pass into the navigate prop from the <RouterProvider>.

If you want to read more about it visit react arias documentation about it here.


Similar to React Router you can pass in the navigate prop the routes you get from the useRouter hook.

Also for more information please visit react arias documentation about it here.