legout/pi-config/using-streamlit-layouts
Claude Code and agent skill by legout/pi-config
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install legout/pi-config/using-streamlit-layoutsSKILL.md
The same SKILL.md was published earlier as ddtully/dotfiles/using-streamlit-layouts.
Streamlit layout
How you structure your app affects usability more than you think.
Sidebar: navigation + global filters only
The sidebar should only contain navigation and app-level filters. Main content goes in the main area.
What goes in sidebar:
- Global filters (date range, user selection, region)
- App info (version, feedback link)
What stays out:
- Main content, charts, tables, results
Columns: max 4, set alignment
Don't use too many columns—they get cramped.
Horizontal containers for button groups
Use st.container(horizontal=True) instead of columns for button groups:
Aligning elements
Use horizontal_alignment on containers to position elements:
Options: "left" (default), "center", "right", "distribute"
Bordered containers
Use border=True on containers for visual grouping. See building-streamlit-dashboards for dashboard-specific patterns like KPI cards.
Tabs
Organize content into switchable views:
Expander
Collapsible sections for secondary content:
Empty and placeholders
st.empty() creates a single-element placeholder that can be updated or cleared:
Popover
Click to reveal content:
Dialogs for focused interactions
Use @st.dialog for UI that doesn't need to be always visible:
Key points:
- Dialogs rerun independently from the main script
- Use
st.session_stateto pass widget values from the dialog to the main app - Call
st.rerun()to close dialog and refresh main app - Use
dismissible=Falsefor forced actions st.sidebaris not supported inside dialogs
When to use dialogs:
- Confirmation prompts
- Settings panels
- Forms that don't need to be always visible
Spacing
Control spacing between elements with gap on containers:
Add vertical space with st.space:
Width and height
Control element sizing:
References
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinginstalled-skills/developing-with-streamlit/skills/using-streamlit-layouts/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/legout/pi-config/using-streamlit-layouts)