shinyMaterialUI provides a wrapper around Material UI, the popular React framework.
Install
remotes::install_github("lgnbhl/shinyMaterialUI")
Example
To quickly get started with any example:
library(shinyMaterialUI)
# all examples available: shinyMaterialUIExample()
shinyMaterialUIExample("showcase")
MUI, the company behind Material UI, made template examples. Using the R package reactRouter, it is possible to reproduce it in R:
shinyMaterialUIExample("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.
Bootstrap conflict
shinyMaterialUI can enter in conflict with the Bootstrap CSS framework, used by default in Shiny functions such as shiny::fluidPage()
and friends.
To normalize the CSS page and be sure the components render correctly, please wrap them in the function CssBaseline()
.
Given Material UI high customization, you can easily fix styling issues using the CSS proprieties using the sx
argument.
To create a Shiny app without Bootstrap, you can use shinyMaterialUI::shinyMaterialUIPage()
.
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/shinyMaterialUI.
For updates follow Felix Luginbuhl on LinkedIn.