app.py 859 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. '''
  4. @Contact : liuyuqi.gov@msn.cn
  5. @Time : 2024/10/06 17:41:46
  6. @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
  7. @Desc : Streamlit 应用中集成 Ant Design 组件
  8. '''
  9. import streamlit as st
  10. import streamlit_antd_components as sac
  11. st.set_page_config(
  12. page_title="Ant Design",
  13. page_icon="👋",
  14. layout="wide",
  15. initial_sidebar_state="expanded",
  16. menu_items={
  17. "Report a bug": "https://github.com/streamlit/streamlit/issues/new/choose",
  18. "Get help": "https://discuss.streamlit.io/"
  19. }
  20. )
  21. # 三个按钮
  22. btn = sac.buttons(
  23. items=['button1', 'button23', 'button3'],
  24. index=0,
  25. format_func='title',
  26. align='center',
  27. direction='horizontal',
  28. radius='lg',
  29. return_index=False,
  30. )
  31. st.write(f'The selected button label is: {btn}')