# Change component's state on Click action

**URL:** https://community.weweb.io/t/change-components-state-on-click-action/7847
**Category:** How do I?
**Created:** [March 29, 2024, 4:02pm UTC](https://community.weweb.io/t/change-components-state-on-click-action/7847 "2024-03-29T16:02:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![maciej.ziolkowski](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/maciej.ziolkowski/32/7740_2.png) [@maciej.ziolkowski](https://community.weweb.io/u/maciej.ziolkowski)
#### Post date: [March 29, 2024, 4:02pm UTC](https://community.weweb.io/t/change-components-state-on-click-action/7847/1 "2024-03-29T16:02:56Z")

</div>

Hi all,  
I have created a custom component for which I defined a state `selected`. Now I would like to enable / disable this state on `click` action. How do I do it? I can’t seem to find any available action in workflow editor that would allow to do it.

Regards,  
Maciej

---

<div class="post-metadata">

### Author: ![FHEXL](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/fhexl/32/13607_2.png) [@FHEXL](https://community.weweb.io/u/FHEXL)
#### Post date: [March 29, 2024, 6:46pm UTC](https://community.weweb.io/t/change-components-state-on-click-action/7847/2 "2024-03-29T18:46:39Z")

</div>

A state is bound to a condition, like if a variable has a certain value. OnClick change the variable value that triggers the state

---

<div class="post-metadata">

### Author: ![maciej.ziolkowski](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/maciej.ziolkowski/32/7740_2.png) [@maciej.ziolkowski](https://community.weweb.io/u/maciej.ziolkowski)
#### Post date: [March 30, 2024, 9:00pm UTC](https://community.weweb.io/t/change-components-state-on-click-action/7847/3 "2024-03-30T21:00:44Z")

</div>

Got it. Thanks!
