from dash import Dash, html, dcc, Input, Output, State, ctx
import requests
-app = Dash(__name__, requests_pathname_prefix="/app/")
+app = Dash(
+ __name__,
+ requests_pathname_prefix="/app/",
+ external_stylesheets=["/app/assets/bootstrap.min.css"],
+ assets_folder="../../assets/",
+)
app.layout = html.Div(
[
html.Div(
+ className="mb-3",
children=[
- html.Label("Text input"),
- dcc.Textarea(
- id="label-text",
- style={"width": "100%"},
- placeholder="Text for label",
+ html.Div(
+ className="mb-3",
+ children=[
+ html.Label("Label Text", className="form-label"),
+ dcc.Textarea(
+ id="label-text",
+ style={"width": "100%"},
+ className="form-control",
+ placeholder="Text for label",
+ ),
+ html.Div(
+ id="label-help",
+ className="form-text",
+ children=["Multiple lines print as shown"],
+ ),
+ ],
+ ),
+ html.Div(
+ className="mb-3",
+ children=[
+ html.Label("Font size", className="form-label"),
+ dcc.Input(
+ id="font-size",
+ className="form-control",
+ type="number",
+ min=0,
+ max=100,
+ ),
+ html.Div(
+ id="emailHelp",
+ className="form-text",
+ children=["Leave blank for auto font size"],
+ ),
+ ],
+ ),
+ html.Div(
+ className="mb-3",
+ children=[
+ html.Label("Copies", className="form-label"),
+ dcc.Input(
+ id="copies",
+ className="form-control",
+ value=1,
+ type="number",
+ min=0,
+ max=100,
+ ),
+ ],
+ ),
+ html.Button(
+ "Print", name="print", id="print", className="btn btn-primary"
),
- html.Label("Font size"),
- dcc.Input(id="font-size", type="number", min=0, max=100),
- html.Label("Copies"),
- dcc.Input(id="copies", value=1, type="number", min=0, max=100),
- html.Button("Print", name="print", id="print"),
html.Div(id="print-result"),
- ]
+ ],
),
]
)