Using the grid layout

In the next version of the application, we're going to use the fluidRow() function to apply a custom layout to the UI. This function allows you to implement the standard Bootstrap grid layout, as we saw in Chapter 4, Mastering Shiny's UI Functions.

The width of the screen is given as 12 units, and you can pass the column() functions of arbitrary size into a fluidRow() instruction to define a group of widths adding up to 12. In this simple example, we will have three columns in the first row and then one in the second row. The finished application looks like this:

Get Web Application Development with R Using Shiny - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.