Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions shiny/api-examples/include_bootstrap_css/app-core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from pathlib import Path

from shiny import App, render, ui

app_ui = ui.page_sidebar(
ui.sidebar(
ui.input_numeric("n", "N", min=0, max=100, value=20),
title="Parameters",
),
ui.include_bootstrap_css(Path(__file__).parent / "darkly.min.css"),
ui.h2("Output"),
ui.output_text_verbatim("txt"),
ui.markdown(
"""
**AI-generated filler text.** In the world of exotic fruits, the durian stands out with its spiky exterior and strong odor. Despite its divisive smell, many people are drawn to its rich, creamy texture and unique flavor profile. This tropical fruit is often referred to as the "king of fruits" in various Southeast Asian countries.

Durians are known for their large size and thorn-covered husk, which requires careful handling. The flesh inside can vary in color from pale yellow to deep orange, with a custard-like consistency that melts in your mouth. Some describe its taste as a mix of sweet, savory, and creamy, while others find it overpowering and pungent.
"""
),
title="Theme Example",
)


def server(input, output, session):
@render.text
def txt():
return f"n*2 is {input.n() * 2}"


app = App(app_ui, server)
25 changes: 25 additions & 0 deletions shiny/api-examples/include_bootstrap_css/app-express.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from pathlib import Path

from shiny.express import input, render, ui

ui.page_opts(title="Theme Example")
ui.include_bootstrap_css(Path(__file__).parent / "darkly.min.css")

with ui.sidebar(title="Parameters"):
ui.input_numeric("n", "N", min=0, max=100, value=20)

ui.h2("Output")


@render.code
def txt():
return f"n*2 is {input.n() * 2}"


ui.markdown(
"""
**AI-generated filler text.** In the world of exotic fruits, the durian stands out with its spiky exterior and strong odor. Despite its divisive smell, many people are drawn to its rich, creamy texture and unique flavor profile. This tropical fruit is often referred to as the "king of fruits" in various Southeast Asian countries.

Durians are known for their large size and thorn-covered husk, which requires careful handling. The flesh inside can vary in color from pale yellow to deep orange, with a custard-like consistency that melts in your mouth. Some describe its taste as a mix of sweet, savory, and creamy, while others find it overpowering and pungent.
"""
)
Loading