Curating Your Data Science Content on RStudio Connect

This is a companion discussion topic for the original entry at

RStudio Connect is RStudio’s publishing platform that hosts data science content created in R or Python, such as R Markdown documents, Shiny apps, Jupyter Notebooks, and more.

As you publish to RStudio Connect, you will want your audience to have a great experience looking through your work. Released in July 2021, the connectwidgets package helps create a custom view of your content. Your projects will be easier to organize, distribute, and discover.

The connectwidgets package queries your Connect server to get information about your published content items. It turns them into HTML widget components that can be displayed either in an R Markdown document or Shiny app.

Example of gallery created by connectwidgets

The Marketing team at RStudio has several pieces of content published on RStudio’s Connect server. In this blog post, we’ll walk through how we created a project gallery using connectwidgets and R Markdown. View our gallery on!

Want to see connectwidgets in action? Check out Kelly O’Briant’s webinar, Build Your Ideal Showcase of Data Products.

Interested in trying out connectwidgets but don’t have RStudio Connect? Log into this evaluation environment to get access to a test server.

Curate Projects in R Markdown

Let’s begin by loading the connectwidgets package:


Open up a template by going to File, New File, R Markdown, From Template, and then selecting the connectwidgets(HTML) example.

Opening a connectwidgets template

To establish the connection with your RStudio Connect server, add your credentials to your .Renviron file:


In your R Markdown document, pull in your credential information with the function below:

client <- connect(
  # server  = Sys.getenv("CONNECT_SERVER"),
  # api_key = Sys.getenv("CONNECT_API_KEY")

The content() function retrieves items from your RStudio Connect server and stores them in a tibble.

all_content <- client %>%

You can work with the resulting data frame using your usual R tools. For example, you can select items using built-in helper functions or the dplyr package. In this case, we want to filter the dataset to content by certain users:

marketing_content <- all_content %>%
  filter(owner_username %in% c("username1", "username2"))

Organize Your Work With HTML Widgets

The package provides organizational components for card, grid, and table views. Each component links to the associated content item in RStudio Connect.

For each chunk, you can select the components that you want to showcase.

Card View

Cards display your content and associated metadata. You can set the image and the description of your project from the RStudio Connect dashboard.

```{r card}
marketing_content %>%
  filter(name == "specific_item_name") %>%
Connectwidgets card view

Grid View

Grids allow you to place content in side-by-side tiles. Similar to cards, you can display certain pieces of metadata.

```{r grid-shiny}
marketing_content %>%
  filter(app_mode == "shiny") %>%
Connectwidgets grid view

Table View

Would you rather share text? The table component allows you to create a table that shows a fixed set of metadata.

```{r table-plumbertableau}
marketing_content %>%
  filter(stringr::str_detect(name, "seattle_parking")) %>%
Connectwidgets table view

Customize Your Data Science Gallery’s Look

Since connectwidgets is built on R Markdown, you can style your document’s colors and fonts. Here, we use the bslib package to customize our gallery’s appearance:

title: "RStudio Marketing Content Gallery"
  	bg: "#FFFFFF"
  	fg: "#404040"
  	primary: "#4D8DC9"
    	google: "Source Serif Pro"
    	google: "Source Sans Pro"
    	google: "JetBrains Mono"

Add narrative or additional code chunks to give context to your projects.

Publish to RStudio Connect for Easy Access

Once you’re ready, you can publish your document to RStudio Connect.

Publishing to RStudio Connect

RStudio Connect allows you to update the access settings so that you can share your gallery with others. You can also create a custom vanity URL for your work.

Learn More

With RStudio Connect, you can publish your data science projects and also deliver a great experience to your audience.