← 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.

ArgumentTypeDefaultDescription
input_idcharacterrequiredRequired Shiny input id; reads as a click count.
labelcharacter | shiny.tagrequiredReady-state button label.
label_busycharacter'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.
iconcharacter | shiny.tagNULLOptional ready-state icon name or tag.
icon_busycharacter | shiny.tagNULLOptional busy-state icon; defaults to a spinner.
icon_position'inline-start' | 'inline-end''inline-start'Icon placement relative to the label.
auto_resetlogicalTRUEReturn to ready after the click's reactive flush.
...named attributesnoneAdditional HTML attributes passed to the button (e.g. disabled = TRUE).
classcharacterNULLAdditional 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.

ArgumentTypeDefaultDescription
sessionShinySessionrequiredStandard active R/Shiny session.
input_idcharacterrequiredInput id of the task button to update.
state'ready' | 'busy'NULLBusy/ready state; busy takes manual control.
labelcharacterNULLNew ready-state label.
label_busycharacterNULLNew busy label.
variantcharacterNULLUpdate the button's visual preset.
size'default' | 'sm' | 'lg'NULLUpdate the button's size preset.
iconcharacter | shiny.tagNULLNew ready icon, or NULL to clear.
icon_busycharacter | shiny.tagNULLNew busy icon, or NULL to clear (back to the spinner).
icon_position'inline-start' | 'inline-end'NULLUpdate icon placement relative to the label.
disabledlogicalNULLEnable/disable the button.
stylecharacterNULLInline CSS string, or NULL to clear.
classcharacterNULLReplacement classes on the button element, or NULL to clear.