From the course: Building Data Apps with R and Shiny: Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

What belongs in the ui.R file?

What belongs in the ui.R file?

From the course: Building Data Apps with R and Shiny: Essential Training

Start my 1-month free trial

What belongs in the ui.R file?

- [Instructor] The ui.R file defines the user experience or UX for your Shiny app. It's where all of the things that the user will see are placed. It's often referred to as the client-side of the Shiny app as opposed to the server-side of the app, which is contained within the server.R file. Let's be explicit about what belongs in the ui.R file. The client-side of the app is where you place the controls your users will use. Shiny has a wide range of built-in controls including sliders, pull-down menus, check boxes, and many more. For technical reasons, we call these input widgets. If you're customizing the appearance of your Shiny app with HTML, CSS, or JavaScript, then you must load these files in the ui.R file, as otherwise, your styles will not be applied to the client-side of the app. Similarly, if you're using packages that contain their own HTML, CSS, or JavaScript, then you must load the package in both server.R and ui.R. This is very important when working with htmlwidget…

Contents