Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

streamlit-input-box

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

streamlit-input-box

Streamlit component that allows you to edit text/code in a convenient text area.

  • 0.0.3
  • PyPI
  • Socket score

Maintainers
1

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)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc