squaredev-io / matte

Matte is a UI component library on top of MUI and other react libraries.
https://squaredev-io.github.io/matte/?path=/docs
Apache License 2.0
18 stars 2 forks source link

Provide a way to set an initially active item in Layout's menuList #70

Open awareness481 opened 2 years ago

awareness481 commented 2 years ago

It would be great if we could have a property in menuList, to signify that the item should be active on the first render and should be passed down the .active class. On subsequent renders this should have no effect.

example implementation:

const mainList = [
  {
    routerLink: RouterComponent,
    primary: "Overview",
    to: "/dashboard",
    icon: <DashboardIcon />,
  },
  {
    routerLink: RouterComponent,
    primary: "Shopping",
    to: "/dashboard",
    icon: <ShoppingCartIcon />,
    initiallyActive: true
  }
]

The List component code can be found here