Created
June 27, 2023 20:36
-
-
Save nstrayer/bb7871bc4f891cc8f883cb00dcebecd8 to your computer and use it in GitHub Desktop.
ShinyComponent app demonstrating flexible cards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from htmltools import Tag | |
from shiny import App, render, ui | |
import shinycomponent as sc | |
# Basic paragraph tag with some lorem ipsum text inside of it | |
lorem_ipsum = ui.p("Lorem ipsum dolor sit amet, consectetur adipiscing elit.") | |
app_ui = sc.page_dashboard( | |
sc.grid( | |
sc.card( | |
sc.card_header("Pure flex card"), | |
Tag("output-plot"), | |
lorem_ipsum, | |
sc.card_footer("A footer"), | |
), | |
sc.card( | |
sc.card_header("Plot with fixed height"), | |
Tag("output-plot", height="100"), | |
lorem_ipsum, | |
sc.card_footer( | |
sc.forge.input_slider("n", "Number of bins", 10, 100, 20), | |
), | |
), | |
sc.card( | |
sc.card_header("Break out of the grid-row height"), | |
Tag("output-plot", height="100"), | |
lorem_ipsum, | |
sc.card_footer( | |
sc.forge.input_slider("n", "Number of bins", 10, 100, 20), | |
), | |
height="content", | |
), | |
sc.card( | |
sc.card_header("...Or don't"), | |
Tag("output-plot", height="90"), | |
lorem_ipsum, | |
Tag("output-plot"), | |
), | |
nRows=2, | |
nCols=2, | |
), | |
) | |
def server(input, output, session): | |
pass | |
app = App(app_ui, server, debug=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://raw.githubusercontent.com/wch/shinycomponent/main-build/py/dist/shinycomponent-0.0.1-py3-none-any.whl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment