Skip to content

[Bug]: Tab does not seem to recognize Icon property correctly #98

Open
@mviertel

Description

@mviertel

Guidelines

  • I agree to follow this project's Contributing Guidelines.

Project Version

No response

Platform and OS Version

No response

Existing Issues

No response

What happened?

Icons dont seem to render properly. Using the example from the showcase, different ways of adding icons don´t lead to success. See a working example below. I also added a navbar with buttons to show that the icons where defined correctly.

`library(shiny)
library(shiny.blueprint)

ui_mod <- function(id) {
ns <- NS(id)

reactOutput(ns("tabs"))
}

server_mod <- function(id) {
moduleServer(id, function(input, output, session) {
ns <- session$ns

currentTab <- reactiveVal("react")
observeEvent(input$selectTab, currentTab(input$selectTab))
output$tabs <- renderReact(
  tagList(
    Tabs(
      selectedTabId = currentTab(),
      onChange = setInput(ns("selectTab")),
      Tab(id = "angular", title = "Angular", panel = "Angular",icon('bolt-lightning')),
      Tab(id = "ember", title = "Ember", panel = "Ember",icon = tags$i(class = "fa-solid fa-triangle-exclamation")),
      Tab(id = "react", title = "React", panel = "React", icon = 'home'),
      TabsExpander(),
      tags$input(class = "bp4-input", type = "text", placeholder = "Search...")
    ),
    shiny.blueprint::Navbar(
      shiny.blueprint::NavbarGroup(
        shiny.blueprint::NavbarHeading("Supply"),
        shiny.blueprint::NavbarDivider(),
        shiny.blueprint::Button.shinyInput(
          inputId = ns('nav_angular'),
          minimal = TRUE,
          icon = icon('bolt-lightning'),
          text = "Angular"
        ),
        shiny.blueprint::Button.shinyInput(
          inputId = ns('nav_ember'),
          minimal = TRUE,
          icon = tags$i(class = "fa-solid fa-triangle-exclamation"),
          text = "Availability"
        ),
        shiny.blueprint::Button.shinyInput(
          inputId = ns('na_react'),
          minimal = TRUE,
          icon = 'home',
          text = "React"
        )


      )
    )
  )

)

})
}

Define UI for application that draws a histogram

ui <- fluidPage(

ui_mod('test')

)

Define server logic required to draw a histogram

server <- function(input, output) {

server_mod('test')

}

Run the application

shinyApp(ui = ui, server = server)`

Steps to reproduce

...

Expected behavior

Icons to render

Attachments

No response

Screenshots or Videos

Screenshot 2024-03-18 082149

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions