Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Space between the Sidebar Menu Items

I am working on creating a shiny dashboard and I am trying to create space between the different menus of the sidebar. Below is the code I have written so far for the UI.

library(shiny)
require(shinydashboard)
library(ggplot2)
library(dplyr)
library(shiny)
library(shinydashboard)

ui <-  dashboardPage(
  dashboardHeader(),
    dashboardSidebar(
      sidebarMenu(
        menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
        menuItem("Visit-us", icon = icon("send",lib='glyphicon'), 
                 href = "http://www.burgerking.co.nz/"),
        sidebarSearchForm(textId = "searchText", buttonId = "searchButton",
                          label = "Search..."),
        fileInput("file1", "Choose CSV File",
                  accept = c(
                    "text/csv",
                    "text/comma-separated-values,text/plain",
                    ".csv")),
        selectInput(
               "select",
               label = h3("Select Channel"),
               choices = c("All", "a", "b", "c"),
               selectize = TRUE,
               selected = "All")
                 )),
    dashboardBody()
  )

Can someone please help me show how can I add spaces between my menuitems in the side bar panel

like image 447
Tushar Mehta Avatar asked May 12 '26 22:05

Tushar Mehta


1 Answers

In dashboardBody(), add this CSS specification:

tags$head(tags$style(".sidebar-menu li { margin-bottom: 100px; }"))

Change the 100px as needed.

like image 106
Yanir Mor Avatar answered May 14 '26 14:05

Yanir Mor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!