## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup--------------------------------------------------------------------
library(shinydataviewer)
library(shiny)
library(bslib)
library(reactable)

## ----eval = FALSE-------------------------------------------------------------
# data_viewer_server(
#   "viewer",
#   data = reactive(mtcars),
#   searchable = TRUE,
#   filterable = FALSE,
#   sortable = TRUE,
#   default_page_size = 25,
#   page_size_options = c(25, 50, 100),
#   reactable_args = list(
#     showPageInfo = FALSE
#   )
# )

## ----eval = FALSE-------------------------------------------------------------
# data_viewer_card_ui(
#   "viewer",
#   table_controls_position = "bottom"
# )

## ----eval = FALSE-------------------------------------------------------------
# custom_summary_card <- function(summary_row, index) {
#   htmltools::tags$div(
#     class = "custom-summary-card",
#     htmltools::tags$strong(summary_row$var_name[[1]]),
#     htmltools::tags$span(sprintf(" (%s)", summary_row$type[[1]]))
#   )
# }
# 
# data_viewer_server(
#   "viewer",
#   data = reactive(iris),
#   summary_card_fn = custom_summary_card
# )

## ----eval = FALSE-------------------------------------------------------------
# ui <- page_fillable(
#   theme = bs_theme(version = 5, brand = "brand.yml"),
#   data_viewer_card_ui("viewer")
# )

