Registry /
web-framework / streamlit-antd-components
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.fixPin 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.fixUse `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.fixUse `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.
fixRun `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.
fixChange 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).
fixUse `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.