RL_Pug
RL_Pug

Reputation: 877

Adding a line break or 3rd line of text in Rshiny valuebox?

I'm trying to create a valuebox but my problem is that the subtitle text is too long.

Here is my code

```{r}
valueBox(12, 
         paste('Number of Cars',':','City','is Chicago'))
```

enter image description here

But my Goal would be something like this

enter image description here

I tried using "\n" but it didn't work.

Upvotes: 1

Views: 1226

Answers (1)

Daniel_j_iii
Daniel_j_iii

Reputation: 3252

I used paste0() instead, I was able to do this using HTML linebreak code <br>. I think it might depend if you are using flexdashboard, or shiny. But this should help hopefully.

---
title: "Old Faithful Eruptions"
output: flexdashboard::flex_dashboard
runtime: shiny
---

```{r}
flexdashboard::valueBox(42, paste0('Number of Cars',':','<br>','City ','is Chicago'))
```

enter image description here

Upvotes: 2

Related Questions