← Back to Components
Switch
Highly interactive slider-toggle switch for toggle inputs.
Interactive Playground
R Code
API Reference
block_switch()
A toggle switch input styled with premium smooth slide animations.
| Argument | Type | Default | Description |
|---|---|---|---|
| input_id | character | required | Input id reported back to Shiny as input$. |
| label | character | required | Visible label rendered next to the toggle. |
| value | logical | FALSE | Initial checked state (TRUE/FALSE). |
| disabled | logical | FALSE | Disables the switch while preserving server updates. |
| style | character | list | NULL | Inline CSS styles applied to the switch wrapper. |
| class | character | NULL | Additional class merged onto the runtime switch wrapper. |
update_block_switch()
Modifies toggle positions and interactive lockouts instantly.
| Argument | Type | Default | Description |
|---|---|---|---|
| session | ShinySession | required | Standard active R/Shiny session. |
| input_id | character | required | Target switch input ID. |
| checked | logical | NULL | Set new active toggled checked state. |
| disabled | logical | NULL | Toggle lock input interface interactions. |