← Back to Components
Task Button
An action button that locks on click, shows a busy state, and auto-resets after the click flush.
Interactive Playground
R Code
API Reference
block_task_button()
An action button that locks on click, shows a busy label and spinner, reports a shinyActionButtonValue, and auto-resets after the click flush.
| Argument | Type | Default | Description |
|---|---|---|---|
| input_id | character | required | Required Shiny input id; reads as a click count. |
| label | character | shiny.tag | required | Ready-state button label. |
| label_busy | character | 'Processing…' | Accessible and visible label shown while busy. |
| variant | 'default' | 'secondary' | 'outline' | 'ghost' | 'destructive' | 'link' | 'default' | Thematic button style type. |
| size | 'default' | 'sm' | 'lg' | 'default' | Dimension size variant presets. |
| icon | character | shiny.tag | NULL | Optional ready-state icon name or tag. |
| icon_busy | character | shiny.tag | NULL | Optional busy-state icon; defaults to a spinner. |
| icon_position | 'inline-start' | 'inline-end' | 'inline-start' | Icon placement relative to the label. |
| auto_reset | logical | TRUE | Return to ready after the click's reactive flush. |
| ... | named attributes | none | Additional HTML attributes passed to the button (e.g. disabled = TRUE). |
| class | character | NULL | Additional classes merged onto the runtime button element. |
update_block_task_button()
Updates a task button from R server logic; setting state = 'busy' takes manual control until state = 'ready' releases it.
| Argument | Type | Default | Description |
|---|---|---|---|
| session | ShinySession | required | Standard active R/Shiny session. |
| input_id | character | required | Input id of the task button to update. |
| state | 'ready' | 'busy' | NULL | Busy/ready state; busy takes manual control. |
| label | character | NULL | New ready-state label. |
| label_busy | character | NULL | New busy label. |
| variant | character | NULL | Update the button's visual preset. |
| size | 'default' | 'sm' | 'lg' | NULL | Update the button's size preset. |
| icon | character | shiny.tag | NULL | New ready icon, or NULL to clear. |
| icon_busy | character | shiny.tag | NULL | New busy icon, or NULL to clear (back to the spinner). |
| icon_position | 'inline-start' | 'inline-end' | NULL | Update icon placement relative to the label. |
| disabled | logical | NULL | Enable/disable the button. |
| style | character | NULL | Inline CSS string, or NULL to clear. |
| class | character | NULL | Replacement classes on the button element, or NULL to clear. |