Comment faire un menutem badge pour aligner différemment que par défaut? dans le shinyUI .:badge shinydashboard menuitem
menuItem("Test", tabName = "test", icon = icon("line-chart"),badgeLabel = "2nd", badgeColor = "green")
Exemple complet:
library(shiny)
library(shinydashboard)
# Default shiny
ui <- dashboardPage(
dashboardHeader(title = "Example"),
dashboardSidebar(
sidebarMenu(
menuItem("Test", tabName = "test", icon = icon("line-chart"),
badgeLabel = "2nd", badgeColor = "green")
)),
dashboardBody(
tabItems(
tabItem(tabName = "test",
box(title = "How-to",status = "primary",solidHeader = TRUE,collapsible=TRUE, width = 8,
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30),
# Show a plot of the generated distribution
plotOutput("distPlot")
)
)
)))
# Define server logic required to draw a histogram
server <- function(input, output) {
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
}
# Run the application
shinyApp(ui = ui, server = server)
Dans le navigateur inspectant montre le code suivant /:
<small class="badge pull-right bg-green">2nd</small>
pic test
J'ai besoin:
<small class="badge center-block bg-green">2nd</small>
pic souhaité
Toute idée?
Bienvenue chez SO. S'il vous plaît se référer à [Comment puis-je poser une bonne question?] (Https://stackoverflow.com/help/how-to-ask), spécialement le code Inclure juste assez pour permettre aux autres de reproduire le problème. Pour obtenir de l'aide, lisez [Comment créer un exemple minimal, complet et vérifiable] (https://stackoverflow.com/help/mcve). Cela aidera tout le monde à reproduire le même problème et à vous aider. – rmjoia