Skip to content

@bind input element generator? #918

@dustyirwin

Description

@dustyirwin

Hi all,

Is there a way to iteratively generate Pluto @Bind input elements (Button, CheckBox, etc)?

I've looked around and can't find this issue addressed quite yet. If I've missed something please let me know.

For example, it would be nice to be able to do something like the following:

vec = [1,2,3]

md"""
join( [ "$(@Bind var$i CheckBox()" for i in vec ], " | ")
"""

to produce the markdown:

md"""
$(@Bind var1 CheckBox()) | $(@Bind var2 CheckBox()) | $(@Bind var3 CheckBox())
"""

...and have it actually interpolate into a cell correctly. Important to note that the length and contents of vec may vary (in a sensible way).

Trying this general approach hasn't been fruitful and I'm hoping there is a more workable / elegant approach? It also seems that the ability to programmatically create UI elements (generating a drop-down menu for each column in a dataframe, for example) would be a prerequisite towards #664.

Thanks for any help! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions