deephaven / deephaven-plugins

Deephaven Plugins
5 stars 12 forks source link

docs: grid #552

Closed ethanalvizo closed 1 week ago

ethanalvizo commented 3 weeks ago

Closes #533

TextField component seems to have a default minimum width. The other items in the grid adjust to the column size I define. Checking to see if this is an intended behaviour or something wrong with the Grid component

from deephaven import ui
@ui.component
def my_input():
    text, set_text = ui.use_state("hello")
    count, set_count = ui.use_state(0)

    return ui.grid(
        ui.action_button(
            f"You pressed me {count} times", on_press=lambda _: set_count(count + 1)
        ),
        ui.text_field(value=text, on_change=set_text),
        ui.text(f"You typed {text}"),
        rows="100px 10px 10px",
        columns="10px"
    )

result = my_input()
image