Skip to content

Configure the initial height of st.chat_input #10724

@lukasmasuch

Description

@lukasmasuch

Checklist

  • I have searched the existing issues for similar feature requests.
  • I added a descriptive title and summary to this issue.

Summary

Add a height parameter to st.chat_input that allows configuring the minimum & initial height of the chat input field.

Why?

It allows the developer to mimic a look & feel that is similar to most of the big LLM-powered apps, e.g. chatgpt:

Image

How?

You can test this feature in this prototype.

st.chat_input(..., height: int | None = None)
  • height: Desired minimum height of the UI element expressed in pixels. If this is None (default), uses the default single-line widget height. The height must be at least 40 pixels, which fits one lines. The chat input automatically expands to up to 6.5 lines to accommodate the text value.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:st.chat_inputRelated to the `st.chat_input` widgettype:enhancementRequests for feature enhancements or new features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions