Repository: gradio-app/gradio

Issue:
Add component update to docs
- [x] I have searched to see if a similar issue already exists.

**Is your feature request related to a problem? Please describe.**  
In workflows with multiple steps it might be necessary to make the user choose based on output for model 1 for subsequent models. 
Currently, the radio and dropdown fields only support changing the active value but not all the values. 

**Describe the solution you'd like**  
Like updating the textbox i'd like to be able to do the following:
```
import gradio as gr

def update(name):
    return [f'Hello {name}',f'Bye {name}', f'Good morning {name}' ]

demo = gr.Blocks()

with demo:
    inp = gr.Textbox(placeholder="What is your name?")
    out = gr.Radio(label="Greeting to use")
    
    inp.change(fn=update, 
               inputs=inp, 
               outputs=out)

demo.launch()
```



Discussion:
This is actually possible with `Blocks`! We still need to add documentation around it, but in your case, all you need to do is modify the return statement to use the special `.update()` method that every component defines, like this:

```py
def update(name):
    return gr.Radio.update(choices=[f'Hello {name}',f'Bye {name}', f'Good morning {name}' ])

demo = gr.Blocks()

with demo:
    inp = gr.Textbox(placeholder="What is your name?")
    out = gr.Radio(choices=[], label="Greeting to use")
    
    inp.change(fn=update, 
               inputs=inp, 
               outputs=out)

demo.launch()
```

<img width="626" alt="image" src="https://user-images.githubusercontent.com/1778297/169883905-669e825c-ee0b-4dd2-bf11-009ec09fc30d.png">

Ah thanks. I tried this using `gr.radio.update(["test1", "test2"])` . Adding documentation for this would be good
Opening the issue until update is added to docs.
@abidlabs @FarukOzderim Does this issue track adding the `update` method for each component to the Docs page? 

We already added `gr.update` to the Docs page under "blocks utilities" and "Introduction to Blocks" already includes an "Updating Component Configurations" section. 

I think we should close unless we specifically want to add the `update` method for each component to the docs page.
It should stay open because we need to document Component.update as we have it in our library as well, even if we have it in the guides. Btw, IMO Component.update should be the suggested usage because it has autocompletion for the function parameters.
But no need to list each of them seperately, we can just show an example of it in gr.update and suggest using it since it will have parameter tracking/autocompletion.

Resolving patch:
diff --git a/gradio/blocks.py b/gradio/blocks.py
--- a/gradio/blocks.py
+++ b/gradio/blocks.py
@@ -205,8 +205,10 @@ def update(**kwargs) -> dict:
     Updates component parameters.
     This is a shorthand for using the update method on a component.
     For example, rather than using gr.Number.update(...) you can just use gr.update(...).
+    Note that your editor's autocompletion will suggest proper parameters
+    if you use the update method on the component.
 
-    Demos: blocks_update, blocks_essay_update
+    Demos: blocks_essay, blocks_update, blocks_essay_update
 
     Parameters:
         kwargs: Key-word arguments used to update the component's properties.


Test patch: