Henk Straten
Henk Straten

Reputation: 1447

Remove label from input field

I have a shiny app like this:

library(shiny)


UI <- fluidPage(
  numericInput("obs", "Observations:", 10, min = 1, max = 100),
  numericInput("obs", "Observations:", 10, min = 1, max = 100)
)
Server <- function(input, output) {}

shinyApp(ui = UI, server = Server)

If i remove the titles like this:

UI <- fluidPage(
  numericInput("obs", "", 10, min = 1, max = 100),
  numericInput("obs", "", 10, min = 1, max = 100)
)
Server <- function(input, output) {}

shinyApp(ui = UI, server = Server)

I still have white space floating above the input fields. Any thoughts on how i an get rid of this?

Upvotes: 3

Views: 1536

Answers (1)

pogibas
pogibas

Reputation: 28339

Use NULL as label if you want empty field:

library(shiny)
UI <- fluidPage(
    numericInput("obs", "Observations:", 10, min = 1, max = 100),
    numericInput("obs", "", 10, min = 1, max = 100),
    numericInput("obs", NULL, 10, min = 1, max = 100)
)
Server <- function(input, output) {}
shinyApp(ui = UI, server = Server)

enter image description here

Upvotes: 8

Related Questions