rx.debounce_inputcomponent allows the frontend to remain responsive while receiving user input and send the value to the backend after some delay, on blur, or when Enter is pressed.
rx.text_areahowever, most child components that accept the
on_changeevent handler can be used with
class DebounceCheckboxState(rx.State): checked: bool = False def index(): return rx.hstack( rx.cond( DebounceCheckboxState.checked, rx.text("Checked", color="green"), rx.text("Unchecked", color="red"), ), rx.debounce_input( rx.checkbox( on_change=DebounceCheckboxState.set_checked, ), debounce_timeout=1000, ), )
The DebounceInput component is used to buffer input events on the client side.
It is intended to wrap various form controls and should be used whenever a fully-controlled input is needed to prevent lost input data when the backend is experiencing high latency.