I want to insert a search bar inside the navbar
, how to do that?
library(shiny)
library(bslib)
page_sidebar(
tags$head(
tags$link(rel = "stylesheet", type = "text/css", href = "style.css")
),
title = "Weather",textInput("search","Search"),
sidebar = sidebar("sidebar",
card(" ",actionButton("card_click", card_body("Cities",align = "center"))),
card(" ",actionButton("card_click-1", card_body("Maps",align = "center"))),
card(" ",actionButton("card_click-2", card_body("About Me",align = "center"))),
),
layout_columns(
card("card1",
card_body(card("card2",height = "200px"),card("card3",height = "200px"))
), col_widths = c(8,4),
layout_columns(card("card4")))
)
I need the search bar where the red box is. Any way to do that?
2
Answers
You may use absolute positionings.
You can wrap the
title
inside atagList
which contains a label for thetitle
("weather") and thetextInput
, and then usedisplay: grid;
on thenavbar
as well as a suitablecolumn-gap
: