You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a {shiny} app I'm working on, we're trying to stick to using Bootstrap icons over e.g. font-awesome, for consistency. I've noticed that it isn't possible to pass to bsicons::bs_icon() directly to the icon argument of nav_panel(). This is because the internal prepTabIcon() function checks that the icon is a shiny.tag, which bs_icon()s are not.
There is a fairly easy workaround with wrapping it like tags$i(bsicons::bs_icon()), but I think if its possible and easy to implement, allowing bsicons::bs_icon() to be used as a drop-in replacement for shiny::icon() would be useful, especially as the tags$i() workaround isn't immediately obvious (or at least wasn't to me). Thanks!
Minimal example - throws an error when creating the UI:
library(shiny)
library(bslib)
library(bsicons)
ui <- fluidPage(
page_fluid(
navset_tab(
nav_panel(
title = "First",
icon = bs_icon("gear") # icon("gear") would work here
)
)
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
The text was updated successfully, but these errors were encountered:
In a {shiny} app I'm working on, we're trying to stick to using Bootstrap icons over e.g. font-awesome, for consistency. I've noticed that it isn't possible to pass to
bsicons::bs_icon()
directly to theicon
argument ofnav_panel()
. This is because the internalprepTabIcon()
function checks that the icon is ashiny.tag
, whichbs_icon()
s are not.There is a fairly easy workaround with wrapping it like
tags$i(bsicons::bs_icon())
, but I think if its possible and easy to implement, allowingbsicons::bs_icon()
to be used as a drop-in replacement forshiny::icon()
would be useful, especially as thetags$i()
workaround isn't immediately obvious (or at least wasn't to me). Thanks!Minimal example - throws an error when creating the UI:
The text was updated successfully, but these errors were encountered: