{"id":6899,"library":"streamlit-keyup","title":"Streamlit Keyup Input","description":"Streamlit-keyup is a custom component for Streamlit applications that provides a text input field which updates its value in real-time, on every key press (on keyup event). This differs from Streamlit's native `st.text_input` which typically waits for the user to press Enter or for the widget to lose focus. The library is currently at version 0.3.0 and receives occasional updates, primarily for compatibility and minor fixes.","status":"active","version":"0.3.0","language":"en","source_language":"en","source_url":"https://github.com/blackary/streamlit-keyup","tags":["streamlit","input","component","realtime","keyup","form"],"install":[{"cmd":"pip install streamlit-keyup","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"streamlit-keyup is a custom component built for Streamlit applications.","package":"streamlit"}],"imports":[{"symbol":"st_keyup","correct":"from st_keyup import st_keyup"}],"quickstart":{"code":"import streamlit as st\nfrom st_keyup import st_keyup\n\nst.title(\"Streamlit Keyup Demo\")\n\n# Basic usage: value updates after every key press\nvalue_basic = st_keyup(\"Enter text here\", key=\"keyup_basic\")\nst.write(f\"Basic Input: {value_basic}\")\n\n# Usage with a default value\nvalue_with_default = st_keyup(\"Enter with default\", value=\"Hello world\", key=\"keyup_default\")\nst.write(f\"Input with default: {value_with_default}\")\n\n# Usage with debounce to limit update frequency (e.g., update every 500ms)\nvalue_debounced = st_keyup(\"Enter with debounce\", debounce=500, key=\"keyup_debounced\")\nst.write(f\"Debounced Input: {value_debounced}\")\n\n# Example with max_chars, placeholder, and disabled\nvalue_complex = st_keyup(\n    \"Limited and Placeholder\",\n    max_chars=10,\n    placeholder=\"Max 10 chars\",\n    disabled=False, # Use os.environ.get for dynamic disable\n    key=\"keyup_complex\"\n)\nst.write(f\"Complex Input: {value_complex}\")","lang":"python","description":"This example demonstrates the basic usage of `st_keyup`, including setting a default value, using the `debounce` parameter to control update frequency, and combining `max_chars`, `placeholder`, and `disabled` arguments."},"warnings":[{"fix":"Upgrade to `streamlit-keyup` version `0.3.0` or newer to ensure the `disabled` state updates dynamically.","message":"The `disabled` argument did not update dynamically in versions prior to `0.3.0`, meaning its initial state would persist even if changed programmatically. This was fixed in `v0.3.0`.","severity":"gotcha","affected_versions":"<0.3.0"},{"fix":"Ensure you are using `streamlit-keyup` `v0.2.4` or newer for compatibility with Streamlit `1.32.2` and subsequent versions. Always test component behavior after Streamlit upgrades.","message":"Compatibility issues can arise with specific Streamlit versions. For example, `v0.2.4` addressed a rendering issue with Streamlit `1.32.2`.","severity":"gotcha","affected_versions":"<0.2.4"},{"fix":"Always provide a unique `key` argument for each `st_keyup` instance in your application (e.g., `key=\"my_unique_input_1\"`).","message":"The `key` parameter is essential for Streamlit components to maintain their state across reruns. While `streamlit-keyup` generates a default key if none is provided, explicitly setting unique keys for each `st_keyup` instance is a best practice to prevent unexpected behavior and component state collisions.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update your `st_keyup` calls to include the new arguments where appropriate to utilize the enhanced functionality, especially for `max_chars`, `placeholder`, and `disabled`.","message":"New arguments like `max_chars`, `type`, `placeholder`, `disabled`, `label_visibility` were introduced in `v0.2.0`, and `on_change` in `v0.1.8`. While not strictly breaking, code written for older versions will not leverage these new functionalities. Review your usage if upgrading from significantly older versions.","severity":"deprecated","affected_versions":"<0.2.0 for most, <0.1.8 for on_change"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}