Skip to content
Discussion options

You must be logged in to vote

To my amazement and satisfaction, this does in fact somehow work like magic

@module.ui
def make_card(label: str, lb: float, ub: float) -> Tag:
    return ui.card(
        ui.card_header(ui.input_checkbox("show", label, False)),
        ui.panel_conditional(
            "input.show == true",
            ui.layout_columns(
                ui.input_numeric("lb", "Lower Bound", lb if lb != -np.inf else -1, step=0.01),
                ui.input_numeric("ub", "Upper Bound", ub if ub != np.inf else 1, step=0.01),
            ),
        ),
    )

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by travis-leith
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant