Coder Social home page Coder Social logo

Add sidebarUserPanel about semantic.dashboard HOT 1 CLOSED

osenan avatar osenan commented on June 27, 2024
Add sidebarUserPanel

from semantic.dashboard.

Comments (1)

osenan avatar osenan commented on June 27, 2024

WIP branch sidebar_user_panel contains a first iteration fo semantic.dashboard sidebar_user_panel

Right now the function allows for an image, title and subtitle. It is using Fomantic UI css to format the user image circularly. An addition to this function is that the user can control the size of the image with the argument image_size using different Fomantic UI image sizes. Additionally, there is a modification sidebar_menu for correctly allowing the sidebar_user_panel to have html content.

This is an example app with the new function (assuming you are working with siderbar_user_panel branch:

devtools::load_all("../semantic.dashboard")
library(shiny)


header <- dashboardHeader()

sidebar <- dashboardSidebar(
  sidebar_user_panel("User Name",
                   subtitle = a(href = "#", icon("circle", class = "text-success"), "Online"),
                   # Image file should be in www/ subdir
                   image = "lucaturilli.jpeg", image_size = "mini"
  ),
  sidebarMenu(
    # Setting id makes input$tabs give the tabName of currently-selected tab
    menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
    menuItem("Widgets", icon = icon("th"), tabName = "widgets"),
    menuItem("Charts", icon = icon("bar-chart-o"),
             menuSubItem("Sub-item 1", tabName = "subitem1"),
             menuSubItem("Sub-item 2", tabName = "subitem2")
    )
  )
)

body <- dashboardBody(
  tabItems(
    tabItem("dashboard",
            div(p("Dashboard tab content"))
    ),
    tabItem("widgets",
            "Widgets tab content"
    ),
    tabItem("subitem1",
            "Sub-item 1 tab content"
    ),
    tabItem("subitem2",
            "Sub-item 2 tab content"
    )
  )
)

shinyApp(
  ui = dashboardPage(header, sidebar, body),
  server = function(input, output) { }
)

Again, it is recommended for developing to create a www subfolder and fill the image parameter to visualize how the user image is styled.

The next step would be to improve the styling so that the new sidebar_user_panel has correct margin from the border of the sidebar. After this is done, we need to add documentation, examples and modify the NAMESPACE.

from semantic.dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.