Skip to main content

streamlit-input-box

Streamlit component that allows you to edit text/code in a convenient auto-resizable text area. Intended both for code and natural language input (no syntax highlighting implemented). No text wrap and horizontal scrolling makes code editing easier. It's state resets to empty automatically after submiting. Manages its own history of inputs that can be navigated using Ctrl+up / Ctrl+down. Colors adapt dynamically to the app's theme.

Installation instructions

pip install streamlit-input-box

Usage instructions

Pretty straighforward.

text=input_box(
    min_lines=1,
    max_lines=5,
    just_once=False,
    callback=None,
    args=(),
    kwargs={},
    key=None
)

Renders an auto-resizable text area. Enter and Tab keystrokes behave as expected for text edition. Ctrl+Enter or click the 'send' button to submit. Returns the inputted text.

Arguments:

  • min/max_lines: minimal and maximal limits for auto-resizing of the input box.
  • just_once: determines if the component will return the text only once after submiting (and then None), or on every rerun of the app.
  • callback: optional callback passed to the component that will be called after submitting.
  • args: optional tuple of arguments passed to the callback
  • kwargs: optional dict of named arguments passed to the callback
  • key: unique state identifier for your component

Example

import streamlit as st
from streamlit_input_box import input_box

state=st.session_state

if 'texts' not in state:
    state.texts=[]

text=input_box(min_lines=3,max_lines=10,just_once=True)
    
if text:
    state.texts.append(text)

for text in state.texts:
    st.text(text)

Metadata

Release files for streamlit-input-box 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-input-box 0.0.3
File Size Uploaded
streamlit_input_box-0.0.3.tar.gz 996.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-input-box 0.0.3
File Interpreter ABI Platform
streamlit_input_box-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 2.0 MB

Release files / streamlit_input_box-0.0.3.tar.gz

Download URL streamlit_input_box-0.0.3.tar.gz
Size 996.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5cc61e231939bb651ed26ed70e634721febc30ddd8cc4d566bc36eaaa52f44f7
BLAKE2b-256 checksum
How to use checksums
99257ea89335587ea11158e946e68ab442c77152aeff5d79bb74ff5375d297cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / streamlit_input_box-0.0.3-py3-none-any.whl

Download URL streamlit_input_box-0.0.3-py3-none-any.whl
Size 998.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f2a66d5d9dcaf4dbc5a594a739e9a35984689e9d897fd9809e3670ff7ce43f3
BLAKE2b-256 checksum
How to use checksums
d865f2d05b9014f2ce6f0682f3b4bd46d4897ddfe9f8a74b7f53af664b3abbf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page