aiolias
aiolias

Reputation: 937

Remove line break in textOutput in Shiny Dashboard notification

I created a notification within Shiny dashboard that displays an icon and then the number of users registered in the last day. If I put in dummy text, the icon and the text are aligned on the same 'row'. But if I use renderText to pull the number dynamically, a line break is added after the icon.

Line break in notification

Here's the ui code:

dropdownMenu(type = "notifications",
         notificationItem(text = textOutput("regis")",
           icon("users"))

Here's the server code:

output$regis <- renderText({
  count <- registrationsToday()
  paste(count,"new registrations today.",sep=" ")
  })

I've tried to fix it but can't figure it out. Any ideas?

Upvotes: 0

Views: 1227

Answers (1)

John Patrick Mpindi
John Patrick Mpindi

Reputation: 11

An interim solution to this problem was posted here: https://github.com/rstudio/shinydashboard/issues/21

I tested this and it worked.

notificationItem( text = tags$div(textOutput("regis"),style = "display: inline-block; vertical-align: middle;"), icon("users") )

Hope this helps!

Upvotes: 1

Related Questions