Mandy Norrbo (@MandyNorrbo)
Background in Psychology
Data scientist @ Jumping Rivers
R & Shiny development for clients in a variety of fields
Teach beginner & advanced R programming courses


Difficult to separate as they both feed into each other
Large fields in their own right
HTML: structure
CSS: style
JavaScript: interactivity

Shiny generates HTML, CSS, and JavaScript for you
Can inspect the underlying web technologies using the Developer Tools in browser
Accessibility
Web Content Accessibility Guidelines (WCAG)
Lighthouse report in Chrome Developer Tools
WAVE evaluation browser extension
Accessibility

Accessibility
You can run browser-based reports on Shiny apps
Shiny generates HTML for you
renderPlot now has an alt argument for alternative text
Colors, fonts, contrast etc. can all be modified using CSS
R packages: {shinya11y}, {BrailleR}, {sonify}, {tactileR}
Accessibility
Adding alt text
Generating a Ligthouse report
Fixing issues from Lighthouse report
Accessibility

Feedback to the User
Lack of feedback leaves the user confused
Feedback needs to be both visible and understandable
Response should be proportional to action
Feedback to the User
Buttons, links etc. already give sensible visual feedback (colour change) at clicking/hovering
If e.g. plot fails, will send through R error message
validate()showModal() to display a pop-up modal
withProgress() to show progress bar
showNotification() to display a notification
Feedback to the User
{shinycssloaders} to add loading spinners to individual elements
{waiter} to add loading screen for entire app
{tippy} to add tooltip pop-up message
Feedback to the User

Feedback to the User

Feedback to the User

Feedback to the User
Feedback to the User
Users generally want to navigate a product without resorting to documentation
Any help should be easy to locate and focused on the users’ current task
ℹ️ Where might your user get stuck?
ℹ️ What questions might your user ask?
Help and Documentation
Include a “Help” or “How to Use” tab
Provide enough context for any included visualisations
Consider who the user is, and what their knowledge of the subject/content will be
User testing: how does a user interact with the app

Help and Documentation
{cicerone} to create guided tours of Shiny applications
{shinyhelper} for adding help next to certain inputs
{faq} to create a Frequently Asked Questions component
Help and Documentation

Help and Documentation

Help and Documentation

Help and Documentation
Help and Documentation
Responsive web design is about creating web pages that look good on all devices
Users might be accessing your app with a laptop, a tablet, or their phone
A responsive web design will automatically adjust for different screen sizes and viewports
Responsive Design

Responsive Design
Default layout fluidPage should resize with window
Avoid hard coding widths and heights in centimetres or inches
Responsive Design
Responsive Design
Responsive Design
Hierarchy and Chronology
Hierarchy and Chronology
Hierarchy and Chronology
navBarPage()
Hierarchy and Chronology
Hierarchy and Chronology
Less is More
Less is More
Less is More
Less is More
Don’t worry about meeting all these principles from the get go
Development is an iterative process, and you can always keep improving your app
Also, to even worry about the user interface and user experience, you will need to have users first!
Twitter: @MandyNorrbo
LinkedIn: Mandy Norrbo
GitHub: mnorrbo
Slides: mnorrbo.github.io/uiux-shiny