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

streamlit-tree-select-dark

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

streamlit-tree-select-dark

A simple and elegant checkbox tree for Streamlit.

  • 0.0.17
  • PyPI
  • Socket score

Maintainers
1

🐙 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:

PropertyTypeDescriptionDefault
nodeslistA 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_modelstrSpecifies which selected nodes should be returned. Possible inputs: "all", "leaf".'all'
checkedlistA list of selected nodes.[]
directionstrSpecify the direction of the component. Left-to-right ('ltr') or right-to-left ('rtl').'ltr'
disabledboolIf True, the component will be disabled and cannot be used.False
expand_disabledboolIf True, nodes cannot be expanded.False
expand_on_clickboolIf True, nodes will be expanded by clicking on the labels.False
expandedlistA list of expanded node values.[]
no_cascadeboolIf True, toggling a parent node will not cascade its check state to its children.False
only_leaf_checkboxesboolIf True, checkboxes will only be shown for leaf nodes.False
show_expand_allboolIf 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.

PropertyTypeDescriptionDefault
checkedlistA list of expanded node values.[]
expandedlistA list of expanded node values.[]

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