New Component: streamlit-listview — a native-feeling list with search, groups, and multi-select

Hello Streamlit community,

I built a list view component for an internal project because st.selectbox and st.multiselect did not meet my needs.

I wanted it to feel like a native Streamlit widget, for users and developers alike. Its design follows st.selectbox and st.multiselect, and it inherits your app’s theme automatically. Its API follows their signatures too, with extra parameters to customize the list.

streamlit-listview demo

Demo App | Source | PyPI

Features

  • Single or multi selection — with an optional max_selections cap.
  • Grouping — sticky headers; groups can collapse.
  • Live search — filters by label as you type. Pin it to keep it in view while the list scrolls.
  • Sorting — orders items, group headers, or both, A→Z or Z→A.
  • Select all / Deselect all — acts on every row that matches the search, including rows in collapsed groups, and skips disabled rows.
  • Add new options — users can enter values that are not in the list; you get the typed string back. Typing the label of an existing option selects that option instead of adding a duplicate.
  • Jump to default — scrolls the default selection into view on first render and whenever default changes. Only the list scrolls, never the page.
  • Markdown labels and help — the same Markdown Streamlit supports: GFM, :red[…] colors, badges, :material/icon:, :streamlit:, and emoji.
  • Returns what you pass in — select a dict, get that dict back, metadata and all.

In the demo app you can try every feature. It also generates the code to use the list view in your own app.

The component is built on Custom Components v2.

Installation

pip install streamlit-listview
# or
uv add streamlit-listview

Basic example

import streamlit as st
from streamlit_listview import listview

framework = listview(
    "Select a Python framework",
    ["Streamlit", "Gradio", "Dash", "Flask", "Shiny"],
    selection_mode="single",
    key="frameworks",
)

if framework == "Streamlit":
    st.write("You selected the right framework!")
elif framework:
    st.write("Try again!")

Documentation

The README documents the full API.

Built with :heart: and Streamlit.

Happy Streamlit-ing,
Leland Grunt

streamlit-listview 1.1.0 is out.

pip install -U streamlit-listview

Faster large lists. The list now renders only the rows near the visible area, so large lists load, search, and scroll much faster.

Clearer layout.

  • Options without a group now render last, under their own header. Name that header with the new ungrouped_label parameter (default: "Other").
  • The add field for accept_new_options sits in a footer below the list and stays in view while the list scrolls.

Better keyboard and screen-reader support. With collapsible_groups=True, the list is now a tree: the arrow keys move through it and open or close groups, and the whole list is one Tab stop. Each row also tells screen readers its position in the list.

Breaking change: accept_new_options. Added entries now come back in the same type as the other options:

  • int options: 42 instead of "42". The add field accepts only whole numbers.
  • dict options: {"id": "Mango", "label": "Mango"} instead of "Mango".
  • str or mixed options: unchanged.

If your code handles added entries, check it before you upgrade.

listview() now has type hints. The release is tested with Streamlit 1.65 and still runs on 1.51 or later.

Full changelog

Happy Streamlit-ing,
Leland Grunt