Skip to content

Commit

Permalink
update 02_text example for bslib
Browse files Browse the repository at this point in the history
  • Loading branch information
chendaniely committed Jan 19, 2024
1 parent 54988c1 commit 3c4dd16
Showing 1 changed file with 23 additions and 31 deletions.
54 changes: 23 additions & 31 deletions inst/examples/02_text/app.R
Original file line number Diff line number Diff line change
@@ -1,39 +1,31 @@
library(bslib)
library(shiny)

# Define UI for dataset viewer app ----
ui <- fluidPage(
# Sidebar layout with a input and output definitions ----
ui <- page_sidebar(
# Main panel for displaying outputs ----
# Output: Verbatim text for data summary ----
verbatimTextOutput("summary"),

# Output: HTML table with requested number of observations ----
tableOutput("view"),

# Sidebar panel for inputs ----
sidebar = sidebar(
# Input: Selector for choosing dataset ----
selectInput(inputId = "dataset",
label = "Choose a dataset:",
choices = c("rock", "pressure", "cars")),

# Input: Numeric entry for number of obs to view ----
numericInput(inputId = "obs",
label = "Number of observations to view:",
value = 10)
),

# App title ----
titlePanel("Shiny Text"),

# Sidebar layout with a input and output definitions ----
sidebarLayout(

# Sidebar panel for inputs ----
sidebarPanel(

# Input: Selector for choosing dataset ----
selectInput(inputId = "dataset",
label = "Choose a dataset:",
choices = c("rock", "pressure", "cars")),

# Input: Numeric entry for number of obs to view ----
numericInput(inputId = "obs",
label = "Number of observations to view:",
value = 10)
),

# Main panel for displaying outputs ----
mainPanel(

# Output: Verbatim text for data summary ----
verbatimTextOutput("summary"),

# Output: HTML table with requested number of observations ----
tableOutput("view")

)
)
title = "Shiny Text"
)

# Define server logic to summarize and view selected dataset ----
Expand Down

0 comments on commit 3c4dd16

Please sign in to comment.