Put the tab in the Shiny tabsetPanel over on the right side

Is it possible to have tabs on both the left and right sides of a tabsetPanel? For example, one tab on the right while others remain on the left, creating a layout like the one below:

https://i.sstatic.net/oTZgH.png

library(shiny)

ui <- fluidPage(
  tabsetPanel(
    tabPanel("tab_left1"),
    tabPanel("tab_left2"),
    tabPanel("tab_right")
  )
)

server <- function(input, output, session) {}

shinyApp(ui, server)

Answer №1

Utilizing the float-right attribute should solve the issue. The drawback of employing two tabsetPanel structures is that both tabs remain active simultaneously.

library(shiny)

ui <- fluidPage(
  tags$head(
    tags$style(HTML(
      ".tabbable ul li:nth-child(3) { float: right; }"
    ))
  ),
  tabsetPanel(
    tabPanel("tab_left1"),
    tabPanel("tab_left2"),
    tabPanel("tab_right")
  )
)

server <- function(input, output, session) {}

shinyApp(ui, server)

https://i.sstatic.net/dzVaV.jpg

Answer №2

Perhaps you could experiment with creating 2 tabsetPanel elements and positioning one to the right?

rm(list = ls())
library(shiny)
ui <- fluidPage(
  div(style="display:inline-block",tabsetPanel(type = c("pills"),tabPanel("tab_left1"),tabPanel("tab_left2"))),
  div(style="display:inline-block;float: right",tabsetPanel(type = c("pills"),tabPanel("tab_right")))
)

server <- function(input, output, session) {}

shinyApp(ui, server)

https://i.sstatic.net/6Zlum.jpg

Answer №3

To achieve the desired effect of elements floating to the right, simply add the class float-right to those specific elements.

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

What is the process for dividing an element in a matrix by the first element in its row using R/Python?

Is there a way to separate each item in a matrix by the initial item in its respective row? ...

Why is Bootstrap 4 causing these columns to stack vertically instead of horizontally?

After upgrading to bootstrap 4, I noticed that my gallery layout has changed from horizontal in bootstrap 3 to vertical. What could have caused this sudden change? To see the issue, here is a link to a fiddle. Here are my column settings: <div class= ...

Bootstrap 4 Card Body Spinner Overlay with Flex Alignment

Seeking to center a spinner both vertically and horizontally within a bootstrap 4 card body. Despite trying my-auto, justify-content-center & align-items-center, it seems like I'm missing something. I've double-checked the display types and ...

Adjust the top spacing in relation to the paragraph tag using jQuery

I wish to create multiple div elements with nested p tags that are initially hidden. Upon hovering over each div, I want the corresponding p tag to move up by the negative value of its own height. For instance: The first p tag has a height of 60px and a m ...

Creating a dynamic mouse trail effect using CSS and JavaScript without compromising element clickability

I'm looking to create a mouse trail that follows the cursor as it moves, made up of small icons or images that gradually fade out over time. I attempted to achieve this by overlaying a grid on top of all other elements on the page. The grid consists o ...

Need help styling a CSS for an iFrame on the same domain as my website?

After doing some research and browsing through Stack Overflow questions, I've discovered that even if you don't have access to the iFrame's stylesheet, you can still make edits as long as it resides in the same domain as your webpage where y ...

Dropdown sidebar with collapsible sections

I am looking to create a unique navigation system for my website. I have a standard HTML list with menu items that will serve as anchor links on a long-scrolling page. My idea is to design it as a minimal vertical side navigation bar, where each item initi ...

Is there a way to incorporate background images into the <option> tags within a <select> dropdown menu?

Not sure if browsers support this feature. It works fine in a div, but that's not very semantically correct. Here is a rough mockup of what I'm trying to achieve: Mockup Link /* CSS for select elements on page */ select { position: relative ...

The dynamic combination of jCarousel, jQuery Accordion, and fade in effects

Take a look at this link www.aboud-creative.com/demos/mckinley3. You'll find a jQuery Accordion with jCarousel inside the "Developments" section. I have implemented a standard fadeIn function for the logo, accordion, and a stag on the bottom right to ...

Surprising sight of a blank canvas behind the font-awesome icon

Is there a way to remove the unexpected white background that appears when adding a font-awesome icon? Here is the HTML code: <div class="notifications-window" id="close-notifications"> <div class="notifications-header&qu ...

Effortless scrolling implementation

How can I make the scroll smooth and animated with this code structure? Check out my JSFiddle here: https://jsfiddle.net/v7qhzo8q/ The code structure is as follows: <nav id="nav"> <ul id="top"> <li><a href="#">Home</a> ...

Is it possible to format data.table output to mimic the appearance of tibble output, showing only 10 rows and displaying columns that can fit on the screen?

How can I adjust the settings in data.table to only display 10 rows and have the columns fit within the screen, similar to how a tibble df does? I work on a laptop and would like to avoid cluttered output like the example below. Thank you for your help! l ...

The process of adding a tooltip icon to a Select component in Material-UI

I'm currently working with the material UI tooltip component and I want to position my tooltip to the right of a dropdown, right next to the down arrow as shown in the image below: https://i.stack.imgur.com/O2gwh.png However, the way it is set up no ...

What is the significance of H2 (the second homology group) being visible in a two-dimensional plot generated by RIPSER?

Working with the RIPSER library in python has been crucial for analyzing my TDA data. Initially, I used a 2-d plot, but upon further analysis using ripser, I encountered results with three homology groups (H0, H1, H2). However, this seems implausible as H0 ...

Error: The selector "html" is not considered pure as it does not contain any local class or id. Pure selectors must include at least one local class or id

When working on my Next.js project, I included the following code in _app.js: import '../src/styles/style.module.scss'; import '../src/styles/main.module.scss'; This is the content of main.module.scss: // ./src/styles/main.module.scss ...

What is the trick to having the ball change colors every time it hits the wall?

Recently, I stumbled upon this interesting ball bouncing question while searching for some JavaScript code. While the basic bounce animation was simple to achieve, I started thinking about how we could make it more dynamic by changing the color of the ball ...

How can I ensure that my CSS code functions seamlessly across all versions of Internet Explorer from IE6 to the latest release?

I need a solution for getting this CSS code to function properly across all versions of Internet Explorer, from IE6 to the most recent version. body:first-child * { margin-top:0 !important; } body:last-child * { margin-bottom:0 !important; } Any ...

Keeping the Bootstrap popover anchored to the content

I have a functional bootstrap popover that includes a time attribute. However, I am looking to enhance its functionality so that it remains open when the mouse is on the content and closes only when the mouse leaves the content. Here is the relevant code ...

The benefits of utilizing "native tags" instead of foreignObject in an SVG

As the creator of the stackoverflow-readme-profile project, I dedicated extensive time and effort to crafting a personalized Stackoverflow profile in the form of an SVG image. Utilizing "native svg tags," I meticulously constructed elements such as: < ...

Instead of only one menu icon, now there are three menu icons displayed on the screen. (Additionally, two more divs containing

When visiting on a smartphone browser, you may notice that instead of one menu icon, three icons appear. Upon inspecting the elements, you will find that there are three div's that look like this: <div class="responsive-menu-icon">&l ...