[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KGJ7M5Q1RHBZ72MCWTM9GQ":3,"skill-same:01M6KGJ7M5Q1RHBZ72MCWTM9GQ":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":28,"linkOnly":29,"markdownContent":30,"markdownBody":31,"frontMatter":32,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":39,"install":40,"resources":53},"01M6KGJ7M5Q1RHBZ72MCWTM9GQ","using-streamlit-layouts",null,"Structuring Streamlit app layouts. Use when placing content in sidebars, columns, containers, or dialogs. Covers sidebar usage, column limits, horizontal containers, dialogs, and bordered cards.","legout\u002Fpi-config","legout","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1469563?v=4","01M6KGERP7E8TF4XARRKPFJ6HQ","Volker L.","01M6KGERT1FYD049PP1WW923TZ",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flegout\u002Fpi-config\u002Fblob\u002Fmain\u002Finstalled-skills\u002Fdeveloping-with-streamlit\u002Fskills\u002Fusing-streamlit-layouts\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27],"streamlit","using streamlit layouts","containers","content","use","app","column","columns","usage","2026-11-10 10:12:30",false,"---\nname: using-streamlit-layouts\ndescription: Structuring Streamlit app layouts. Use when placing content in sidebars, columns, containers, or dialogs. Covers sidebar usage, column limits, horizontal containers, dialogs, and bordered cards.\nlicense: Apache-2.0\n---\n\n# Streamlit layout\n\nHow you structure your app affects usability more than you think.\n\n## Sidebar: navigation + global filters only\n\nThe sidebar should only contain navigation and app-level filters. Main content goes in the main area.\n\n```python\n# GOOD\nwith st.sidebar:\n    date_range = st.date_input(\"Date range\")\n    region = st.selectbox(\"Region\", [\"All\", \"US\", \"EU\", \"APAC\"])\n    st.caption(\"App v1.2.3\")\n```\n\n```python\n# BAD: Too much content in sidebar\nwith st.sidebar:\n    st.title(\"Dashboard\")\n    st.dataframe(df)  # Don't put main content here\n    st.bar_chart(data)\n```\n\n**What goes in sidebar:**\n- Global filters (date range, user selection, region)\n- App info (version, feedback link)\n\n**What stays out:**\n- Main content, charts, tables, results\n\n## Columns: max 4, set alignment\n\nDon't use too many columns—they get cramped.\n\n```python\n# GOOD\ncol1, col2 = st.columns(2)\n\n# Custom widths (ratios)\ncol1, col2 = st.columns([2, 1])  # 2:1 ratio\n\n# OK with alignment\ncols = st.columns(4, vertical_alignment=\"center\")\n\n# BAD: Too many, cramped\ncol1, col2, col3, col4, col5, col6 = st.columns(6)\n```\n\n## Horizontal containers for button groups\n\nUse `st.container(horizontal=True)` instead of columns for button groups:\n\n```python\nwith st.container(horizontal=True):\n    st.button(\"Cancel\")\n    st.button(\"Save\")\n    st.button(\"Submit\")\n```\n\n## Aligning elements\n\nUse `horizontal_alignment` on containers to position elements:\n\n```python\n# Center elements\nwith st.container(horizontal_alignment=\"center\"):\n    st.image(\"logo.png\", width=200)\n    st.title(\"Welcome\")\n\n# Right-align elements\nwith st.container(horizontal_alignment=\"right\"):\n    st.button(\"Settings\", icon=\":material\u002Fsettings:\")\n\n# Distribute evenly (great for button groups)\nwith st.container(horizontal=True, horizontal_alignment=\"distribute\"):\n    st.button(\"Cancel\")\n    st.button(\"Save\")\n    st.button(\"Submit\")\n```\n\nOptions: `\"left\"` (default), `\"center\"`, `\"right\"`, `\"distribute\"`\n\n## Bordered containers\n\nUse `border=True` on containers for visual grouping. See `building-streamlit-dashboards` for dashboard-specific patterns like KPI cards.\n\n```python\nwith st.container(border=True):\n    st.subheader(\"Section title\")\n    st.write(\"Grouped content here\")\n```\n\n## Tabs\n\nOrganize content into switchable views:\n\n```python\ntab1, tab2 = st.tabs([\"Chart\", \"Data\"])\n\nwith tab1:\n    st.line_chart(data)\nwith tab2:\n    st.dataframe(df)\n```\n\n## Expander\n\nCollapsible sections for secondary content:\n\n```python\nwith st.expander(\"See details\"):\n    st.write(\"Hidden content here\")\n    st.code(\"print('hello')\")\n```\n\n## Empty and placeholders\n\n`st.empty()` creates a single-element placeholder that can be updated or cleared:\n\n```python\nplaceholder = st.empty()\n\n# Update the placeholder\nplaceholder.text(\"Loading...\")\nresult = load_data()\nplaceholder.dataframe(result)\n\n# Clear it\nplaceholder.empty()\n```\n\n## Popover\n\nClick to reveal content:\n\n```python\nwith st.popover(\"Settings\"):\n    st.checkbox(\"Dark mode\")\n    st.slider(\"Font size\", 10, 24)\n```\n\n## Dialogs for focused interactions\n\nUse `@st.dialog` for UI that doesn't need to be always visible:\n\n```python\n@st.dialog(\"Confirm deletion\")\ndef confirm_delete(item_name):\n    st.write(f\"Are you sure you want to delete **{item_name}**?\")\n    if st.button(\"Delete\", type=\"primary\"):\n        delete_item(item_name)\n        st.rerun()\n\nif st.button(\"Delete item\"):\n    confirm_delete(\"My Document\")\n```\n\n**Key points:**\n- Dialogs rerun independently from the main script\n- Use `st.session_state` to pass widget values from the dialog to the main app\n- Call `st.rerun()` to close dialog and refresh main app\n- Use `dismissible=False` for forced actions\n- `st.sidebar` is not supported inside dialogs\n\n**When to use dialogs:**\n- Confirmation prompts\n- Settings panels\n- Forms that don't need to be always visible\n\n## Spacing\n\nControl spacing between elements with `gap` on containers:\n\n```python\n# Remove spacing for tight list-like UIs\nwith st.container(gap=None, border=True):\n    for item in items:\n        st.checkbox(item.text)\n\n# Explicit gap sizes\nwith st.container(gap=\"small\"):\n    ...\n```\n\nAdd vertical space with `st.space`:\n\n```python\nst.space(\"small\")   # Small gap\nst.space(\"medium\")  # Medium gap\nst.space(\"large\")   # Large gap\nst.space(50)        # Custom pixels\n```\n\n## Width and height\n\nControl element sizing:\n\n```python\n# Stretch to fill available space (equal height columns)\ncols = st.columns(2)\nwith cols[0].container(border=True, height=\"stretch\"):\n    st.line_chart(data)\nwith cols[1].container(border=True, height=\"stretch\"):\n    st.dataframe(df)\n\n# Shrink to content size\nst.container(width=\"content\")\n\n# Fixed pixel sizes\nst.container(height=300)\n```\n\n## References\n\n- [st.columns](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.columns)\n- [st.container](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.container)\n- [st.sidebar](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.sidebar)\n- [st.tabs](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.tabs)\n- [st.expander](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.expander)\n- [st.popover](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.popover)\n- [st.empty](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.empty)\n- [st.dialog](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Fexecution-flow\u002Fst.dialog)\n","# Streamlit layout\n\nHow you structure your app affects usability more than you think.\n\n## Sidebar: navigation + global filters only\n\nThe sidebar should only contain navigation and app-level filters. Main content goes in the main area.\n\n```python\n# GOOD\nwith st.sidebar:\n    date_range = st.date_input(\"Date range\")\n    region = st.selectbox(\"Region\", [\"All\", \"US\", \"EU\", \"APAC\"])\n    st.caption(\"App v1.2.3\")\n```\n\n```python\n# BAD: Too much content in sidebar\nwith st.sidebar:\n    st.title(\"Dashboard\")\n    st.dataframe(df)  # Don't put main content here\n    st.bar_chart(data)\n```\n\n**What goes in sidebar:**\n- Global filters (date range, user selection, region)\n- App info (version, feedback link)\n\n**What stays out:**\n- Main content, charts, tables, results\n\n## Columns: max 4, set alignment\n\nDon't use too many columns—they get cramped.\n\n```python\n# GOOD\ncol1, col2 = st.columns(2)\n\n# Custom widths (ratios)\ncol1, col2 = st.columns([2, 1])  # 2:1 ratio\n\n# OK with alignment\ncols = st.columns(4, vertical_alignment=\"center\")\n\n# BAD: Too many, cramped\ncol1, col2, col3, col4, col5, col6 = st.columns(6)\n```\n\n## Horizontal containers for button groups\n\nUse `st.container(horizontal=True)` instead of columns for button groups:\n\n```python\nwith st.container(horizontal=True):\n    st.button(\"Cancel\")\n    st.button(\"Save\")\n    st.button(\"Submit\")\n```\n\n## Aligning elements\n\nUse `horizontal_alignment` on containers to position elements:\n\n```python\n# Center elements\nwith st.container(horizontal_alignment=\"center\"):\n    st.image(\"logo.png\", width=200)\n    st.title(\"Welcome\")\n\n# Right-align elements\nwith st.container(horizontal_alignment=\"right\"):\n    st.button(\"Settings\", icon=\":material\u002Fsettings:\")\n\n# Distribute evenly (great for button groups)\nwith st.container(horizontal=True, horizontal_alignment=\"distribute\"):\n    st.button(\"Cancel\")\n    st.button(\"Save\")\n    st.button(\"Submit\")\n```\n\nOptions: `\"left\"` (default), `\"center\"`, `\"right\"`, `\"distribute\"`\n\n## Bordered containers\n\nUse `border=True` on containers for visual grouping. See `building-streamlit-dashboards` for dashboard-specific patterns like KPI cards.\n\n```python\nwith st.container(border=True):\n    st.subheader(\"Section title\")\n    st.write(\"Grouped content here\")\n```\n\n## Tabs\n\nOrganize content into switchable views:\n\n```python\ntab1, tab2 = st.tabs([\"Chart\", \"Data\"])\n\nwith tab1:\n    st.line_chart(data)\nwith tab2:\n    st.dataframe(df)\n```\n\n## Expander\n\nCollapsible sections for secondary content:\n\n```python\nwith st.expander(\"See details\"):\n    st.write(\"Hidden content here\")\n    st.code(\"print('hello')\")\n```\n\n## Empty and placeholders\n\n`st.empty()` creates a single-element placeholder that can be updated or cleared:\n\n```python\nplaceholder = st.empty()\n\n# Update the placeholder\nplaceholder.text(\"Loading...\")\nresult = load_data()\nplaceholder.dataframe(result)\n\n# Clear it\nplaceholder.empty()\n```\n\n## Popover\n\nClick to reveal content:\n\n```python\nwith st.popover(\"Settings\"):\n    st.checkbox(\"Dark mode\")\n    st.slider(\"Font size\", 10, 24)\n```\n\n## Dialogs for focused interactions\n\nUse `@st.dialog` for UI that doesn't need to be always visible:\n\n```python\n@st.dialog(\"Confirm deletion\")\ndef confirm_delete(item_name):\n    st.write(f\"Are you sure you want to delete **{item_name}**?\")\n    if st.button(\"Delete\", type=\"primary\"):\n        delete_item(item_name)\n        st.rerun()\n\nif st.button(\"Delete item\"):\n    confirm_delete(\"My Document\")\n```\n\n**Key points:**\n- Dialogs rerun independently from the main script\n- Use `st.session_state` to pass widget values from the dialog to the main app\n- Call `st.rerun()` to close dialog and refresh main app\n- Use `dismissible=False` for forced actions\n- `st.sidebar` is not supported inside dialogs\n\n**When to use dialogs:**\n- Confirmation prompts\n- Settings panels\n- Forms that don't need to be always visible\n\n## Spacing\n\nControl spacing between elements with `gap` on containers:\n\n```python\n# Remove spacing for tight list-like UIs\nwith st.container(gap=None, border=True):\n    for item in items:\n        st.checkbox(item.text)\n\n# Explicit gap sizes\nwith st.container(gap=\"small\"):\n    ...\n```\n\nAdd vertical space with `st.space`:\n\n```python\nst.space(\"small\")   # Small gap\nst.space(\"medium\")  # Medium gap\nst.space(\"large\")   # Large gap\nst.space(50)        # Custom pixels\n```\n\n## Width and height\n\nControl element sizing:\n\n```python\n# Stretch to fill available space (equal height columns)\ncols = st.columns(2)\nwith cols[0].container(border=True, height=\"stretch\"):\n    st.line_chart(data)\nwith cols[1].container(border=True, height=\"stretch\"):\n    st.dataframe(df)\n\n# Shrink to content size\nst.container(width=\"content\")\n\n# Fixed pixel sizes\nst.container(height=300)\n```\n\n## References\n\n- [st.columns](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.columns)\n- [st.container](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.container)\n- [st.sidebar](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.sidebar)\n- [st.tabs](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.tabs)\n- [st.expander](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.expander)\n- [st.popover](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.popover)\n- [st.empty](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Flayout\u002Fst.empty)\n- [st.dialog](https:\u002F\u002Fdocs.streamlit.io\u002Fdevelop\u002Fapi-reference\u002Fexecution-flow\u002Fst.dialog)\n",{"name":5,"license":15,"description":7},"main","3efae68c898153694a2f4aad309c7ff9847b5602","installed-skills\u002Fdeveloping-with-streamlit\u002Fskills\u002Fusing-streamlit-layouts",0,"https:\u002F\u002Fgithub.com\u002Flegout\u002Fpi-config","https:\u002F\u002Fgithub.com\u002Flegout","2026-04-28 16:32:33",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add legout\u002Fpi-config --skill using-streamlit-layouts",{"tool":46,"command":47},"bunx","bunx skills add legout\u002Fpi-config --skill using-streamlit-layouts",{"tool":49,"command":50},"pnpm","pnpm dlx skills add legout\u002Fpi-config --skill using-streamlit-layouts","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flegout\u002Fpi-config\u002Fblob\u002Fmain\u002Finstalled-skills\u002Fdeveloping-with-streamlit\u002Fskills\u002Fusing-streamlit-layouts\u002FSKILL.md",true,[],[55,92,120,135,153,174],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":72,"publishedAt":28},"01M6KGW7MYKZ8MWFKN1V8ZJ2EG","visual-explainer","Generate beautiful, self-contained HTML pages that visually explain systems, code changes, plans, and data. Use when the user asks for a diagram, architecture overview, diff review, plan review, project recap, comparison table, or any visual explanation of technical concepts. Also use proactively when you are about to render a complex ASCII table (4+ rows or 3+ columns) — present it as a styled HTML page instead.","MIT","https:\u002F\u002Fgithub.com\u002Flegout\u002Fpi-config\u002Fblob\u002Fmain\u002Fskills\u002Fvisual-explainer\u002FSKILL.md",[62,67],{"categoryNo":63,"categoryName":64,"taxonomyType":65,"taxonomyTypeDesc":66},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",{"categoryNo":68,"categoryName":69,"taxonomyType":70,"taxonomyTypeDesc":71},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[73,74,75,76,77,78,79,80,81,23,82,83,84,85,86,87,88,89,90,91],"visual explainer","explainer","visual","image","architecture","generate","plan","table","view","files","project","present","as","ascii table","ascii","you","concepts","surf","for",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":104,"publishedAt":28},"01M6KGTMTJR6RXXC8AF29MQQW5","table-extractor",">","https:\u002F\u002Fgithub.com\u002Flegout\u002Fpi-config\u002Fblob\u002Fmain\u002Finstalled-skills\u002Ftable-extractor\u002FSKILL.md",[98,101],{"categoryNo":99,"categoryName":100,"taxonomyType":65,"taxonomyTypeDesc":66},"01JBSEEDCAT000000000000002","文档处理",{"categoryNo":102,"categoryName":103,"taxonomyType":65,"taxonomyTypeDesc":66},"01JBSEEDCAT000000000000023","Skill与智能体开发",[80,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119],"table extractor","PDF","MCP","gpt","extraction","office","data","parsing","extract","en","zh","camelot","sonnet","opus","tables",{"skillNo":121,"name":122,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":127,"publishedAt":28},"01M6KGSWF2R22Z63PAY5NT6GRY","smart-ocr","https:\u002F\u002Fgithub.com\u002Flegout\u002Fpi-config\u002Fblob\u002Fmain\u002Finstalled-skills\u002Fsmart-ocr\u002FSKILL.md",[125,126],{"categoryNo":99,"categoryName":100,"taxonomyType":65,"taxonomyTypeDesc":66},{"categoryNo":102,"categoryName":103,"taxonomyType":65,"taxonomyTypeDesc":66},[128,129,106,107,130,108,109,110,112,131,113,114,115,132,133,117,118,134],"ocr","smart ocr","support","text","multilingual","processing","paddleocr",{"skillNo":136,"name":137,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":145,"publishedAt":28},"01M6KGMKKFNC1PRNX2W3E243DR","html-slides","https:\u002F\u002Fgithub.com\u002Flegout\u002Fpi-config\u002Fblob\u002Fmain\u002Finstalled-skills\u002Fhtml-slides\u002FSKILL.md",[140,143,144],{"categoryNo":141,"categoryName":142,"taxonomyType":65,"taxonomyTypeDesc":66},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":63,"categoryName":64,"taxonomyType":65,"taxonomyTypeDesc":66},{"categoryNo":102,"categoryName":103,"taxonomyType":65,"taxonomyTypeDesc":66},[146,147,148,149,107,150,108,110,114,115,151,152,117,118],"slides","html","html slides","pptx","web","revealjs","presentation",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":28},"01M6KGJGVM0TWW632Y6VQQV2WN","using-streamlit-session-state","Using st.session_state to manage state across Streamlit reruns. Use when persisting data, handling widget state, implementing callbacks, or debugging state issues. Covers initialization patterns, widget-state association, and common gotchas.","https:\u002F\u002Fgithub.com\u002Flegout\u002Fpi-config\u002Fblob\u002Fmain\u002Finstalled-skills\u002Fdeveloping-with-streamlit\u002Fskills\u002Fusing-streamlit-session-state\u002FSKILL.md",[],[160,161,19,162,163,164,165,111,166,23,167,168,169,170,171,172,173],"state","session","session state","using streamlit session state","debugging","issues","common","manage","patterns","across","widget","Callbacks","implementing","initialization",{"skillNo":175,"name":176,"nameZh":6,"description":177,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":178,"categories":179,"keywords":181,"publishedAt":28},"01M6KGJD12GJB7W0ZG66JK00F6","using-streamlit-markdown","Covers all Markdown features in Streamlit including GitHub-flavored syntax plus Streamlit extensions like colored text, badges, Material icons, and LaTeX. Use when formatting text, labels, tooltips, or any text-rendering element.","https:\u002F\u002Fgithub.com\u002Flegout\u002Fpi-config\u002Fblob\u002Fmain\u002Finstalled-skills\u002Fdeveloping-with-streamlit\u002Fskills\u002Fusing-streamlit-markdown\u002FSKILL.md",[180],{"categoryNo":99,"categoryName":100,"taxonomyType":65,"taxonomyTypeDesc":66},[182,19,183,184,185,186,131,187,23,188,189,190,191,192,193,194],"markdown","using streamlit markdown","github","icons","LaTeX","syntax","formatting","element","material","rendering","extensions","features","labels"]