hrefTab
creates a small section of link buttons
hrefTab(
label_texts,
hrefs,
Id = NULL,
title = "A list of tabs",
title_color = "#0275d8",
bg_colors = "#337ab7",
text_colors = "white",
target_blank = FALSE,
...
)
individual tab labels
individual tab links
optional element ID
element title
title color
individual tab button background color, either 1 value to apply for all of them or specify for each of them in a vector
individual tab button text color, either 1 value to apply for all of them or specify for each of them in a vector
bool, whether to add target="_blank"
to the link?
other arguments to be passed to the html element
a Shiny component
label_texts
, hrefs
must be the same length
If more than one value is provided for bg_colors
or/and text_colors
,
the length of these 2 vectors must be the same as label_texts
Use ""
to occupy the space if you do not want a label contains a link,
e.g hrefs = c("https://google.com/", "", "")
If a label does not have a link, you cannot click it and there is no hovering effects.
if(interactive()){
ui <- fluidPage(
hrefTab(
title = "Default",
label_texts = c("Bar Plot", "PCA Plot", "Scatter Plot"),
hrefs = c("https://google.com/", "", "")
),
hrefTab(
title = "Different background",
label_texts = c("Bar Plot", "PCA Plot", "Scatter Plot"),
hrefs = c("https://google.com/", "", ""),
bg_colors = c("#eee", "orange", "green")
),
hrefTab(
title = "Different background and text colors",
label_texts = c("Bar Plot", "Disabled", "Scatter Plot"),
hrefs = c("https://google.com/", "", ""),
bg_colors = c("green", "#eee", "orange"),
text_colors = c("#caffc1", "black", "blue")
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
}