You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to shiny-...@googlegroups.com
Hello,
Is it possibly to control the title color of a tab generated by tabPanel() ? I mean a control inside the Shiny app (actually I'd like for example a red title which becomes blue once the user has visited this tab).
Kirill Savin
unread,
Sep 26, 2013, 10:02:17 PM9/26/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to shiny-...@googlegroups.com
Doable with CSS and JavaScript. Tab headers are links and can be selected with <a> tag. Try adding tags$style(type = "text/css", "a{color: #f50000;}") to your ui.R to paint tab text in red. This would change all links in your app to red. To avoid that, use "li a{color: #f50000;}" instead a:visited pseudo selector wouldn't work on tab links, so you'll probably have to resort to JavaScript to highlight visited tabs.
laurent stephane
unread,
Sep 27, 2013, 1:16:43 PM9/27/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to shiny-...@googlegroups.com, laurent stephane
If you place an url anywhere in your application it will also turn red. If you want to avoid that, change your CSS selector to "li a" to select only those links that are nested inside a list (li). Here is HTML code of tab headers: <ul class="nav nav-tabs"> <li class="active"> <a data-toggle="tab" href="#tab-7629-1">One</a> </li> <li> <a data-toggle="tab" href="#tab-7629-2">Two</a> </li> <li> <a data-toggle="tab" href="#tab-7629-3">Three</a> </li> </ul>
Stéphane Laurent
unread,
Sep 27, 2013, 2:11:07 PM9/27/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to shiny-...@googlegroups.com
Aahh OK ! When you said "link", I was under the impression you were talking about "tab links". Thanks !
So finally, changing only the color title of one interactively specified tab is not so easy.
Paul de Barros
unread,
Jan 6, 2016, 5:28:55 PM1/6/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Shiny - Web Framework for R
This is something I have been working on myself, and stumbled across this conversation while doing research. I made a modified version of tabsetPanel that allows setting colors of all the tabs. It doesn't quite do what you are looking for, but it might get you closer.
For setting the color of all visited tabs, you would probably want to create reactive variables that keep track, for each tab, whether the tab has been visited once. You can then use the reactive variables in the code for tabsetPanel 2 to specify the colors. However, that might cause the entire tabsetPanel to rebuild itself every time you click on a tab.