I trying to reduce the top margin of checkboxinput because is diferente than anothers inputs, as you can see in the first menutitem, even when I define a top margin equal to 0px. The solution that I found was define a negative top margin, but when I define it and the checkbox is hiden the actionLink top margin reduce.
Can anyone solve this problem???
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
menuItem("teste",
textInput("text","Text"),
uiOutput("check_box_out",style="margin-left: 16px;margin- top:0px;margin-bottom:16px"),
actionLink("button", "Show checkbox",style="margin-left: 16px;margin-top:16px;margin-bottom:16px")),
menuItem("teste2",
textInput("text2","Text2"),
uiOutput("check_box_out2",style="margin-left: 16px;margin-top:-20px;margin-bottom:16px"),
actionLink("button22", "Show checkbox2",style="margin-left: 16px;margin-top:16px;margin-bottom:16px"))
),
dashboardBody())
server <- function(input, output, session) {
observe({
observeEvent(input$button,{
output$check_box_out <- renderUI({
checkboxInput("check_box","checkboxinput",value = F)
})
})
observeEvent(input$button22,{
output$check_box_out2 <- renderUI({
checkboxInput("check_box2","checkboxinput2",value = F)
})
})
})
}
shinyApp(ui= ui, server = server)