Skip to main content

🐙 streamlit_tree_select

A simple and elegant checkbox tree for Streamlit. Build on react-checkbox-tree.

animated

Installation

streamlit-tree-select is distributed via. PyPi:

pip install streamlit-tree-select

Quickstart

Using streamlit-tree-select is as simple as importing tree_select and passing a list of nodes.

import streamlit as st
from streamlit_tree_select import tree_select

st.title("🐙 Streamlit-tree-select")
st.subheader("A simple and elegant checkbox tree for Streamlit.")

# Create nodes to display
nodes = [
    {"label": "Folder A", "value": "folder_a"},
    {
        "label": "Folder B",
        "value": "folder_b",
        "children": [
            {"label": "Sub-folder A", "value": "sub_a"},
            {"label": "Sub-folder B", "value": "sub_b"},
            {"label": "Sub-folder C", "value": "sub_c"},
        ],
    },
    {
        "label": "Folder C",
        "value": "folder_c",
        "children": [
            {"label": "Sub-folder D", "value": "sub_d"},
            {
                "label": "Sub-folder E",
                "value": "sub_e",
                "children": [
                    {"label": "Sub-sub-folder A", "value": "sub_sub_a"},
                    {"label": "Sub-sub-folder B", "value": "sub_sub_b"},
                ],
            },
            {"label": "Sub-folder F", "value": "sub_f"},
        ],
    },
]

return_select = tree_select(nodes)
st.write(return_select)

Properties

The tree select can be customized using the following parameters:

Property Type Description Default
nodes list A list containing tree nodes and their children. A need needs to include a label and a value. Furthermore, a list of children can be added. Further possible parameters: className (A class Name to add to the node, default None), disabled (Whether the node should be disabled, default False), showCheckbox (Whether the node should show a checkbox, default True), title (A custom title attribute for th node, default None). []
check_model str Specifies which selected nodes should be returned. Possible inputs: "all", "leaf". 'all'
checked list A list of selected nodes. []
direction str Specify the direction of the component. Left-to-right ('ltr') or right-to-left ('rtl'). 'ltr'
disabled bool If True, the component will be disabled and cannot be used. False
expand_disabled bool If True, nodes cannot be expanded. False
expand_on_click bool If True, nodes will be expanded by clicking on the labels. False
expanded list A list of expanded node values. []
no_cascade bool If True, toggling a parent node will not cascade its check state to its children. False
only_leaf_checkboxes bool If True, checkboxes will only be shown for leaf nodes. False
show_expand_all bool If True buttons for expanding and collapsing all parent nodes will appear in the tree. False

Returns

tree_select returns a dictionary containing the keys checked node values as well as expanded node values.

Property Type Description Default
checked list A list of expanded node values. []
expanded list A list of expanded node values. []

Metadata

Release files for streamlit-tree-select-dark 0.0.17

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-tree-select-dark 0.0.17
File Size Uploaded
streamlit_tree_select_dark-0.0.17.tar.gz 3.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-tree-select-dark 0.0.17
File Interpreter ABI Platform
streamlit_tree_select_dark-0.0.17-py3-none-any.whl Python 3 none any Details

Total release size: 5.4 MB

Release files / streamlit_tree_select_dark-0.0.17.tar.gz

Download URL streamlit_tree_select_dark-0.0.17.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
905385b9d6b5ab754053014c7119a83c0483b607894a5c568250bbf7aa038ac0
BLAKE2b-256 checksum
How to use checksums
61c1ed5295b989df1e2bc0cbb24aa299aa7b3f61c1f709335f2ac4369f476bea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / streamlit_tree_select_dark-0.0.17-py3-none-any.whl

Download URL streamlit_tree_select_dark-0.0.17-py3-none-any.whl
Size 2.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
93de6dc53efc988800bafb8da1c6c900288baf4d977c09f0756b600a89b7e969
BLAKE2b-256 checksum
How to use checksums
d0e805c9622f959da840706775047e0966149b5d709e8dc4f6e75928b32df01b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.0.17 This release

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

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