Registry / web-framework / streamlit-antd-components

streamlit-antd-components

JSON →
library0.3.2pypypi✓ verified 85d ago

A library providing custom Streamlit components built on Ant Design and Mantine. Currently at version 0.3.2, it offers rich UI widgets like buttons, menus, tags, and more for Streamlit apps. Release cadence is irregular; last update was in 2023.

pip install streamlit-antd-components
INSTALL
IMPORT
SIG · STREAMLIT-ANTD-COM
S
streamlit-antd-components
web-frameworkpythonv0.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sac
import streamlit_antd_components as sac
import streamlit_antd_components
Common alias is sac; using full name leads to long code.

Create a simple menu component with Ant Design styling.

import streamlit as st import streamlit_antd_components as sac menu_item = sac.menu([ sac.MenuItem('Home', icon='house'), sac.MenuItem('Settings', icon='gear'), ], index=0, format_func='title', key='menu') st.write(f'Selected: {menu_item}')
Debug
Known issues
gotchaThe library only works with Streamlit version <1.24.0 due to changes in Streamlit's component communication protocol.
fix
Pin Streamlit to 1.23.0 or downgrade: `pip install streamlit==1.23.0`
affects: streamlit >=1.24.0
deprecatedThe `sac.buttons` component expects a list of strings, not a list of dicts.
fix
Use `sac.buttons(['A', 'B', 'C'], ...)` instead of `sac.buttons([{'label':'A'}])`
affects: 0.1.0 - 0.3.2
gotchaImporting `streamlit_antd_components` directly without alias may cause namespace conflicts.
fix
Use `import streamlit_antd_components as sac` and reference as `sac.Buttons` etc.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'streamlit_antd_components'
The package is not installed or installed in the wrong environment.
fix
Run `pip install streamlit-antd-components` in your environment.
StreamlitAPIException: Unsupported component type: object
Passing a list of dicts to `sac.buttons` instead of a list of strings.
fix
Change to `sac.buttons(['Item1', 'Item2'])`.
AttributeError: module 'streamlit_antd_components' has no attribute 'Buttons'
Using a wrong alias or incorrect import; the correct spelling is `Buttons` (capital B).
fix
Use `sac.Buttons(...)` or import correctly: `import streamlit_antd_components as sac`.
Upgrade
Version history
0.3.2latest on PyPI · released Jan 19, 2024
Audit
Dependencies
streamlitrequiredRequired; the library is a Streamlit extension.
Agent activity
3 hits · last 30 days
node
2
Resources
streamlit-antd-components — pip install streamlit-antd-components · libregistry