muiMaterial gives access to the popular Material UI React library from R.
It helps you:
- Develop fully customizable Shiny dashboards:
- The underlying UI components (e.g., cards, buttons, navbars, etc) can be used in any Shiny app.
- Create static dashboards using the reactRouter R package:
- Use a router to create dashboards without a server.
- Create advanced apps using MUI’s specialized React libraires:
Example
The quickest way to try muiMaterial is to launch the demo app of a basic MUI dashboard (code here).
muiMaterial::muiMaterialExample("dashboard-simple")A more advanced demo replicating an official template created by MUI (the company behind Material UI).
muiMaterial::muiMaterialExample("mui-template-dashboard")Shiny inputs wrappers
To use Material UI components as Shiny inputs, the package provides *.shinyInput wrappers functions (for more info read this article from the shiny.react documentation).
For example, to use the Button component with Shiny, you should use Button.shinyInput() instead.
Explore available Shiny inputs by running the “showcase” Shiny app (examples code are here):
# all examples available: muiMaterialExample()
muiMaterial::muiMaterialExample("showcase")Bootstrap conflict
muiMaterial can enter in conflict with the Bootstrap CSS framework, used by default in Shiny functions such as shiny::fluidPage() and friends.
To create a Shiny app without Bootstrap, you can use muiMaterialPage().
To normalize the CSS page and ensure components render correctly, please wrap them in the CssBaseline() function.
Given Material UI high customization, you can easily fix styling issues using the CSS proprieties using the sx argument.
Contribute
If you have any issue, question or want to contribute with a pull request, don’t hesitate to write me on https://github.com/lgnbhl/muiMaterial.
For updates follow Felix Luginbuhl on LinkedIn.
