2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Streamlit のチャットテキスト入力コンポーネントをインライン表示する

Posted at

結論

下記のように、チャットコンポーネント st.chat_input, st.chat_messages 全体を st.container() でくくればOK。

image.png

上記のコードは下記の Streamlit Playground から確認できます。

他にも、st.sidebar なり、st.expander なりの中にインライン記述できるみたいです。

この機能修正は、下記の Issue であがり、Streamlit 1.31 で実装されたみたいです。

おまけ:ネストしていないと?

チャットテキストのインプットコンポーネントが、画面最下部に表示されます。
image.png

最後に

それはそうと、Streamlit Playground、めっちゃ便利です。共有もできるとは知らなかった。使っていこう。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?