Fluent and Shiny: Build Beautiful Shiny Apps Using Microsoft’s Fluent UI
- Why Is A Good UI Important
- What Is shiny.fluent and shiny.react
- useR! 2021 Presentation: Build Beautiful Shiny Apps Using Microsoft’s Fluent UI
- Q&A From Marek’s Presentation at UseR! 2021
- useR! 2021 Follow Up
Why Is a Good UI Important
User Interface (UI) consists of features a user interacts with on your app. Without an intuitive, good-looking UI, the User Experience (UX) falls flat, potentially failing in widespread adoption or limited user interaction. When designing the UI, consider what your users are familiar with. You can create a more comfortable UX and ease of use within the app by using common UI elements. If designing a dashboard for a company that uses Microsoft products, Microsoft’s Fluent UI should be at the top of the list for consideration.
What is shiny.fluent and shiny.react
shiny.fluent and shiny.react are open-source R packages from Appsilon that were released in June 2021. shiny.react allows the porting of React libraries in Shiny and shiny.fluent brings MS Fluent to Shiny. You can read more in the release announcement here.
The shiny.react package enables using React in Shiny apps and is used by the shiny.fluent package. It contains R and JS code which is independent of the React library (e.g. Fluent UI) that is being wrapped. shiny.react lets you easily use React libraries in Shiny and opens a wealth of other libraries designed by huge teams of UX designers and developers.
The shiny.fluent package enables the use of Microsoft’s Fluent UI in Shiny. This allows your apps to have a beautiful and professional look and a rich set of easy-to-use components in Shiny, all while retaining the fast speed of development that Shiny is famous for.
Interested in learning how to implement MS Fluent UI in your Shiny app? Check out our video tutorial on how to Build Beautiful Shiny Apps with shiny.fluent
useR! 2021 Presentation: Build Beautiful Shiny Apps Using Microsoft’s Fluent UI
by Marek Rogala
In this talk we will present the functionality and ideas behind a new open-source package we have developed called shiny.fluent.
UI plays a huge role in the success of Shiny projects. shiny.fluent enables you to build Shiny apps in a novel way using Microsoft’s Fluent UI as the UI foundation. It gives your app a beautiful, professional look and a rich set of components while retaining the speed of development that Shiny is famous for.
During the talk, we will demonstrate how to use shiny.fluent to build your own Shiny apps and explain how we solved the main challenges in integrating React and Shiny.
Q&A From Marek’s shiny.fluent and shiny.react Presentation
Q: React is a powerful and fast library mainly due to the virtual DOM. Are the benefits of Virtual DOM carried to shiny.react as well? Or just the React components that are accessible through shiny.react?
A: Yes and no.
If you use our specialized reactOutput/renderReact functions (which are more powerful but not mandatory replacement for uiOutput/renderUI), changes to components will render in place and only parts that changed will get replaced in DOM thanks to virtual DOM. The same works if you use updateInput functions. If you use regular uiOutput, you don’t get the full benefits of virtual DOM, because Shiny removes the components from DOM.
It’s true that one of React’s strengths is virtual DOM, the same goes for shiny.fluent/react. But huge strengths are also found in its overall design based on functional programming principles and the richness of the ecosystem. This abundance of libraries is, from our perspective, the key strength when using it in Shiny. In practice, we don’t yet see huge performance speedups over regular Shiny, but we see great apps achieved in a shorter development time.
Q: What do you think are the advantages of developing Shiny apps?
A: In our experience, one of the biggest strengths of Shiny is the speed of development – more than once we’ve rolled out an MVP of an application in 1 or 2 days. This means you can iterate super fast and gather feedback from users and incorporate it into the app in super short cycles. You can build a functional prototype much faster than you could do in typical web development technologies.
And then you can decide whether to migrate or stay in R. Another nice strength is the R language and packages which make it super convenient to work with data. It’s also very helpful to stay in R when you have a team of data scientists working in R already, to save your “engineering tokens”.
Q: After the MVP is up and running, what are some factors to consider when deciding to stick with Shiny or move to more typical web development technologies?
A: Factors to consider:
- Product roadmap – features that we can predict will be needed (some features are a perfect fit for Shiny, while some take more time to implement than in other technologies)
- How resource heavy is the app
- Predicted number of users
- Desired complexity of the UI (for highly advanced UI it may not make sense to make Shiny work together with React, instead go, for example, wholly with React)
- Special client requirements
In short, we default to Shiny because usually, it’s a great fit for the types of applications we work on. And we look if any of the points like the ones above, give us red flags that this is a use case where Shiny may be a bigger cost, long-term.
Q: Is this dependent on Windows?
A: No. Personally, I was using this on MacOS and Linux, and it runs for example on shinyapps.io
Q: Is there a plan to bring this to CRAN?
A: Yes, we plan to bring shiny.fluent to CRAN – the submission for shiny.react is already in progress.
useR! 2021 Follow Up
Thank you to the 1800+ members who joined the Appsilon channel and to those who participated in Marek’s presentation channel. This year’s conference was filled with informative talks and impressive keynote speakers. Appsilon is proud of our team members that gave non-sponsored talks and we are honored to help support the global R community as a platinum sponsor of useR! 2021. We are excited to see what innovations grow from the R community’s experience at useR!.
We Need Your Help!
At Appsilon our Tech Team Members regularly contribute to open-source packages as part of our commitment to positively impacting the world through technology. If you find our packages useful, please consider dropping a star on your favorite shiny packages at our Github. It helps let us know we’re on the right track.
And if you have any comments or questions swing by our feedback threads like the ongoing discussion at our new shiny.fluent package, we love to hear from the community. If you spot an issue or room for improvement please feel free to send a pull request.
Interested in working with the leading experts in Shiny? Appsilon is looking for creative thinkers around the globe. We’re a remote-first company, with team members in 7+ countries. Our team members are leaders in the R dev community and we take our core purpose seriously.
Advance technology to preserve and improve human life #purpose
We promote an inclusive work environment and strive to create a friendly team with a diverse set of skills. Contact us and see what it’s like to work on groundbreaking projects with Fortune 500 companies, NGOs, and non-profit organizations.
Appsilon is hiring for remote roles! See our Careers page for all open positions, including a React Developer and R Shiny Developers. Join Appsilon and work on groundbreaking projects with the world’s most influential Fortune 500 companies.