Skip to main content
Solved

Select all Checkbox


How do I make a prototype with a master checkbox that affects the column of checkboxes below it.

Best answer by Avokadomos

Here’s another example without variables. I hope I understood it correctly now.

View original
This topic has been closed for comments

14 replies

gilgongo
  • 51 replies
  • July 26, 2023

If you have a checkbox component state called something like “selected”, then make the master checkbox set a boolean variable which all the others can use to set their state.

Then when you check the master, use a conditional statement to set the variable depending on its current state (checked or unchecked). The variable then determines the state of the checkbox below it.

As an aside, to fully replicate this common web app behaviour, you’d also need to allow the checkboxes below it to be selected/unselected independently as well. Not sure how best to do that though without having to create a variable for each checkbox (so you’d end up with a lot of variables!)


Avokadomos
  • Active Member
  • 377 replies
  • July 26, 2023

You can make each checkbox add to the same variable. See the example below.


gilgongo
  • 51 replies
  • July 26, 2023

I think that solves a different problem to the one OP is referring to, but still ❤️


Avokadomos
  • Active Member
  • 377 replies
  • Answer
  • July 26, 2023

Here’s another example without variables. I hope I understood it correctly now.


Thank you, this is what I was after. I will build it as you have it and learn.


what is the procedure to reach this result @Avokadomos ?


Avokadomos
  • Active Member
  • 377 replies
  • September 22, 2023

You can open up the prototype in editor to see how I’ve made the connections.


Kevin_Drescher

Hey,

can you maybe share the source file of this?
In Editor i cant view the variables and I do not understand how it works 😕


  • 2 replies
  • September 26, 2023

Not intuitive but if you open it in the prototype view mode and hit the top center “community demos” title it’ll drop down an option to view in editor. Hope that helps!


  • 2 replies
  • September 26, 2023

Not intuitive but if you open it in the prototype view mode and hit the top center “community demos” title it’ll drop down an option to view in editor. Hope that helps!


Kevin_Drescher

Well I did thst but there i can only see components and elements but not how the variables are set and operate? Or do i miss something?


Avokadomos
  • Active Member
  • 377 replies
  • September 27, 2023

Duplicate it to your own files for full access.


Kevin_Drescher

I tried this and was in design mode and did only see the error message by Figma.

Pasting unpublished variables across files does not create new lkocal variables yet.

So I assumed no variables have been transferred. I tried again in Prototype mode and now have them. Thank you : )


Gonzalo_Leon

One component has 2 variants: Box unchecked, box checked.INteraction; change from one variant to the other. Now, You build another component with list of unchecked instances, this is your default variant, and a list of checked instances, this is your second variant. On top, you put a checked or unchecked instance, with the interaction of change from one variant of the list to the other.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings