hrefTab {spsComps} | R Documentation |
Display a list of links in a row of buttons
Description
hrefTab
creates a small section of link buttons
Usage
hrefTab(
label_texts,
hrefs,
Id = NULL,
title = "A list of tabs",
title_color = "#0275d8",
bg_colors = "#337ab7",
text_colors = "white",
target_blank = FALSE,
...
)
Arguments
label_texts |
individual tab labels |
hrefs |
individual tab links |
Id |
optional element ID |
title |
element title |
title_color |
title color |
bg_colors |
individual tab button background color, either 1 value to apply for all of them or specify for each of them in a vector |
text_colors |
individual tab button text color, either 1 value to apply for all of them or specify for each of them in a vector |
target_blank |
bool, whether to add |
... |
other arguments to be passed to the html element |
Details
-
label_texts
,hrefs
must be the same length If more than one value is provided for
bg_colors
or/andtext_colors
, the length of these 2 vectors must be the same aslabel_texts
Use
""
to occupy the space if you do not want a label contains a link, e.ghrefs = c("https://google.com/", "", "")
If a label does not have a link, you cannot click it and there is no hovering effects.
Value
a Shiny component
Examples
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)
}