Unsuccessful Application of Shiny InfoBox Width Settings

I am attempting to align two shiny InfoBoxes side by side within a fluid row, each taking up half of the full width. Despite specifying a width of 6 (half of bootstrap's 12), the Div Class is displaying as col-sm-4 (#shiny-html-output col-sm-4) and causing the boxes to occupy 2/3 of the width instead (4+4 twelfths).

Additionally, I am interested in directly setting the skin color to orange, rather than the closest option available which is yellow. It seems like I may need to override this with CSS.

library(shiny)
library(shinydashboard)
dashboard_colour <- "orange"

sidebar <- dashboardSidebar(
    sidebarMenu(
        menuItem("Overview", tabName = "overview", icon = icon("dashboard"))
    )
)
body <- dashboardBody(
    tabItems(
        tabItem(tabName = "overview",
                h2("Overview"),
                fluidRow(
                    infoBoxOutput("boxLeft"),
                    infoBoxOutput("boxRight")
                )
        )
    )
)
ui <- dashboardPage(
    skin = "yellow",
    dashboardHeader(title = "Orange Dashboard"),
    sidebar,
    body
)

server <- function(input, output) {
    output$boxLeft <- renderValueBox({
        infoBox(
            123, "No on Left", 
            icon = icon("arrow-alt-circle-left", class = "infoIcon"),
            color = dashboard_colour,
            width = 6
        )
    })
    output$boxRight <- renderValueBox({
        infoBox(
            456, "No on Right", 
            icon = icon("arrow-alt-circle-right", class = "infoIcon"),
            color = dashboard_colour,
            width = 6
        )
    })
}

# Run the application 
shinyApp(ui = ui, server = server)

Answer №1

If I set the infoBoxOutput to a width of 6, it will fulfill the requirement:

    fluidRow(
              infoBoxOutput("boxLeft", width = 6),
              infoBoxOutput("boxRight", width = 6)
            )

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Maximizing space efficiency in Bootstrap 5

Hello there I have a query; I am currently utilizing Bootstrap 5 for my website, and it's working well. However, I would like Bootstrap to fill the entire page instead of just 80%; (Refer to image) https://i.sstatic.net/Iswmu.jpg <head> ...

What is the best way for me to incorporate images retrieved from an API call into my

Hey everyone, this is my first time posting on here so if there's anything I'm missing, please let me know! I've run into an issue with the images on my categories page not aligning properly and being different sizes after I incorporated som ...

Switching the position to fixed causes it to lose its justification functionality

My goal is to create a table using div elements. However, when I set the header to have a fixed position to prevent it from disappearing when scrolling through more data, all the header cells shift to the right. I attempted to adjust the margin-left proper ...

Unable to properly zoom in on an image within an iframe in Internet Explorer and Google Chrome

My image zoom functionality works perfectly on all browsers except for IE and Google Chrome when opened inside an iframe. Strangely, it still functions flawlessly in Firefox. How can I resolve this frustrating issue? The image link was sourced from the i ...

Tips for utilizing browser cache in AJAX requests to prevent loading the refreshed JSON file

It may seem like a strange question, but I'm experiencing an issue with an AJAX call to a JSON file. Both the request and response headers do not indicate to not use cache, and in the browser settings, the Disable cache option is not checked. What mor ...

Tips on adjusting a JavaScript animation function

I'm currently working on adjusting the animation function within the "popup" class that controls the gallery section of a website. When the page loads, an image and background start expanding from zero scale in the center to 100 VIEWPORT HEIGHT (VH) a ...

What is preventing me from clicking on the left side of the link on this CSS flip card while using Chrome browser?

When attempting to click the left side of the link on the back of this flip card in Chrome, it does not respond. However, hovering over the right side allows interaction with the link: /* Vendor prefixed by https://autoprefixer.github.io */ .card { ...

Is it possible to apply a personalized scrollbar design to the Autocomplete Listbox component in Mui?

I am struggling to implement a custom scroll style in Autocomplete Listbox. https://i.sstatic.net/MifSm.png After multiple attempts and thorough research, I have been unsuccessful in achieving the desired result. Here is my most recent code: <Aut ...

Steps for generating unique named polynomial transformation variables

Is there a more efficient way to add polynomial transformations to multiple variables based on continuous data? I can do it manually for individual variables, but how can I automate the process for over 100 variables? dat <- read.table(text = " categor ...

Utilizing a Downloaded Font in CSS: A Step-by-Step

Just starting out here. I have a font file in .ttf format that I want to use on my blog, but I need help with obtaining its code. Am I on the right track? * { font-family: 'providence-bold'; src: url('/font/providence-bold.regular.tt ...

Creating solid, dotted, and dashed lines with basic HTML/CSS for tcpdf rendering

Take a look at the image below. It combines two graphs, with different curves represented by solid lines, dotted lines, and various forms of dashed lines with varying stroke lengths. In summary: I am looking for a simple way to create solid lines, dashed ...

Height of the image is being boosted while the width remains consistent

When working on a responsive page layout, I encountered an issue with increasing the height of an image while keeping the width constant. Modifying the width of the image reflects changes, but adjusting the height does not seem to make any difference. I t ...

Style your toolbar the Google way with CSS and HTML

Trying to replicate the Google-style toolbar found on G-mail and other Google services has been a challenge for me. I have experimented with creating this toolbar using a formatted list and nested div elements within a single container, but I encounter th ...

What is causing the columns in Foundation 6 to not align next to each other?

At 1090px screen width or in tablet mode, the columns do not align side by side and instead one is pushed down creating a white space between them. I am using Foundation 6 with 12 columns, but it does not work well on medium-sized screens; it only function ...

Issue with background image resizing when touched on mobile Chrome due to background-size property set to cover

My current challenge involves setting a background image for a mobile page using a new image specifically designed for mobile devices. The image is set with the property background-size: cover, and it works perfectly on all platforms except for mobile Chro ...

Ways to make an area map more transparent

I'm encountering an issue with HTML opacity... Currently, I've implemented opacity using CSS but it's not functioning correctly. Below is my HTML and CSS code: <area shape ="rect" class="transbox" coords ="0,0,30,22" href ="test1.htm" ...

What is the best method for adjusting height in MaterialUI components?

Is there a way to remove this white line from the image?view image here When I set the height to 100%, it appears like this:view image here ...

Exploring Techniques for Streamlining HTML/CSS Editing in Browser

Is there a way to automatically edit specific lines on websites right after they load? Specifically, I want to change <div class="1"> to <div class="1" style="display:none">, and <div class="2" style ...

Issue with arranging blocks in a horizontal line in Opera

I am currently experiencing an issue with a wide page that contains an information block and numerous images positioned to the right. The layout is designed to be used with a horizontal scrollbar. While this setup works perfectly in Firefox, Safari, Chrom ...

What is the best way to align the menu to the center

Hey there, I'm trying to center a dropdown menu in a 970px wide div. No matter what I do, I can't seem to get it to work correctly. <div id="menuwrapper"> <ul class="menu" id="menu"> <li><a href="#" >Home</ ...