Skip to content

How to get True or False status of a checkbox #178

Answered by ramedina86
saqwild asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

In Streamsync, the value of a Checkbox Input is an array, since it can contain multiple options, and multiple options can be selected at once (unlike with a radio input, where only one option can be selected).

For example, if you have a Checkbox Input with three options (keys a, b, c), you can set a and b to be checked by binding a state element as shown below.

initial_state = ss.init_state({
    "my_checks": ["a", "b"]
})

Hope that helps!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@saqwild
Comment options

Answer selected by saqwild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants