if (interactive()) {
library(shiny)
# Basic split card 2 with a 40\% left panel
shinyApp(
ui = fluidPage(
h2("Basic Fixed Split Card"),
splitCard2(
shiny::div(h1("Question:"), p("What is the capital of France?")),
shiny::div(h1("Answer:"), p("Paris.")),
slider.position = "40",
bg.left.color = "#FFFDE7",
bg.right.color = "#E8F5E9"
)
),
server = function(input, output) {}
)
# Split card 2 with custom text and border colors
shinyApp(
ui = fluidPage(
h2("Styled Fixed Split Card"),
splitCard2(
shiny::div(h4("Left Side"), p("Detailed information here.")),
shiny::div(h4("Right Side"), p("Corresponding summary or data.")),
bg.right.color = "white",
bg.left.color = "#F0F4C3",
border.color = "#FFC107",
text.left.color = "darkgreen",
text.right.color = "darkblue",
slider.position = "60"
)
),
server = function(input, output) {}
)
}
Run the code above in your browser using DataLab